2 #include "libtest_porting_abstraction_layer_internal.h"
4 /* TRD : libtest_pal_malloc() and libtest_pal_free() are used for and only for
7 if either is not implemented, the test will not run
9 that's the only impact of their presence or absence
16 /****************************************************************************/
17 #if( defined _MSC_VER )
18 /* TRD : MSVC compiler
20 an unfortunately necessary hack for MSVC
21 MSVC only defines __STDC__ if /Za is given, where /Za turns off MSVC C extensions -
22 which prevents Windows header files from compiling.
26 #define __STDC_HOSTED__ 1
33 /****************************************************************************/
34 #if( defined __STDC__ && defined __STDC_HOSTED__ && __STDC_HOSTED__ == 1 && !defined KERNEL_MODE )
36 #ifdef LIBTEST_PAL_FREE
37 #error More than one porting abstraction layer matches the current platform in "libtest_porting_abstraction_layer_free.c".
40 #define LIBTEST_PAL_FREE
42 void libtest_pal_free( void *memory )
44 LFDS710_PAL_ASSERT( memory != NULL );
57 /****************************************************************************/
58 #if( defined _WIN32 && defined KERNEL_MODE )
60 #ifdef LIBTEST_PAL_FREE
61 #error More than one porting abstraction layer matches the current platform in "libtest_porting_abstraction_layer_free.c".
64 #define LIBTEST_PAL_FREE
66 void libtest_pal_free( void *memory )
68 LFDS710_PAL_ASSERT( memory != NULL );
70 ExFreePoolWithTag( memory, 'sdfl' );
81 /****************************************************************************/
82 #if( defined __linux__ && defined KERNEL_MODE )
84 #ifdef LIBTEST_PAL_FREE
85 #error More than one porting abstraction layer matches the current platform in "libtest_porting_abstraction_layer_free.c".
88 #define LIBTEST_PAL_FREE
90 void libtest_pal_free( void *memory )
92 LFDS710_PAL_ASSERT( memory != NULL );
105 /****************************************************************************/
106 #if( !defined LIBTEST_PAL_FREE )
108 void libtest_pal_free( void *memory )
110 LFDS710_PAL_ASSERT( memory != NULL );