Fix build on NetBSD: Stop mixing PAL and system headers in tests
authorKamil Rytarowski <n54@gmx.com>
Thu, 4 Feb 2016 02:34:09 +0000 (03:34 +0100)
committerKamil Rytarowski <n54@gmx.com>
Thu, 4 Feb 2016 02:36:38 +0000 (03:36 +0100)
Including both system and PAL headers results in clasesh like:

In file included from /tmp/pkgsrc-tmp/wip/coreclr-git/work/coreclr/src/pal/tests/palsuite/threading/GetThreadTimes/test1/test1.c:18:
In file included from /usr/include/sched.h:37:
In file included from /usr/include/sys/sched.h:73:
/usr/include/sys/types.h:54:18: error: typedef redefinition with different types ('__int8_t' (aka 'signed char') vs 'char')
typedef __int8_t        int8_t;
                        ^
/tmp/pkgsrc-tmp/wip/coreclr-git/work/coreclr/src/pal/inc/pal_mstypes.h:224:16: note: previous definition is here
typedef __int8 int8_t;
               ^

This fixes #2993 "Conflicts with system headers on NetBSD"

Thanks to Jan Kotas (Microsoft) for showing the right direction.

src/pal/tests/palsuite/threading/GetThreadTimes/test1/test1.c
src/pal/tests/palsuite/threading/QueryThreadCycleTime/test1/test1.c

index f6009b9..6b62c05 100644 (file)
@@ -13,9 +13,7 @@
 **
 **=========================================================*/
 
-#define _GNU_SOURCE
 #include <palsuite.h>
-#include <sched.h>
 
 int __cdecl main(int argc, char *argv[]) {
     int ret = FAIL;
@@ -102,6 +100,3 @@ int __cdecl main(int argc, char *argv[]) {
 EXIT:
     return ret;
 }
-
-
-
index b799848..54f0116 100644 (file)
@@ -13,9 +13,7 @@
 **
 **=========================================================*/
 
-#define _GNU_SOURCE
 #include <palsuite.h>
-#include <sched.h>
 
 int __cdecl main(int argc, char *argv[]) {
     int ret = FAIL;
@@ -98,6 +96,3 @@ int __cdecl main(int argc, char *argv[]) {
 EXIT:
     return ret;
 }
-
-
-