分类:
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"
2008-07-21 13:10:54
thanks for your sharing!