Skip to content

Commit 743def4

Browse files
nmoinvazDead2
authored andcommitted
Rename #defines for consistency (madler#378)
1 parent ebb6f34 commit 743def4

File tree

8 files changed

+28
-28
lines changed

8 files changed

+28
-28
lines changed

CMakeLists.txt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ check_c_source_compiles(
326326
}"
327327
HAVE_ATTRIBUTE_VISIBILITY_HIDDEN FAIL_REGEX "not supported")
328328
if(HAVE_ATTRIBUTE_VISIBILITY_HIDDEN)
329-
add_definitions(-DHAVE_HIDDEN)
329+
add_definitions(-DHAVE_VISIBILITY_HIDDEN)
330330
endif()
331331

332332
#
@@ -341,7 +341,7 @@ check_c_source_compiles(
341341
}"
342342
HAVE_ATTRIBUTE_VISIBILITY_INTERNAL FAIL_REGEX "not supported")
343343
if(HAVE_ATTRIBUTE_VISIBILITY_INTERNAL)
344-
add_definitions(-DHAVE_INTERNAL)
344+
add_definitions(-DHAVE_VISIBILITY_INTERNAL)
345345
endif()
346346

347347
#
@@ -579,17 +579,17 @@ if(WITH_OPTIM)
579579
add_definitions("-DX86_CPUID")
580580
set(ZLIB_ARCH_SRCS ${ZLIB_ARCH_SRCS} ${ARCHDIR}/x86.c)
581581
if(HAVE_SSE42CRC_INLINE_ASM OR HAVE_SSE42CRC_INTRIN)
582-
add_definitions(-DX86_SSE4_2_CRC_HASH)
582+
add_definitions(-DX86_SSE42_CRC_HASH)
583583
set(ZLIB_ARCH_SRCS ${ZLIB_ARCH_SRCS} ${ARCHDIR}/insert_string_sse.c)
584-
add_feature_info(SSE4_CRC 1 "Support CRC hash generation using the SSE4.2 instruction set, using \"${SSE4FLAG}\"")
584+
add_feature_info(SSE42_CRC 1 "Support CRC hash generation using the SSE4.2 instruction set, using \"${SSE4FLAG}\"")
585585
add_intrinsics_option("${SSE4FLAG}")
586586
if(HAVE_SSE42CRC_INTRIN)
587-
add_definitions(-DX86_SSE4_2_CRC_INTRIN)
587+
add_definitions(-DX86_SSE42_CRC_INTRIN)
588588
endif()
589589
if(WITH_NEW_STRATEGIES)
590590
add_definitions(-DX86_QUICK_STRATEGY)
591591
set(ZLIB_ARCH_SRCS ${ZLIB_ARCH_SRCS} ${ARCHDIR}/deflate_quick.c)
592-
add_feature_info(SSE4DEFLATE 1 "Support SSE4.2-accelerated quick compression")
592+
add_feature_info(SSE42_DEFLATE_QUICK 1 "Support SSE4.2-accelerated quick compression")
593593
endif()
594594
endif()
595595
if(HAVE_SSE2_INTRIN)

