分类:
2007-10-18 15:03:55
|
/*
Test Env:
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 12.00.8168 for 80x86
Microsoft Windows 2000 [Version 5.00.2195]
Result:
sizeof(uint64_t) = 8
sizeof(uint32_t) = 4
t321[7C4E].31822 t322[7C4E].31822 t323[4].4
t641[7C4E].31822 t642[7C4E].31822 t643[4].4
1122334455667788 1234605616436508552
--------------------------------------
Test Env:
gcc version 3.2.3 20030502 (Red Hat Linux 3.2.3-47.3)
Result:
sizeof(uint64_t) = 8
sizeof(uint32_t) = 4
t321[7C4E].31822 t322[7C4E].31822 t323[4].4
t641[7C4E].31822 t642[7C4E].31822 t643[4].4
1122334455667788 1234605616436508552
*/
在进行移植的时候可能用的上的:
#ifdef _WIN32
# define APR_UINT64_T_HEX_FMT "llx"
#else
# define APR_UINT64_T_HEX_FMT "I64x"
#endif
example:
sprintf(buf, "%" APR_UINT64_T_HEX_FMT, var);
#define HOST_WIDEST_INT_PRINT_DEC "%I64d"
#define HOST_WIDEST_INT_PRINT_UNSIGNED "%I64u"
#define HOST_WIDEST_INT_PRINT_HEX "0x%I64x"