From ea5c6307c674d345295de3e1301ea16586880484 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Fri, 29 Apr 2016 18:55:33 +0200 Subject: Change UNSAFE to ZAHL_UNSAFE, so it can be used in zahl-inlines.h MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- bench/libhebimath.h | 2 +- bench/libtfm.h | 2 +- bench/libtommath.h | 2 +- config.mk | 2 +- src/internals.h | 2 +- src/zrand.c | 2 +- test.c | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/bench/libhebimath.h b/bench/libhebimath.h index 8f8f3ce..495abd1 100644 --- a/bench/libhebimath.h +++ b/bench/libhebimath.h @@ -29,7 +29,7 @@ static jmp_buf jbuf; #define UNIFORM 1 #define MODUNIFORM 2 -#ifdef UNSAFE +#ifdef ZAHL_UNSAFE # define try(expr) (expr) #else # define try(expr) do if ((error = (expr))) longjmp(jbuf, 1); while (0) diff --git a/bench/libtfm.h b/bench/libtfm.h index 1610802..b87a288 100644 --- a/bench/libtfm.h +++ b/bench/libtfm.h @@ -24,7 +24,7 @@ static z_t _0, _1, _a, _b; static int _tmp, error; static jmp_buf jbuf; -#ifdef UNSAFE +#ifdef ZAHL_UNSAFE # define try(expr) (expr) #else # define try(expr) do if ((error = (expr))) longjmp(jbuf, 1); while (0) diff --git a/bench/libtommath.h b/bench/libtommath.h index 3529118..f502618 100644 --- a/bench/libtommath.h +++ b/bench/libtommath.h @@ -24,7 +24,7 @@ static z_t _0, _1, _a, _b; static int _tmp, error; static jmp_buf jbuf; -#ifdef UNSAFE +#ifdef ZAHL_UNSAFE # define try(expr) (expr) #else # define try(expr) do if ((error = (expr))) longjmp(jbuf, 1); while (0) diff --git a/config.mk b/config.mk index 5c87cbd..c670ea4 100644 --- a/config.mk +++ b/config.mk @@ -15,7 +15,7 @@ RANLIB = ranlib # you have to add -DSECURE_RANDOM_PATHNAME=... to CPPFLAGS. # Remove -DGOOD_RAND if the higher bits have higher entropy in the lower # bits in rand(3), this was historically the case. -# Add -DUNSAFE if you rather libzahl did not check for errors. +# Add -DZAHL_UNSAFE if you rather libzahl did not check for errors. CPPFLAGS = -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_XOPEN_SOURCE=700 -DGOOD_RAND CFLAGS = -std=c99 -flto -O3 -Wall -pedantic diff --git a/src/internals.h b/src/internals.h index 3213441..6faa254 100644 --- a/src/internals.h +++ b/src/internals.h @@ -97,7 +97,7 @@ extern void *libzahl_temp_allocation; #define likely(expr) ZAHL_LIKELY(expr) #define unlikely(expr) ZAHL_UNLIKELY(expr) -#if defined(UNSAFE) +#if defined(ZAHL_UNSAFE) # define check(expr) 0 #else # define check(expr) unlikely(expr) diff --git a/src/zrand.c b/src/zrand.c index 020b58c..e236a94 100644 --- a/src/zrand.c +++ b/src/zrand.c @@ -209,7 +209,7 @@ zrand(z_t r, enum zranddev dev, enum zranddist dist, z_t n) break; default: -#if !defined(UNSAFE) +#if !defined(ZAHL_UNSAFE) libzahl_failure(EINVAL); #endif break; diff --git a/test.c b/test.c index ffd9066..1b18b42 100644 --- a/test.c +++ b/test.c @@ -787,7 +787,7 @@ main(void) assert((zseti(a, 11), zptest(0, a, 100)), != NONPRIME); assert((zseti(a, 101), zptest(0, a, 100)), != NONPRIME); -#if defined(UNSAFE) +#if defined(ZAHL_UNSAFE) (void) env2; #else assert_nr(zdivmod(a, b, _0, _0)); -- cgit v1.2.3-70-g09d2