diff options
author | Erik Schnetter <schnetter@gmail.com> | 2015-10-16 13:27:28 -0400 |
---|---|---|
committer | Erik Schnetter <schnetter@gmail.com> | 2015-10-16 13:27:28 -0400 |
commit | f934a0ea093ef7ed408b82fb0c1e1c905846de2c (patch) | |
tree | 7b1a95e7bef7ee9b801975ed81178ebbf35adbd6 | |
parent | 53272659d101388171169433cb23c57c9f8c2bcd (diff) | |
download | vecmathlib-f934a0ea093ef7ed408b82fb0c1e1c905846de2c.zip vecmathlib-f934a0ea093ef7ed408b82fb0c1e1c905846de2c.tar.gz |
Improve fallback static_assert implementation
-rw-r--r-- | floattypes.h | 6 |
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 |