On 31-Dec-15 09:00, Erik de Castro Lopo wrote:
Brian Willoughby wrote:
What's wrong with something incredible simple, like:
#define FLAC__BYTES_PER_WORD (sizeof(int))
The fact that it actually is not correct. We want to determine
the size in bits of the CPU registers.
Here's what I know:
sizeof(int) sizeof (long)
---------------+----------------+-----------------
32 bit Linux | 4 | 4
64 bit Linux | 4 | 8
32 bit windows | 4 | 4
64 bit windows | 4 | 4
Note that sizeof(long) on 64 bit windows is 4!
Most other unixen follow the LP64 scheme used by Linux.
Erik
On Windows x64 sizeof(long) is 4, but sizeof(ptrdiff_t) is 8.
Any reasons for not using sizeof(ptrdiff_t)?
Cheers,
Cristian.
_______________________________________________
flac-dev mailing list
flac-dev@xiph.org
http://lists.xiph.org/mailman/listinfo/flac-dev