]> git.ipfire.org Git - thirdparty/zlib-ng.git/commitdiff
Rename #defines for consistency (#378)
authorNathan Moinvaziri <nathan@nathanm.com>
Fri, 23 Aug 2019 20:16:28 +0000 (13:16 -0700)
committerHans Kristian Rosbach <hk-github@circlestorm.org>
Fri, 23 Aug 2019 20:16:27 +0000 (22:16 +0200)
CMakeLists.txt
arch/x86/insert_string_sse.c
configure
deflate.c
functable.c
gzguts.h
win32/Makefile.msc
zutil.h

index 187bfc67ae41560f50f32dfce7b950348b58a4f6..2122d6d48d727e52c1a21a425acebb92cd06a9e1 100644 (file)
@@ -326,7 +326,7 @@ check_c_source_compiles(
     }"
     HAVE_ATTRIBUTE_VISIBILITY_HIDDEN FAIL_REGEX "not supported")
 if(HAVE_ATTRIBUTE_VISIBILITY_HIDDEN)
-    add_definitions(-DHAVE_HIDDEN)
+    add_definitions(-DHAVE_VISIBILITY_HIDDEN)
 endif()
 
 #
@@ -341,7 +341,7 @@ check_c_source_compiles(
     }"
     HAVE_ATTRIBUTE_VISIBILITY_INTERNAL FAIL_REGEX "not supported")
 if(HAVE_ATTRIBUTE_VISIBILITY_INTERNAL)
-    add_definitions(-DHAVE_INTERNAL)
+    add_definitions(-DHAVE_VISIBILITY_INTERNAL)
 endif()
 
 #
@@ -579,17 +579,17 @@ if(WITH_OPTIM)
         add_definitions("-DX86_CPUID")
         set(ZLIB_ARCH_SRCS ${ZLIB_ARCH_SRCS} ${ARCHDIR}/x86.c)
         if(HAVE_SSE42CRC_INLINE_ASM OR HAVE_SSE42CRC_INTRIN)
-            add_definitions(-DX86_SSE4_2_CRC_HASH)
+            add_definitions(-DX86_SSE42_CRC_HASH)
             set(ZLIB_ARCH_SRCS ${ZLIB_ARCH_SRCS} ${ARCHDIR}/insert_string_sse.c)
-            add_feature_info(SSE4_CRC 1 "Support CRC hash generation using the SSE4.2 instruction set, using \"${SSE4FLAG}\"")
+            add_feature_info(SSE42_CRC 1 "Support CRC hash generation using the SSE4.2 instruction set, using \"${SSE4FLAG}\"")
             add_intrinsics_option("${SSE4FLAG}")
             if(HAVE_SSE42CRC_INTRIN)
-                add_definitions(-DX86_SSE4_2_CRC_INTRIN)
+                add_definitions(-DX86_SSE42_CRC_INTRIN)
             endif()
             if(WITH_NEW_STRATEGIES)
                 add_definitions(-DX86_QUICK_STRATEGY)
                 set(ZLIB_ARCH_SRCS ${ZLIB_ARCH_SRCS} ${ARCHDIR}/deflate_quick.c)
-                add_feature_info(SSE4DEFLATE 1 "Support SSE4.2-accelerated quick compression")
+                add_feature_info(SSE42_DEFLATE_QUICK 1 "Support SSE4.2-accelerated quick compression")
             endif()
         endif()
         if(HAVE_SSE2_INTRIN)
index b084a9493c001d29dfa648f193fc8cd07e27ab46..0c1e0b236392a45d7ac558c535719f4e6843e8e2 100644 (file)
@@ -16,7 +16,7 @@
  *    input characters and the first MIN_MATCH bytes of str are valid
  *    (except for the last MIN_MATCH-1 bytes of the input file).
  */
