Saturday, 15 September 2012

c - Is there a counterpart of __int32 in GCC? -



c - Is there a counterpart of __int32 in GCC? -

this question has reply here:

gcc fixed size integers 1 reply

i writing cross-platform library own use. library can used in linux kernel, nt kernel, , many other environments, don't want dependent on headers or libraries, if standard headers. so, cannot include stdint.h utilize int32_t.

if utilize vc++, can typedef __int32 my_int32;, because __int32 built in compiler.

is there counterpart of __int32 in gcc?

my current practice is:

typedef signed char ktl_int8; typedef signed short ktl_int16; typedef signed int ktl_int32; typedef signed long long ktl_int64; typedef unsigned char ktl_uint8; typedef unsigned short ktl_uint16; typedef unsigned int ktl_uint32; typedef unsigned long long ktl_uint64; static_assert(1 == sizeof(ktl_int8), "sizeof(ktl_int8) != 1"); static_assert(2 == sizeof(ktl_int16), "sizeof(ktl_int16) != 2"); static_assert(4 == sizeof(ktl_int32), "sizeof(ktl_int32) != 4"); static_assert(8 == sizeof(ktl_int64), "sizeof(ktl_int64) != 8");

i don't think so, no.

i looked @ gcc's extensions documentation didn't find other __int128.

c visual-c++ gcc types compiler-construction

No comments:

Post a Comment