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

Fix 64 bit integer types on 32 bit archs #186

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
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
9 changes: 6 additions & 3 deletions include/zfp/internal/zfp/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ typedef unsigned long ulong;
typedef int64_t int64;
typedef uint64_t uint64;
#else
#include <limits.h>
/* C89: assume common integer types */
typedef signed char int8;
typedef unsigned char uint8;
Expand All @@ -69,9 +70,11 @@ typedef unsigned long ulong;
#if defined(_WIN32) || defined(_WIN64)
/* assume ILP32 or LLP64 (MSVC, MinGW) */
#define ZFP_LLP64 1
#else
#elif ULONG_MAX > UINT_MAX
/* assume LP64 (Linux, macOS, ...) */
#define ZFP_LP64 1
#else
#define ZFP_LP32 1
#endif

/* concatenation for literal suffixes */
Expand All @@ -89,7 +92,7 @@ typedef unsigned long ulong;
#define INT64PRId "ld"
#define INT64PRIi "li"
typedef signed long int64;
#elif ZFP_LLP64
#elif ZFP_LLP64 || ZFP_LP32
#define INT64C(x) x ## ll
#define INT64PRId "lld"
#define INT64PRIi "lli"
Expand All @@ -115,7 +118,7 @@ typedef unsigned long ulong;
#define UINT64PRIu "lu"
#define UINT64PRIx "lx"
typedef unsigned long uint64;
#elif ZFP_LLP64
#elif ZFP_LLP64 || ZFP_LP32
#define UINT64C(x) x ## ull
#define UINT64PRIo "llo"
#define UINT64PRIu "llu"
Expand Down