-#ifdef X86_SSE4_2_CRC_HASH
+#ifdef X86_SSE42_CRC_HASH
 ZLIB_INTERNAL Pos insert_string_sse(deflate_state *const s, const Pos str, unsigned int count) {
     Pos ret = 0;
     unsigned int idx;
@@ -30,7 +30,7 @@ ZLIB_INTERNAL Pos insert_string_sse(deflate_state *const s, const Pos str, unsig
         if (s->level >= TRIGGER_LEVEL)
             val &= 0xFFFFFF;
 
-#if defined(X86_SSE4_2_CRC_INTRIN)
+#if defined(X86_SSE42_CRC_INTRIN)
 #  ifdef _MSC_VER
         h = _mm_crc32_u32(h, val);
 #  else
index 5a95d59c0cb5a9b651dda07f76eea0c4d98b6db9..a6c7aa07924e599db1050e701727610b87301304 100755 (executable)
--- a/configure
+++ b/configure
@@ -822,8 +822,8 @@ int ZLIB_INTERNAL foo;
 int main() { return 0; }
 EOF
   if tryboth $CC -c $CFLAGS $test.c; then
-    CFLAGS="$CFLAGS -DHAVE_HIDDEN"
-    SFLAGS="$SFLAGS -DHAVE_HIDDEN"
+    CFLAGS="$CFLAGS -DHAVE_VISIBILITY_HIDDEN"
+    SFLAGS="$SFLAGS -DHAVE_VISIBILITY_HIDDEN"
     echo >> configure.log
     echo "Checking for attribute(visibility(hidden)) support... Yes." | tee -a configure.log
   else
@@ -841,8 +841,8 @@ int ZLIB_INTERNAL foo;
 int main() { return 0; }
 EOF
   if tryboth $CC -c $CFLAGS $test.c; then
-    CFLAGS="$CFLAGS -DHAVE_INTERNAL"
-    SFLAGS="$SFLAGS -DHAVE_INTERNAL"
+    CFLAGS="$CFLAGS -DHAVE_VISIBILITY_INTERNAL"
+    SFLAGS="$SFLAGS -DHAVE_VISIBILITY_INTERNAL"
     echo >> configure.log
     echo "Checking for attribute(visibility(internal)) support... Yes." | tee -a configure.log
   else
@@ -1014,12 +1014,12 @@ case "${ARCH}" in
             fi
 
             if test ${HAVE_SSE42CRC_INTRIN} -eq 1; then
-                CFLAGS="${CFLAGS} -DX86_SSE4_2_CRC_INTRIN"
-                SFLAGS="${SFLAGS} -DX86_SSE4_2_CRC_INTRIN"
+                CFLAGS="${CFLAGS} -DX86_SSE42_CRC_INTRIN"
+                SFLAGS="${SFLAGS} -DX86_SSE42_CRC_INTRIN"
             fi
 
-            CFLAGS="${CFLAGS} -DX86_SSE4_2_CRC_HASH"
-            SFLAGS="${SFLAGS} -DX86_SSE4_2_CRC_HASH"
+            CFLAGS="${CFLAGS} -DX86_SSE42_CRC_HASH"
+            SFLAGS="${SFLAGS} -DX86_SSE42_CRC_HASH"
             ARCH_STATIC_OBJS="${ARCH_STATIC_OBJS} insert_string_sse.o"
             ARCH_SHARED_OBJS="${ARCH_SHARED_OBJS} insert_string_sse.lo"
 
@@ -1042,15 +1042,15 @@ case "${ARCH}" in
 
         # Enable arch-specific optimizations?
         if test $without_optimizations -eq 0; then
-            CFLAGS="${CFLAGS} -DX86_CPUID -DX86_SSE2 -DX86_SSE4_2_CRC_HASH"
-            SFLAGS="${SFLAGS} -DX86_CPUID -DX86_SSE2 -DX86_SSE4_2_CRC_HASH"
+            CFLAGS="${CFLAGS} -DX86_CPUID -DX86_SSE2 -DX86_SSE42_CRC_HASH"
+            SFLAGS="${SFLAGS} -DX86_CPUID -DX86_SSE2 -DX86_SSE42_CRC_HASH"
 
             ARCH_STATIC_OBJS="${ARCH_STATIC_OBJS} x86.o fill_window_sse.o insert_string_sse.o"
             ARCH_SHARED_OBJS="${ARCH_SHARED_OBJS} x86.lo fill_window_sse.lo insert_string_sse.lo"
 
             if test ${HAVE_SSE42CRC_INTRIN} -eq 1; then
-                CFLAGS="${CFLAGS} -DX86_SSE4_2_CRC_INTRIN"
-                SFLAGS="${SFLAGS} -DX86_SSE4_2_CRC_INTRIN"
+                CFLAGS="${CFLAGS} -DX86_SSE42_CRC_INTRIN"
+                SFLAGS="${SFLAGS} -DX86_SSE42_CRC_INTRIN"
             fi
 
             if test ${HAVE_PCLMULQDQ_INTRIN} -eq 1; then
index 908cb01e10efbf44e469f5e75266dcf6ae4c4549..d13dfe2a277b76de6ce86e153d7c47e46c269cab 100644 (file)
--- a/deflate.c
+++ b/deflate.c
@@ -325,7 +325,7 @@ int ZEXPORT PREFIX(deflateInit2_)(PREFIX3(stream) *strm, int level, int method,
     s->w_size = 1 << s->w_bits;
     s->w_mask = s->w_size - 1;
 
-#ifdef X86_SSE4_2_CRC_HASH
+#ifdef X86_SSE42_CRC_HASH
     if (x86_cpu_has_sse42)
         s->hash_bits = (unsigned int)15;
     else
index 37a099581bf98a2de1749356f945a714b310d141..587abfecb10e418192fec1023c296c0c2078b93b 100644 (file)
@@ -10,7 +10,7 @@
 
 #include "functable.h"
 /* insert_string */
-#ifdef X86_SSE4_2_CRC_HASH
+#ifdef X86_SSE42_CRC_HASH
 extern Pos insert_string_sse(deflate_state *const s, const Pos str, unsigned int count);
 #elif defined(ARM_ACLE_CRC_HASH)
 extern Pos insert_string_acle(deflate_state *const s, const Pos str, unsigned int count);
@@ -61,7 +61,7 @@ ZLIB_INTERNAL Pos insert_string_stub(deflate_state *const s, const Pos str, unsi
     // Initialize default
     functable.insert_string=&insert_string_c;
 
-    #ifdef X86_SSE4_2_CRC_HASH
+    #ifdef X86_SSE42_CRC_HASH
     if (x86_cpu_has_sse42)
         functable.insert_string=&insert_string_sse;
     #elif defined(__ARM_FEATURE_CRC32) && defined(ARM_ACLE_CRC_HASH)
index c2ff7bb96a762255f0aa789e4812a0bf0b5ad1f4..7389db8ab64166d8f6949a2074791d99d14a390a 100644 (file)
--- a/gzguts.h
+++ b/gzguts.h
@@ -14,9 +14,9 @@
 #  endif
 #endif
 
-#if defined(HAVE_INTERNAL)
+#if defined(HAVE_VISIBILITY_INTERNAL)
 #  define ZLIB_INTERNAL __attribute__((visibility ("internal")))
-#elif defined(HAVE_HIDDEN)
+#elif defined(HAVE_VISIBILITY_HIDDEN)
 #  define ZLIB_INTERNAL __attribute__((visibility ("hidden")))
 #else
 #  define ZLIB_INTERNAL
index f5bccdd2add4b521722b96704703627789710468..9baf1e439016fd1495141079c2c36f1999ada328 100644 (file)
@@ -23,7 +23,7 @@ AR = lib
 RC = rc
 CP = copy /y
 CFLAGS  = -nologo -MD -W3 -O2 -Oy- -Zi -Fd"zlib" $(LOC)
-WFLAGS  = -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -DX86_PCLMULQDQ_CRC -DX86_SSE2 -DX86_CPUID -DX86_SSE4_2_CRC_HASH -DUNALIGNED_OK -DX86_QUICK_STRATEGY
+WFLAGS  = -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -DX86_PCLMULQDQ_CRC -DX86_SSE2 -DX86_CPUID -DX86_SSE42_CRC_HASH -DUNALIGNED_OK -DX86_QUICK_STRATEGY
 LDFLAGS = -nologo -debug -incremental:no -opt:ref -manifest
 ARFLAGS = -nologo
 RCFLAGS = /dWIN32 /r
diff --git a/zutil.h b/zutil.h
index 5471d0719329bd45345e1ae4a4018ea77d7ee5c3..fe139939269246383ca04ed12873fb166ff1c108 100644 (file)
--- a/zutil.h
+++ b/zutil.h
@@ -12,9 +12,9 @@
 
 /* @(#) $Id$ */
 
-#if defined(HAVE_INTERNAL)
+#if defined(HAVE_VISIBILITY_INTERNAL)
 #  define ZLIB_INTERNAL __attribute__((visibility ("internal")))
-#elif defined(HAVE_HIDDEN)
+#elif defined(HAVE_VISIBILITY_HIDDEN)
 #  define ZLIB_INTERNAL __attribute__((visibility ("hidden")))
 #else
 #  define ZLIB_INTERNAL