From bd730dbcaa011fabcf4f297a36f997139b89f798 Mon Sep 17 00:00:00 2001 From: Patric Mueller Date: Mon, 28 Jan 2019 15:00:04 +0100 Subject: [PATCH] workaround for C89 not supporting inline --- src/isaac64.c | 12 ++++++++++++ sys/unix/hints/macosx10.10 | 2 +- sys/unix/hints/macosx10.14 | 2 +- sys/unix/hints/macosx10.5 | 2 +- sys/unix/hints/macosx10.7 | 2 +- sys/unix/hints/macosx10.8 | 2 +- 6 files changed, 17 insertions(+), 5 deletions(-) diff --git a/src/isaac64.c b/src/isaac64.c index 6a0037228..6928ff72b 100644 --- a/src/isaac64.c +++ b/src/isaac64.c @@ -7,14 +7,26 @@ #define ISAAC64_MASK ((uint64_t)0xFFFFFFFFFFFFFFFFULL) +#if (defined(__STDC__) && __STDC_VERSION__ >= 199901L) +#define HAS_INLINE +#endif + /* Extract ISAAC64_SZ_LOG bits (starting at bit 3). */ +#ifdef HAS_INLINE static inline uint32_t lower_bits(uint64_t x) +#else +static uint32_t lower_bits(uint64_t x) +#endif { return (x & ((ISAAC64_SZ-1) << 3)) >>3; } /* Extract next ISAAC64_SZ_LOG bits (starting at bit ISAAC64_SZ_LOG+2). */ +#ifdef HAS_INLINE static inline uint32_t upper_bits(uint64_t y) +#else +static uint32_t upper_bits(uint64_t y) +#endif { return (y >> (ISAAC64_SZ_LOG+3)) & (ISAAC64_SZ-1); } diff --git a/sys/unix/hints/macosx10.10 b/sys/unix/hints/macosx10.10 index 85d4b63fa..e53a80d77 100644 --- a/sys/unix/hints/macosx10.10 +++ b/sys/unix/hints/macosx10.10 @@ -69,7 +69,7 @@ CC=gcc # #CFLAGS+=-W -Wimplicit -Wreturn-type -Wunused -Wformat -Wswitch -Wshadow -Wcast-qual -Wwrite-strings -DGCC_WARN -CFLAGS+=-Wall -Wextra -Wno-missing-field-initializers -Wimplicit -Wreturn-type -Wunused -Wformat -Wswitch -Wshadow -Wwrite-strings -DGCC_WARN -ansi -pedantic +CFLAGS+=-Wall -Wextra -Wno-missing-field-initializers -Wimplicit -Wreturn-type -Wunused -Wformat -Wswitch -Wshadow -Wwrite-strings -DGCC_WARN -ansi -pedantic -Wno-long-long # As of LLVM build 2336.1.00, this gives dozens of spurious messages, so # leave it out by default. #CFLAGS+=-Wunreachable-code diff --git a/sys/unix/hints/macosx10.14 b/sys/unix/hints/macosx10.14 index 2255ddb9e..c5e5a0cf1 100644 --- a/sys/unix/hints/macosx10.14 +++ b/sys/unix/hints/macosx10.14 @@ -69,7 +69,7 @@ CC=gcc # #CFLAGS+=-W -Wimplicit -Wreturn-type -Wunused -Wformat -Wswitch -Wshadow -Wcast-qual -Wwrite-strings -DGCC_WARN -CFLAGS+=-Wall -Wextra -Wno-missing-field-initializers -Wimplicit -Wreturn-type -Wunused -Wformat -Wswitch -Wshadow -Wwrite-strings -DGCC_WARN -ansi -pedantic +CFLAGS+=-Wall -Wextra -Wno-missing-field-initializers -Wimplicit -Wreturn-type -Wunused -Wformat -Wswitch -Wshadow -Wwrite-strings -DGCC_WARN -ansi -pedantic -Wno-long-long # As of LLVM build 2336.1.00, this gives dozens of spurious messages, so # leave it out by default. #CFLAGS+=-Wunreachable-code diff --git a/sys/unix/hints/macosx10.5 b/sys/unix/hints/macosx10.5 index 668b6b2b5..f6d9e5483 100644 --- a/sys/unix/hints/macosx10.5 +++ b/sys/unix/hints/macosx10.5 @@ -53,7 +53,7 @@ GAMEGRP = games #WANT_SOURCE_INSTALL=1 #CC=gcc -W -Wimplicit -Wreturn-type -Wunused -Wformat -Wswitch -Wshadow -Wcast-qual -Wwrite-strings -DGCC_WARN -CC=gcc -Wall -Wextra -Wno-missing-field-initializers -Wimplicit -Wreturn-type -Wunused -Wformat -Wswitch -Wshadow -Wwrite-strings -DGCC_WARN -ansi -pedantic +CC=gcc -Wall -Wextra -Wno-missing-field-initializers -Wimplicit -Wreturn-type -Wunused -Wformat -Wswitch -Wshadow -Wwrite-strings -DGCC_WARN -ansi -pedantic -Wno-long-long # # You shouldn't need to change anything below here. diff --git a/sys/unix/hints/macosx10.7 b/sys/unix/hints/macosx10.7 index cc9216884..776cb4b81 100644 --- a/sys/unix/hints/macosx10.7 +++ b/sys/unix/hints/macosx10.7 @@ -63,7 +63,7 @@ CC=gcc # #CFLAGS+=-W -Wimplicit -Wreturn-type -Wunused -Wformat -Wswitch -Wshadow -Wcast-qual -Wwrite-strings -DGCC_WARN -CFLAGS+=-Wall -Wextra -Wno-missing-field-initializers -Wimplicit -Wreturn-type -Wunused -Wformat -Wswitch -Wshadow -Wwrite-strings -DGCC_WARN -ansi -pedantic +CFLAGS+=-Wall -Wextra -Wno-missing-field-initializers -Wimplicit -Wreturn-type -Wunused -Wformat -Wswitch -Wshadow -Wwrite-strings -DGCC_WARN -ansi -pedantic -Wno-long-long # As of LLVM build 2336.1.00, this gives dozens of spurious messages, so # leave it out by default. #CFLAGS+=-Wunreachable-code diff --git a/sys/unix/hints/macosx10.8 b/sys/unix/hints/macosx10.8 index 6a1f69d4b..87d0e8305 100644 --- a/sys/unix/hints/macosx10.8 +++ b/sys/unix/hints/macosx10.8 @@ -70,7 +70,7 @@ CC=gcc # #CFLAGS+=-W -Wimplicit -Wreturn-type -Wunused -Wformat -Wswitch -Wshadow -Wcast-qual -Wwrite-strings -DGCC_WARN -CFLAGS+=-Wall -Wextra -Wno-missing-field-initializers -Wimplicit -Wreturn-type -Wunused -Wformat -Wswitch -Wshadow -Wwrite-strings -DGCC_WARN -ansi -pedantic +CFLAGS+=-Wall -Wextra -Wno-missing-field-initializers -Wimplicit -Wreturn-type -Wunused -Wformat -Wswitch -Wshadow -Wwrite-strings -DGCC_WARN -ansi -pedantic -Wno-long-long # As of LLVM build 2336.1.00, this gives dozens of spurious messages, so # leave it out by default. #CFLAGS+=-Wunreachable-code -- 2.49.0