8000 bpo-46670: Fix #ifdef in sha3module.c (GH-31180) · python/cpython@f20ca76 · GitHub
[go: up one dir, main page]

Skip to content

Commit f20ca76

Browse files
authored
bpo-46670: Fix #ifdef in sha3module.c (GH-31180)
* Test if HAVE_ALIGNED_REQUIRED is defined, not its value. * Define explicitly NOT_PYTHON macro to 0. Fix "gcc -Wundef" warnings.
1 parent 7d8b69e commit f20ca76

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Modules/_sha3/sha3module.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@
5757
typedef uint64_t UINT64;
5858
typedef unsigned char UINT8;
5959
#endif
60+
// kcp/KeccakP-1600-opt64.c doesn't need to define UINT8
61+
#define NOT_PYTHON 0
6062

6163
/* replacement for brg_endian.h */
6264
#define IS_LITTLE_ENDIAN 1234
@@ -69,7 +71,7 @@
6971
#endif
7072

7173
/* Prevent bus errors on platforms requiring aligned accesses such ARM. */
72-
#if HAVE_ALIGNED_REQUIRED && !defined(NO_MISALIGNED_ACCESSES)
74+
#if defined(HAVE_ALIGNED_REQUIRED) && !defined(NO_MISALIGNED_ACCESSES)
7375
#define NO_MISALIGNED_ACCESSES
7476
#endif
7577

0 commit comments

Comments
 (0)
0