diff options
author | Father Chrysostomos <sprout@cpan.org> | 2016-07-28 12:55:48 -0700 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2016-07-28 12:58:19 -0700 |
commit | 555e2b18c04970c0205a348954e3a6f7dc2be19b (patch) | |
tree | 0bf41d73c7261ecd6fdf8c4c90a8c9395e657461 /ext/POSIX | |
parent | 5b3e7d5fab3ee4efee810acd1250c5438259bc76 (diff) | |
download | perl-555e2b18c04970c0205a348954e3a6f7dc2be19b.tar.gz |
POSIX.xs: Make NV_PAYLOAD_SIZEOF_ASSERT static
so that we get the benefit of the assertions for non-debugging builds
but without any run-time penalty.
Diffstat (limited to 'ext/POSIX')
-rw-r--r-- | ext/POSIX/POSIX.xs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/ext/POSIX/POSIX.xs b/ext/POSIX/POSIX.xs index a950af35c7..bb121c3da7 100644 --- a/ext/POSIX/POSIX.xs +++ b/ext/POSIX/POSIX.xs @@ -1154,9 +1154,11 @@ static NV my_trunc(NV x) #endif #if defined(USE_LONG_DOUBLE) && defined(LONGDOUBLE_DOUBLEDOUBLE) -# define NV_PAYLOAD_SIZEOF_ASSERT(a) assert(sizeof(a) == NVSIZE / 2) +# define NV_PAYLOAD_SIZEOF_ASSERT(a) \ + STATIC_ASSERT_STMT(sizeof(a) == NVSIZE / 2) #else -# define NV_PAYLOAD_SIZEOF_ASSERT(a) assert(sizeof(a) == NVSIZE) +# define NV_PAYLOAD_SIZEOF_ASSERT(a) \ + STATIC_ASSERT_STMT(sizeof(a) == NVSIZE) #endif static void S_setpayload(NV* nvp, NV_PAYLOAD_TYPE payload, bool signaling) |