diff --git a/lib/env.h b/lib/env.h index d5c2fdb7..bb0acf8e 100644 --- a/lib/env.h +++ b/lib/env.h @@ -46,12 +46,18 @@ #if defined (__x86_64__) // This also works for the x32 ABI, which has a 64-bit word size. # define BASE64_WORDSIZE 64 -#elif defined (_INTEGRAL_MAX_BITS) -# define BASE64_WORDSIZE _INTEGRAL_MAX_BITS #elif defined (__WORDSIZE) # define BASE64_WORDSIZE __WORDSIZE #elif defined (__SIZE_WIDTH__) # define BASE64_WORDSIZE __SIZE_WIDTH__ +#elif defined (_WIN32) +// _WIN32 is defined for all Windows targets but _WIN64 is only defined for +// 64-bit targets. +# if defined (_WIN64) +# define BASE64_WORDSIZE 64 +# else +# define BASE64_WORDSIZE 32 +# endif #else # error BASE64_WORDSIZE_NOT_DEFINED #endif