Migrate feature detection macro checks from #ifdef to #if.

The #if predicate evaluates to false if the macro is undefined, or
defined to 0. #ifdef (and its synonym #if defined) evaluates to false
only if the macro is undefined.

The new setup allows differentiating between setting a macro to 0 (to
express that the capability definitely does not exist / should not be
used) and leaving a macro undefined (to express not knowing whether a
capability exists / not caring if a capability is used).

PiperOrigin-RevId: 391094241
This commit is contained in:
Victor Costan
2021-08-16 18:22:31 +00:00
committed by Victor Costan
parent a8400f1fab
commit cbb83a1d64
7 changed files with 44 additions and 43 deletions

View File

@@ -2,46 +2,46 @@
#define THIRD_PARTY_SNAPPY_OPENSOURCE_CMAKE_CONFIG_H_
/* Define to 1 if the compiler supports __attribute__((always_inline)). */
#cmakedefine HAVE_ATTRIBUTE_ALWAYS_INLINE 1
#cmakedefine01 HAVE_ATTRIBUTE_ALWAYS_INLINE
/* Define to 1 if the compiler supports __builtin_ctz and friends. */
#cmakedefine HAVE_BUILTIN_CTZ 1
#cmakedefine01 HAVE_BUILTIN_CTZ
/* Define to 1 if the compiler supports __builtin_expect. */
#cmakedefine HAVE_BUILTIN_EXPECT 1
#cmakedefine01 HAVE_BUILTIN_EXPECT
/* Define to 1 if you have a definition for mmap() in <sys/mman.h>. */
#cmakedefine HAVE_FUNC_MMAP 1
#cmakedefine01 HAVE_FUNC_MMAP
/* Define to 1 if you have a definition for sysconf() in <unistd.h>. */
#cmakedefine HAVE_FUNC_SYSCONF 1
#cmakedefine01 HAVE_FUNC_SYSCONF
/* Define to 1 if you have the `lzo2' library (-llzo2). */
#cmakedefine HAVE_LIBLZO2 1
#cmakedefine01 HAVE_LIBLZO2
/* Define to 1 if you have the `z' library (-lz). */
#cmakedefine HAVE_LIBZ 1
#cmakedefine01 HAVE_LIBZ
/* Define to 1 if you have the `lz4' library (-llz4). */
#cmakedefine HAVE_LIBLZ4 1
#cmakedefine01 HAVE_LIBLZ4
/* Define to 1 if you have the <sys/mman.h> header file. */
#cmakedefine HAVE_SYS_MMAN_H 1
#cmakedefine01 HAVE_SYS_MMAN_H
/* Define to 1 if you have the <sys/resource.h> header file. */
#cmakedefine HAVE_SYS_RESOURCE_H 1
#cmakedefine01 HAVE_SYS_RESOURCE_H
/* Define to 1 if you have the <sys/time.h> header file. */
#cmakedefine HAVE_SYS_TIME_H 1
#cmakedefine01 HAVE_SYS_TIME_H
/* Define to 1 if you have the <sys/uio.h> header file. */
#cmakedefine HAVE_SYS_UIO_H 1
#cmakedefine01 HAVE_SYS_UIO_H
/* Define to 1 if you have the <unistd.h> header file. */
#cmakedefine HAVE_UNISTD_H 1
#cmakedefine01 HAVE_UNISTD_H
/* Define to 1 if you have the <windows.h> header file. */
#cmakedefine HAVE_WINDOWS_H 1
#cmakedefine01 HAVE_WINDOWS_H
/* Define to 1 if you target processors with SSSE3+ and have <tmmintrin.h>. */
#cmakedefine01 SNAPPY_HAVE_SSSE3
@@ -51,6 +51,6 @@
/* Define to 1 if your processor stores words with the most significant byte
first (like Motorola and SPARC, unlike Intel and VAX). */
#cmakedefine SNAPPY_IS_BIG_ENDIAN 1
#cmakedefine01 SNAPPY_IS_BIG_ENDIAN
#endif // THIRD_PARTY_SNAPPY_OPENSOURCE_CMAKE_CONFIG_H_