]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-46670: Fix #ifdef in sha3module.c (GH-31180)
authorVictor Stinner <vstinner@python.org>
Mon, 7 Feb 2022 15:22:24 +0000 (16:22 +0100)
committerGitHub <noreply@github.com>
Mon, 7 Feb 2022 15:22:24 +0000 (16:22 +0100)
* Test if HAVE_ALIGNED_REQUIRED is defined, not its value.
* Define explicitly NOT_PYTHON macro to 0.

Fix "gcc -Wundef" warnings.

Modules/_sha3/sha3module.c

index bfa96616df0c99327acee7fee53ef072eeb6522c..bffd177c0e753225c11ed057c5e7e500d20cce41 100644 (file)
@@ -57,6 +57,8 @@
   typedef uint64_t UINT64;
   typedef unsigned char UINT8;
 #endif
+// kcp/KeccakP-1600-opt64.c doesn't need to define UINT8
+#define NOT_PYTHON 0
 
 /* replacement for brg_endian.h */
 #define IS_LITTLE_ENDIAN 1234
@@ -69,7 +71,7 @@
 #endif
 
 /* Prevent bus errors on platforms requiring aligned accesses such ARM. */
-#if HAVE_ALIGNED_REQUIRED && !defined(NO_MISALIGNED_ACCESSES)
+#if defined(HAVE_ALIGNED_REQUIRED) && !defined(NO_MISALIGNED_ACCESSES)
 #define NO_MISALIGNED_ACCESSES
 #endif