[flac-dev] How to check for 64-bit CPU?

Rafaël Carré funman at videolan.org
Tue Dec 29 04:33:21 PST 2015


On 12/28/2015 08:35 PM, lvqcl wrote:
> In stream_encoder.c there's the following code:
> 
>   #if defined FLAC__CPU_X86_64 /* and other 64-bit arch, too */
>       if(mean <= 0x80000000/512) { /* 512: more or less optimal for both 16- and 24-bit input */
>   #else
>       if(mean <= 0x80000000/8) { /* 32-bit arch: use 32-bit math if possible */
>   #endif
> 
> A) How to properly check for 64-bit architectures?
> I can check for "defined FLAC__CPU_X86_64" or "defined _WIN64".
> Is it possible to use SIZEOF_VOIDP? such as "#if SIZEOF_VOIDP == 8" ?

That would need a special case for Linux x32 which is x86_64 with 32
bits pointers


More information about the flac-dev mailing list