pyodide/cpython/patches/0006-Fix-LONG_BIT-constant-...

34 lines
1.0 KiB
Diff

From d9e6867695c02c07420d8a15d4ae1b96ea41f553 Mon Sep 17 00:00:00 2001
From: ryanking13 <def6488@gmail.com>
Date: Fri, 12 Jan 2024 00:52:57 +0900
Subject: [PATCH 6/8] Fix LONG_BIT constant to be always 32bit
Starting from Emscripten 3.1.50, there is an issue where LONG_BIT is
calculated to 64 for some reason. This is very strange because LONG_MAX
becomes 2^64-1 when calculating LONG_BIT (in limits.h), but it then
becomes 2^32-1 when it is accessed in other places.
I wasn't able to make a minimal code to reproduce a bug. Probably
something is messed up while importing pyconfig.h, etc.
Related: https://github.com/emscripten-core/emscripten/pull/20752
---
Include/pyport.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/Include/pyport.h b/Include/pyport.h
index e2bac3bf504..ae1c1a40260 100644
--- a/Include/pyport.h
+++ b/Include/pyport.h
@@ -573,6 +573,7 @@ extern char * _getpty(int *, int, mode_t, int);
#define LONG_MIN (-LONG_MAX-1)
#endif
+#undef LONG_BIT
#ifndef LONG_BIT
#define LONG_BIT (8 * SIZEOF_LONG)
#endif
--
2.34.1