<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">On 31-Dec-15 09:00, Erik de Castro Lopo
wrote:<br>
</div>
<blockquote
cite="mid:20151231190003.1217a26d62d617420062760e@mega-nerd.com"
type="cite">
<pre wrap="">Brian Willoughby wrote:
</pre>
<blockquote type="cite">
<pre wrap="">What's wrong with something incredible simple, like:
#define FLAC__BYTES_PER_WORD (sizeof(int))
</pre>
</blockquote>
<pre wrap="">
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
</pre>
</blockquote>
<br>
<font size="-1">On Windows x64 sizeof(long) is 4, butÂ
sizeof(ptrdiff_t) is 8.<br>
<br>
Any reasons for not using sizeof(ptrdiff_t)?<br>
<br>
Cheers,<br>
Cristian.<br>
</font>
</body>
</html>