Difference between pages "r7.1.1:Define LIBTEST PAL OS STRING" and "r7.1.1:Define LIBTEST PAL STDLIB CALLBACK CALLING CONVENTION"
(Difference between pages)
Jump to navigation
Jump to search
m (1 revision imported) |
m (1 revision imported) |
||
Line 1: | Line 1: | ||
{{DISPLAYTITLE:define | {{DISPLAYTITLE:define LIBTEST_PAL_STDLIB_CALLBACK_CALLING_CONVENTION}} | ||
==Source File== | ==Source File== | ||
└───test_and_benchmark | └───test_and_benchmark | ||
Line 8: | Line 8: | ||
==Define== | ==Define== | ||
#define | #define LIBTEST_PAL_STDLIB_CALLBACK_CALLING_CONVENTION [calling convention] | ||
==Example== | ==Example== | ||
#define | #if( defined _WIN32 && define KERNEL_BUILD && defined _M_IX86 ) | ||
// TRD : bloody x86 on MSVC... | |||
#define LIBTEST_PAL_STDLIB_CALLBACK_CALLING_CONVENTION __cdecl | |||
#endif | |||
==Optionality== | ==Optionality== | ||
This define is mandatory and the library cannot compile if it is not set. | This define is mandatory and the library cannot compile if in the cases where it is needed, it is not set. If the define is not required, it must be defined as empty, rather than omitted. | ||
==Notes== | ==Notes== | ||
This define is | Winner of "World's Most Annoying Abstraction Define" award. | ||
When building for and only for Windows kernel targetting x86, callback functions passed to standard library functions such as ''qsort'' or ''bsearch'' have a calling convention which differs to the build default, which breaks compilation. This has to be handled, and that in turns means this define has to exist. It is defined as empty on all platforms except for Windows kernel x86. | |||
This define will go away when the vestigal use of ''qsort'' and ''bsearch'' (there's one use of each) are removed from ''libtest''. | |||
==See Also== | ==See Also== | ||
* [[r7.1.1:Porting Guide (libtest)|Porting Guide (libtest)]] | * [[r7.1.1:Porting Guide (libtest)|Porting Guide (libtest)]] |
Latest revision as of 20:16, 17 February 2017
Source File
└───test_and_benchmark └───libtest └───inc └───libtest libtest_porting_abstraction_layer_compiler.h
Define
#define LIBTEST_PAL_STDLIB_CALLBACK_CALLING_CONVENTION [calling convention]
Example
#if( defined _WIN32 && define KERNEL_BUILD && defined _M_IX86 ) // TRD : bloody x86 on MSVC... #define LIBTEST_PAL_STDLIB_CALLBACK_CALLING_CONVENTION __cdecl #endif
Optionality
This define is mandatory and the library cannot compile if in the cases where it is needed, it is not set. If the define is not required, it must be defined as empty, rather than omitted.
Notes
Winner of "World's Most Annoying Abstraction Define" award.
When building for and only for Windows kernel targetting x86, callback functions passed to standard library functions such as qsort or bsearch have a calling convention which differs to the build default, which breaks compilation. This has to be handled, and that in turns means this define has to exist. It is defined as empty on all platforms except for Windows kernel x86.
This define will go away when the vestigal use of qsort and bsearch (there's one use of each) are removed from libtest.