1 /****************************************************************************/
2 #if( defined _MSC_VER )
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.
11 #define __STDC_HOSTED__ 1
18 /****************************************************************************/
19 #if( defined _MSC_VER && _MSC_VER >= 1400 && __STDC_HOSTED__ == 1 && !defined _KERNEL_MODE )
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
27 #define LFDS700_PAL_PORTING_ABSTRACTION_LAYER_OPERATING_SYSTEM
31 #define LFDS700_PAL_OS_STRING "Windows"
32 #define LFDS700_PAL_ASSERT( expression ) assert( expression )
40 /****************************************************************************/
41 #if( defined _MSC_VER && _MSC_VER >= 1400 && defined __STDC_HOSTED__ && __STDC_HOSTED__ == 1 && defined _WIN32 && defined _KERNEL_MODE )
43 // TRD : MSVC, Windows kernel-mode
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
49 #define LFDS700_PAL_PORTING_ABSTRACTION_LAYER_OPERATING_SYSTEM
54 #define LFDS700_PAL_OS_STRING "Windows"
55 #define LFDS700_PAL_ASSERT( expression ) assert( expression )
63 /****************************************************************************/
64 #if( defined __GNUC__ && __STDC_HOSTED__ == 1 && !(defined __linux__ && defined _KERNEL_MODE) )
66 // TRD : GCC, hosted implementation (except for Linux kernel mode)
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
72 #define LFDS700_PAL_PORTING_ABSTRACTION_LAYER_OPERATING_SYSTEM
76 #define LFDS700_PAL_OS_STRING "Embedded (hosted)"
77 #define LFDS700_PAL_ASSERT( expression ) assert( expression )
85 /****************************************************************************/
86 #if( defined __GNUC__ && __STDC_HOSTED__ == 0 )
88 // TRD : GCC, freestanding or bare implementation
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
94 #define LFDS700_PAL_PORTING_ABSTRACTION_LAYER_OPERATING_SYSTEM
96 #define LFDS700_PAL_OS_STRING "Embedded (freestanding/bare)"
97 #define LFDS700_PAL_ASSERT( expression )
105 /****************************************************************************/
106 #if( defined __GNUC__ && defined __linux__ && defined _KERNEL_MODE )
108 // TRD : GCC, Linux kernel-mode
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
114 #define LFDS700_PAL_PORTING_ABSTRACTION_LAYER_OPERATING_SYSTEM
116 #include <linux/module.h>
118 #define LFDS700_PAL_OS_STRING "Linux"
119 #define LFDS700_PAL_ASSERT( expression ) BUG_ON( expression )
127 /****************************************************************************/
128 #if( !defined LFDS700_PAL_PORTING_ABSTRACTION_LAYER_OPERATING_SYSTEM )
130 #error No matching porting abstraction layer in lfds700_porting_abstraction_layer_operating_system.h