Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Detect word size for Windows properly #123

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions lib/env.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down