]> pd.if.org Git - liblfds/blob - liblfds/liblfds7.0.0/test/src/test_porting_abstraction_layer_operating_system.h
Initial import (all versions, including the new 7.1.0)
[liblfds] / liblfds / liblfds7.0.0 / test / src / test_porting_abstraction_layer_operating_system.h
1 /****************************************************************************/
2 #if( defined _MSC_VER )
3   /* TRD : MSVC compiler
4
5            an unfortunately necessary hack for MSVC
6            MSVC only defines __STDC__ if /Za is given, where /Za turns off MSVC C extensions - 
7            which prevents Windows header files from compiling.
8   */
9
10   #define __STDC__         1
11   #define __STDC_HOSTED__  1
12 #endif
13
14 #if( defined __linux__ )
15   #define _GNU_SOURCE
16   #include <unistd.h>
17 #endif
18
19
20
21
22
23 /****************************************************************************/
24 #if( defined _MSC_VER && _MSC_VER >= 1310 && NTDDI_VERSION >= NTDDI_WINXP && defined _WIN32 )
25
26   #ifdef TEST_PAL_PORTING_ABSTRACTION_LAYER
27     #error More than one porting abstraction layer matches current platform.
28   #endif
29
30   #define TEST_PAL_PORTING_ABSTRACTION_LAYER
31
32   #define TEST_PAL_OS_STRING "Windows"
33
34   #include <windows.h>
35
36   typedef HANDLE  test_pal_thread_state_t;
37   typedef DWORD   test_pal_thread_return_t;
38
39   #define TEST_PAL_CALLING_CONVENTION  WINAPI
40
41 #endif
42
43
44
45
46
47 /****************************************************************************/
48 #if( defined __GNUC__ && defined __linux__ && _POSIX_THREADS > 0 )
49
50   #ifdef TEST_PAL_PORTING_ABSTRACTION_LAYER
51     #error More than one porting abstraction layer matches current platform.
52   #endif
53
54   #define TEST_PAL_PORTING_ABSTRACTION_LAYER
55
56   #define TEST_PAL_OS_STRING "Linux"
57
58   #define _GNU_SOURCE
59
60   #include <pthread.h>
61   #include <sched.h>
62   #include <sys/syscall.h>
63   #include <sys/types.h>
64
65   typedef pthread_t  test_pal_thread_state_t;
66   typedef void *     test_pal_thread_return_t;
67
68   #define TEST_PAL_CALLING_CONVENTION  
69
70 #endif
71
72
73
74
75
76 /****************************************************************************/
77 #if( !defined TEST_PAL_PORTING_ABSTRACTION_LAYER )
78
79   #error No matching porting abstraction layer in test_porting_abstraction_layer_operating_system.h
80
81 #endif
82