Skip to content

Commit

Permalink
Fix detection of MARISA_WORD_SIZE
Browse files Browse the repository at this point in the history
Detect the MARISA_WORD_SIZE independent of architecture.

Fixes: #40
Fixes: #57
Fixes: #44
Fixes: #46
Fixes: #56
  • Loading branch information
ncopa committed Apr 30, 2024
1 parent 006020c commit 6925413
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions include/marisa/base.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,13 @@ typedef uint32_t marisa_uint32;
typedef uint64_t marisa_uint64;
#endif // _MSC_VER

#if defined(_WIN64) || defined(__amd64__) || defined(__x86_64__) || \
defined(__ia64__) || defined(__ppc64__) || defined(__powerpc64__) || \
defined(__sparc64__) || defined(__mips64__) || defined(__aarch64__) || \
defined(__s390x__)
#if (UINTPTR_MAX == 0xffffffffffffffff)
#define MARISA_WORD_SIZE 64
#else // defined(_WIN64), etc.
#elif (UINTPTR_MAX == 0xffffffff)
#define MARISA_WORD_SIZE 32
#endif // defined(_WIN64), etc.
#else
#error Failed to detect MARISA_WORD_SIZE
#endif

//#define MARISA_WORD_SIZE (sizeof(void *) * 8)

Expand Down

0 comments on commit 6925413

Please sign in to comment.