Skip to content

Commit

Permalink
Work around the unpredictible mangling of int64_t and uint64_t
Browse files Browse the repository at this point in the history
  • Loading branch information
yebblies committed May 23, 2014
1 parent 3cd89e0 commit 26193d3
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions src/mars.h
Expand Up @@ -270,13 +270,22 @@ extern Global global;

#include "complex_t.h"

// Because int64_t and friends may be any integral type of the
// correct size, we have to explicitly ask for the correct
// integer type to get the correct mangling with ddmd
#if __LP64__
// Be careful not to care about sign when using dinteger_t
typedef uint64_t dinteger_t; // use this instead of integer_t to
// avoid conflicts with system #include's

// use this instead of integer_t to
// avoid conflicts with system #include's
typedef unsigned long dinteger_t;
// Signed and unsigned variants
typedef int64_t sinteger_t;
typedef uint64_t uinteger_t;
typedef long sinteger_t;
typedef unsigned long uinteger_t;
#else
typedef unsigned long long dinteger_t;
typedef long long sinteger_t;
typedef unsigned long long uinteger_t;
#endif

typedef int8_t d_int8;
typedef uint8_t d_uns8;
Expand Down

0 comments on commit 26193d3

Please sign in to comment.