Re: [PATCH] Use faster byte swapping when compiling with MSVC
- From
Erik Faye-Lund <kusmabite@googlemail.com>
- Date
- Oct 20, 2009, 12:44 UTC
- Message-ID
- <40aa078e0910200544i3d8aadc1ud62cf62a6964dd5@mail.gmail.com>
- In-Reply-To
- <loom.20091020T141138-782@post.gmane.org>
On Tue, Oct 20, 2009 at 2:20 PM, Ludvig Strigeus <ludde@spotify.com> wrote:
> unsigned long (as used by _byteswap_ulong) is 64 bits on x64, right? Then it > doesn't make sense to use _byteswap_ulong to swap 32-bit quantities (assuming > that's what bswap32 does) would it?
No, unsigned long is 32bit on x64 on Windows.
--->8--- #include <stdio.h> #include <stdlib.h>
int main(int argc, char *argv[])
{
printf("sizeof(void *) = %d\n", sizeof(void *));
printf("sizeof(unsigned long) = %d\n", sizeof(unsigned long));
return 0;
}
--->8---
sizeof(void *) = 8
sizeof(unsigned long) = 4-- Erik "kusma" Faye-Lund