summaryrefslogtreecommitdiffstats
path: root/floattypes.h
diff options
context:
space:
mode:
authorErik Schnetter <schnetter@gmail.com>2013-09-09 16:36:47 -0400
committerErik Schnetter <schnetter@gmail.com>2013-09-09 16:36:47 -0400
commitcd23f9f22ce463e78d2a52b37798fbfd75ac9631 (patch)
treedd35e90c0f40098addfd86cabfe1a8fc28a5b3eb /floattypes.h
parent3ceeb3729cf510ba5c27a1d90d0ff31d0e90c158 (diff)
downloadvecmathlib-cd23f9f22ce463e78d2a52b37798fbfd75ac9631.zip
vecmathlib-cd23f9f22ce463e78d2a52b37798fbfd75ac9631.tar.gz
Prefer "long" over "long long" if both types are the same
Diffstat (limited to 'floattypes.h')
-rw-r--r--floattypes.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/floattypes.h b/floattypes.h
index e1ce044..1964fcf 100644
--- a/floattypes.h
+++ b/floattypes.h
@@ -52,8 +52,16 @@ namespace vml_std {
typedef ::int16_t int16_t;
typedef ::uint32_t uint32_t;
typedef ::int32_t int32_t;
+#if __SIZEOF_LONG__ == 8
+ // Even if both "long" and "long long" have the same size, they are
+ // still different types. In many cases, it is then preferable to
+ // use "long" instead of "long long" in this case.
+ typedef unsigned long uint64_t;
+ typedef long int64_t;
+#else
typedef ::uint64_t uint64_t;
typedef ::int64_t int64_t;
+#endif
OpenPOWER on IntegriCloud