]> pd.if.org Git - liblfds/blob - liblfds/liblfds7.0.0/liblfds700/inc/liblfds700/lfds700_porting_abstraction_layer_operating_system.h
Initial import (all versions, including the new 7.1.0)
[liblfds] / liblfds / liblfds7.0.0 / liblfds700 / inc / liblfds700 / lfds700_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
15
16
17
18 /****************************************************************************/
19 #if( defined _MSC_VER && _MSC_VER >= 1400 && __STDC_HOSTED__ == 1 && !defined _KERNEL_MODE )
20
21   // TRD : MSVC
22
23   #ifdef LFDS700_PAL_PORTING_ABSTRACTION_LAYER_OPERATING_SYSTEM
24     #error More than one porting abstraction layer matches the current platform in lfds700_porting_abstraction_layer_operating_system.h
25   #endif
26
27   #define LFDS700_PAL_PORTING_ABSTRACTION_LAYER_OPERATING_SYSTEM
28
29   #include <assert.h>
30
31   #define LFDS700_PAL_OS_STRING             "Windows"
32   #define LFDS700_PAL_ASSERT( expression )  assert( expression )
33
34 #endif
35
36
37
38
39
40 /****************************************************************************/
41 #if( defined _MSC_VER && _MSC_VER >= 1400 && defined __STDC_HOSTED__ && __STDC_HOSTED__ == 1 && defined _WIN32 && defined _KERNEL_MODE )
42
43   // TRD : MSVC, Windows kernel-mode
44
45   #ifdef LFDS700_PAL_PORTING_ABSTRACTION_LAYER_OPERATING_SYSTEM
46     #error More than one porting abstraction layer matches the current platform in lfds700_porting_abstraction_layer_operating_system.h
47   #endif
48
49   #define LFDS700_PAL_PORTING_ABSTRACTION_LAYER_OPERATING_SYSTEM
50
51   #include <assert.h>
52   #include <intrin.h>
53
54   #define LFDS700_PAL_OS_STRING             "Windows"
55   #define LFDS700_PAL_ASSERT( expression )  assert( expression )
56
57 #endif
58
59
60
61
62
63 /****************************************************************************/
64 #if( defined __GNUC__ && __STDC_HOSTED__ == 1 && !(defined __linux__ && defined _KERNEL_MODE) )
65
66   // TRD : GCC, hosted implementation (except for Linux kernel mode)
67
68   #ifdef LFDS700_PAL_PORTING_ABSTRACTION_LAYER_OPERATING_SYSTEM
69     #error More than one porting abstraction layer matches the current platform in lfds700_porting_abstraction_layer_operating_system.h
70   #endif
71
72   #define LFDS700_PAL_PORTING_ABSTRACTION_LAYER_OPERATING_SYSTEM
73
74   #include <assert.h>
75
76   #define LFDS700_PAL_OS_STRING             "Embedded (hosted)"
77   #define LFDS700_PAL_ASSERT( expression )  assert( expression )
78
79 #endif
80
81
82
83
84
85 /****************************************************************************/
86 #if( defined __GNUC__ && __STDC_HOSTED__ == 0 )
87
88   // TRD : GCC, freestanding or bare implementation
89
90   #ifdef LFDS700_PAL_PORTING_ABSTRACTION_LAYER_OPERATING_SYSTEM
91     #error More than one porting abstraction layer matches the current platform in lfds700_porting_abstraction_layer_operating_system.h
92   #endif
93
94   #define LFDS700_PAL_PORTING_ABSTRACTION_LAYER_OPERATING_SYSTEM
95
96   #define LFDS700_PAL_OS_STRING             "Embedded (freestanding/bare)"
97   #define LFDS700_PAL_ASSERT( expression )
98
99 #endif
100
101
102
103
104
105 /****************************************************************************/
106 #if( defined __GNUC__ && defined __linux__ && defined _KERNEL_MODE )
107
108   // TRD : GCC, Linux kernel-mode
109
110   #ifdef LFDS700_PAL_PORTING_ABSTRACTION_LAYER_OPERATING_SYSTEM
111     #error More than one porting abstraction layer matches the current platform in lfds700_porting_abstraction_layer_operating_system.h
112   #endif
113
114   #define LFDS700_PAL_PORTING_ABSTRACTION_LAYER_OPERATING_SYSTEM
115
116   #include <linux/module.h>
117
118   #define LFDS700_PAL_OS_STRING             "Linux"
119   #define LFDS700_PAL_ASSERT( expression )  BUG_ON( expression )
120
121 #endif
122
123
124
125
126
127 /****************************************************************************/
128 #if( !defined LFDS700_PAL_PORTING_ABSTRACTION_LAYER_OPERATING_SYSTEM )
129
130   #error No matching porting abstraction layer in lfds700_porting_abstraction_layer_operating_system.h
131
132 #endif
133