From 051d55919b6af309df5309dacf276383643f6eaa Mon Sep 17 00:00:00 2001 From: Eric Biggers Date: Thu, 28 Jan 2016 00:17:28 -0600 Subject: [PATCH] Make runtime CPU detection and near-optimal parsing enabled in the code by default --- Makefile | 8 ++++---- src/deflate_compress.c | 2 +- src/x86_cpu_features.h | 4 ++++ 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 27ef3d2..7aee03a 100644 --- a/Makefile +++ b/Makefile @@ -90,16 +90,16 @@ override CFLAGS += -I. # Hide non-standard functions from standard headers (e.g. heapsort() on *BSD). override CFLAGS += -D_ANSI_SOURCE -ifeq ($(SUPPORT_NEAR_OPTIMAL_PARSING),yes) - override CFLAGS += -DSUPPORT_NEAR_OPTIMAL_PARSING=1 +ifneq ($(SUPPORT_NEAR_OPTIMAL_PARSING),yes) + override CFLAGS += -DSUPPORT_NEAR_OPTIMAL_PARSING=0 endif ifeq ($(UNSAFE_DECOMPRESSION),yes) override CFLAGS += -DUNSAFE_DECOMPRESSION=1 endif -ifeq ($(RUNTIME_CPU_DETECTION),yes) - override CFLAGS += -DRUNTIME_CPU_DETECTION=1 +ifneq ($(RUNTIME_CPU_DETECTION),yes) + override CFLAGS += -DRUNTIME_CPU_DETECTION=0 endif SRC := src/aligned_malloc.c diff --git a/src/deflate_compress.c b/src/deflate_compress.c index 0fdcb9b..04ad4d7 100644 --- a/src/deflate_compress.c +++ b/src/deflate_compress.c @@ -27,7 +27,7 @@ * zlib at level 9. However, it is slow. */ #ifndef SUPPORT_NEAR_OPTIMAL_PARSING -# define SUPPORT_NEAR_OPTIMAL_PARSING 0 +# define SUPPORT_NEAR_OPTIMAL_PARSING 1 #endif /* diff --git a/src/x86_cpu_features.h b/src/x86_cpu_features.h index 5f0c7e0..f9b5cbc 100644 --- a/src/x86_cpu_features.h +++ b/src/x86_cpu_features.h @@ -6,6 +6,10 @@ #include "util.h" +#ifndef RUNTIME_CPU_DETECTION +# define RUNTIME_CPU_DETECTION 1 +#endif + #if RUNTIME_CPU_DETECTION && defined(__GNUC__) && defined(__x86_64__) # define X86_CPU_FEATURES_ENABLED 1 #endif