summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorErik Schnetter <schnetter@gmail.com>2015-10-16 13:27:28 -0400
committerErik Schnetter <schnetter@gmail.com>2015-10-16 13:27:28 -0400
commitf934a0ea093ef7ed408b82fb0c1e1c905846de2c (patch)
tree7b1a95e7bef7ee9b801975ed81178ebbf35adbd6
parent53272659d101388171169433cb23c57c9f8c2bcd (diff)
downloadvecmathlib-f934a0ea093ef7ed408b82fb0c1e1c905846de2c.zip
vecmathlib-f934a0ea093ef7ed408b82fb0c1e1c905846de2c.tar.gz
Improve fallback static_assert implementation
-rw-r--r--floattypes.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/floattypes.h b/floattypes.h
index f3c1af6..5107af6 100644
--- a/floattypes.h
+++ b/floattypes.h
@@ -40,7 +40,11 @@ namespace vml_std {
#include <stdint.h>
#ifndef static_assert
-# define static_assert(cond, msg)
+# define VML_CONCAT2(x, y) x##y
+# define VML_CONCAT(x, y) VML_CONCAT2(x, y)
+# define static_assert(cond, msg) \
+ typedef int VML_CONCAT(vml_static_assert_, __LINE__)[(cond) ? 1 : -1] \
+ __attribute__((__unused__))
#endif
OpenPOWER on IntegriCloud