arch/x86/insert_string_sse.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
* input characters and the first MIN_MATCH bytes of str are valid
1717
* (except for the last MIN_MATCH-1 bytes of the input file).
1818
*/
19-
#ifdef X86_SSE4_2_CRC_HASH
19+
#ifdef X86_SSE42_CRC_HASH
2020
ZLIB_INTERNAL Pos insert_string_sse(deflate_state *const s, const Pos str, unsigned int count) {
2121
Pos ret = 0;
2222
unsigned int idx;
@@ -30,7 +30,7 @@ ZLIB_INTERNAL Pos insert_string_sse(deflate_state *const s, const Pos str, unsig
3030
if (s->level >= TRIGGER_LEVEL)
3131
val &= 0xFFFFFF;
3232

33-
#if defined(X86_SSE4_2_CRC_INTRIN)
33+
#if defined(X86_SSE42_CRC_INTRIN)
3434
# ifdef _MSC_VER
3535
h = _mm_crc32_u32(h, val);
3636
# else

configure

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -822,8 +822,8 @@ int ZLIB_INTERNAL foo;
822822
int main() { return 0; }
823823
EOF
824824
if tryboth $CC -c $CFLAGS $test.c; then
825-
CFLAGS="$CFLAGS -DHAVE_HIDDEN"
826-
SFLAGS="$SFLAGS -DHAVE_HIDDEN"
825+
CFLAGS="$CFLAGS -DHAVE_VISIBILITY_HIDDEN"
826+
SFLAGS="$SFLAGS -DHAVE_VISIBILITY_HIDDEN"
827827
echo >> configure.log
828828
echo "Checking for attribute(visibility(hidden)) support... Yes." | tee -a configure.log
829829
else
@@ -841,8 +841,8 @@ int ZLIB_INTERNAL foo;
841841
int main() { return 0; }
842842
EOF
843843
if tryboth $CC -c $CFLAGS $test.c; then
844-
CFLAGS="$CFLAGS -DHAVE_INTERNAL"
845-
SFLAGS="$SFLAGS -DHAVE_INTERNAL"
844+
CFLAGS="$CFLAGS -DHAVE_VISIBILITY_INTERNAL"
845+
SFLAGS="$SFLAGS -DHAVE_VISIBILITY_INTERNAL"
846846
echo >> configure.log
847847
echo "Checking for attribute(visibility(internal)) support... Yes." | tee -a configure.log
848848
else
@@ -1014,12 +1014,12 @@ case "${ARCH}" in
10141014
fi
10151015

10161016
if test ${HAVE_SSE42CRC_INTRIN} -eq 1; then
1017-
CFLAGS="${CFLAGS} -DX86_SSE4_2_CRC_INTRIN"
1018-
SFLAGS="${SFLAGS} -DX86_SSE4_2_CRC_INTRIN"
1017+
CFLAGS="${CFLAGS} -DX86_SSE42_CRC_INTRIN"
1018+
SFLAGS="${SFLAGS} -DX86_SSE42_CRC_INTRIN"
10191019
fi
10201020

1021-
CFLAGS="${CFLAGS} -DX86_SSE4_2_CRC_HASH"
1022-
SFLAGS="${SFLAGS} -DX86_SSE4_2_CRC_HASH"
1021+
CFLAGS="${CFLAGS} -DX86_SSE42_CRC_HASH"
1022+
SFLAGS="${SFLAGS} -DX86_SSE42_CRC_HASH"
10231023
ARCH_STATIC_OBJS="${ARCH_STATIC_OBJS} insert_string_sse.o"
10241024
ARCH_SHARED_OBJS="${ARCH_SHARED_OBJS} insert_string_sse.lo"
10251025

@@ -1042,15 +1042,15 @@ case "${ARCH}" in
10421042

10431043
# Enable arch-specific optimizations?
10441044
if test $without_optimizations -eq 0; then
1045-
CFLAGS="${CFLAGS} -DX86_CPUID -DX86_SSE2 -DX86_SSE4_2_CRC_HASH"
1046-
SFLAGS="${SFLAGS} -DX86_CPUID -DX86_SSE2 -DX86_SSE4_2_CRC_HASH"
1045+
CFLAGS="${CFLAGS} -DX86_CPUID -DX86_SSE2 -DX86_SSE42_CRC_HASH"
1046+
SFLAGS="${SFLAGS} -DX86_CPUID -DX86_SSE2 -DX86_SSE42_CRC_HASH"
10471047

10481048
ARCH_STATIC_OBJS="${ARCH_STATIC_OBJS} x86.o fill_window_sse.o insert_string_sse.o"
10491049
ARCH_SHARED_OBJS="${ARCH_SHARED_OBJS} x86.lo fill_window_sse.lo insert_string_sse.lo"
10501050

10511051
if test ${HAVE_SSE42CRC_INTRIN} -eq 1; then
1052-
CFLAGS="${CFLAGS} -DX86_SSE4_2_CRC_INTRIN"
1053-
SFLAGS="${SFLAGS} -DX86_SSE4_2_CRC_INTRIN"
1052+
CFLAGS="${CFLAGS} -DX86_SSE42_CRC_INTRIN"
1053+
SFLAGS="${SFLAGS} -DX86_SSE42_CRC_INTRIN"
10541054
fi
10551055

10561056
if test ${HAVE_PCLMULQDQ_INTRIN} -eq 1; then

deflate.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@ int ZEXPORT PREFIX(deflateInit2_)(PREFIX3(stream) *strm, int level, int method,
325325
s->w_size = 1 << s->w_bits;
326326
s->w_mask = s->w_size - 1;
327327

328-
#ifdef X86_SSE4_2_CRC_HASH
328+
#ifdef X86_SSE42_CRC_HASH
329329
if (x86_cpu_has_sse42)
330330
s->hash_bits = (unsigned int)15;
331331
else

functable.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
#include "functable.h"
1212
/* insert_string */
13-
#ifdef X86_SSE4_2_CRC_HASH
13+
#ifdef X86_SSE42_CRC_HASH
1414
extern Pos insert_string_sse(deflate_state *const s, const Pos str, unsigned int count);
1515
#elif defined(ARM_ACLE_CRC_HASH)
1616
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
6161
// Initialize default
6262
functable.insert_string=&insert_string_c;
6363

64-
#ifdef X86_SSE4_2_CRC_HASH
64+
#ifdef X86_SSE42_CRC_HASH
6565
if (x86_cpu_has_sse42)
6666
functable.insert_string=&insert_string_sse;
6767
#elif defined(__ARM_FEATURE_CRC32) && defined(ARM_ACLE_CRC_HASH)

gzguts.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@
1414
# endif
1515
#endif
1616

17-
#if defined(HAVE_INTERNAL)
17+
#if defined(HAVE_VISIBILITY_INTERNAL)
1818
# define ZLIB_INTERNAL __attribute__((visibility ("internal")))
19-
#elif defined(HAVE_HIDDEN)
19+
#elif defined(HAVE_VISIBILITY_HIDDEN)
2020
# define ZLIB_INTERNAL __attribute__((visibility ("hidden")))
2121
#else
2222
# define ZLIB_INTERNAL

win32/Makefile.msc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ AR = lib
2323
RC = rc
2424
CP = copy /y
2525
CFLAGS = -nologo -MD -W3 -O2 -Oy- -Zi -Fd"zlib" $(LOC)
26-
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
26+
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
2727
LDFLAGS = -nologo -debug -incremental:no -opt:ref -manifest
2828
ARFLAGS = -nologo
2929
RCFLAGS = /dWIN32 /r

zutil.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212

1313
/* @(#) $Id$ */
1414

15-
#if defined(HAVE_INTERNAL)
15+
#if defined(HAVE_VISIBILITY_INTERNAL)
1616
# define ZLIB_INTERNAL __attribute__((visibility ("internal")))
17-
#elif defined(HAVE_HIDDEN)
17+
#elif defined(HAVE_VISIBILITY_HIDDEN)
1818
# define ZLIB_INTERNAL __attribute__((visibility ("hidden")))
1919
#else
2020
# define ZLIB_INTERNAL

0 commit comments

Comments
 (0)