There are several significant differences between the mingw32 (gcc 4.3.0 based) compiler and the GCC 4.4 and later compilers. Mingw32 requires that types int, long, long long, unsigned { int, long, long long}, float, and double be the only types passed to va_arg(). This requires the programmer to ensure that va_arg is called with type int for arguments of any type with a size less-than or equal-to int. GCC 4.4 and later does not require this and performs the appropriate promotions for you. Mingw32 uses 32-bit long in both ia32 and x64 mode. GCC 4.4 makes long a 64-bit value when in x64 mode. Signed-off-by: darylm503 Reviewed-by: jcarsey git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12258 6f19259b-4bc3-4df7-8a09-765794883524
41 lines
1.3 KiB
C
41 lines
1.3 KiB
C
#include <x86/limits.h>
|
|
|
|
#define __POINTER_BIT 64
|
|
|
|
#if defined(__GNUC__)
|
|
#if __GNUC_PREREQ__(4,4)
|
|
#define __LONG_BIT 64
|
|
|
|
/** minimum value for an object of type long int **/
|
|
#define __LONG_MIN (-9223372036854775807LL - 1LL) // -(2^63 - 2)
|
|
|
|
/** maximum value for an object of type long int **/
|
|
#define __LONG_MAX (9223372036854775807LL) // 2^63 - 1
|
|
|
|
/** maximum value for an object of type unsigned long int **/
|
|
#define __ULONG_MAX 0xFFFFFFFFFFFFFFFFULL // 2^64 - 1
|
|
#else
|
|
#define __LONG_BIT 32
|
|
/** minimum value for an object of type long int **/
|
|
#define __LONG_MIN (-2147483647L - 1L) // -(2^31 - 1)
|
|
|
|
/** maximum value for an object of type long int **/
|
|
#define __LONG_MAX 2147483647L // 2^31 - 1
|
|
|
|
/** maximum value for an object of type unsigned long int **/
|
|
#define __ULONG_MAX 0xffffffff // 2^32 - 1
|
|
#endif
|
|
|
|
|
|
#else /* NOT defined(__GNUC__) */
|
|
#define __LONG_BIT 32
|
|
/** minimum value for an object of type long int **/
|
|
#define __LONG_MIN (-2147483647L - 1L) // -(2^31 - 1)
|
|
|
|
/** maximum value for an object of type long int **/
|
|
#define __LONG_MAX 2147483647L // 2^31 - 1
|
|
|
|
/** maximum value for an object of type unsigned long int **/
|
|
#define __ULONG_MAX 0xffffffff // 2^32 - 1
|
|
#endif
|