c++ - uint24_t and uint48_t in MinGW -
i'm looking uint24_t , uint48_t types in gcc , mingw. know neither standardized, i've come across references them online, , i'm trying figure out:
- what header need include them.
- whether cross-platform (at least on windows, linux, , mac osx), or specific targets.
- what names are. uint24_t, __uint24, __uint24_t?
the standard uintxx_t types provided in stdint.h (c, c++98) or cstdint (c++11).
on 8-bit data, 24-bit address avr architecture, gcc provides built-in 24-bit integer, not portable. see http://gcc.gnu.org/wiki/avr-gcc more info it.
there no standard 24-bit or 48-bit integer types provided gcc or mingw in platform independent way, 1 simple way portable 24-bit number on platform use bitfield:
struct bitfield24 { uint32_t value : 24; }; bitfield24 a; a.value = 0xffffff; a.value += 1; assert(a == 0);
the same can done 48-bits, using uint64_t base.
Comments
Post a Comment