[zeromq-dev] portable uint32_t ?
andrew at research.att.com
Thu Aug 5 14:50:06 CEST 2010
in my code, i define these sorts of things in a basic.h
and also write a basic_check.c
which verifies if (using code like if(sizeof(uint32) != 4) barf();).
and this is run as part of installation.
it is only a short step to putting that into a configure like program.
you can also try being clever with MAX_INT (or whatever it is called)
#if MAXINT > 0x7FFFFFFFLL
#define short uint32
#if MAX_INT > 0x7FFF
#define int uint32
#define long uint32
but i woudl check as well.
On Aug 5, 2010, at 8:21 AM, Matt Weinstein wrote:
> A quick question -- I really want a uint32_t to hold my 0xdeadbeef, is
> there a portable/preferred way to get a 32 bit unsigned value? (( I
> don't like making assumptions about C99 compliance ))
> PS We never had this "word length" problem on the IBM 1620 :-)
> zeromq-dev mailing list
> zeromq-dev at lists.zeromq.org
Andrew Hume (best -> Telework) +1 732-886-1886
andrew at research.att.com (Work) +1 973-360-8651
AT&T Labs - Research; member of USENIX and LOPSA
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the zeromq-dev