File tree 2 files changed +13
-5
lines changed
2 files changed +13
-5
lines changed Original file line number Diff line number Diff line change @@ -87,13 +87,17 @@ Used in: Py_SAFE_DOWNCAST
87
87
88
88
/* If PYLONG_BITS_IN_DIGIT is not defined then we'll use 30-bit digits if all
89
89
the necessary integer types are available, and we're on a 64-bit platform
90
- (as determined by SIZEOF_VOID_P); otherwise we use 15-bit digits. */
90
+ (as determined by SIZEOF_VOID_P); otherwise we use 15-bit digits.
91
+
92
+ From pyodide: WASM has 32 bit pointers but has native 64 bit arithmetic
93
+ so it is more efficient to use 30 bit digits.
94
+ */
91
95
92
96
#ifndef PYLONG_BITS_IN_DIGIT
93
- #if SIZEOF_VOID_P >= 8
94
- #define PYLONG_BITS_IN_DIGIT 30
97
+ #if SIZEOF_VOID_P >= 8 || defined( __wasm__ )
98
+ # define PYLONG_BITS_IN_DIGIT 30
95
99
#else
96
- #define PYLONG_BITS_IN_DIGIT 15
100
+ # define PYLONG_BITS_IN_DIGIT 15
97
101
#endif
98
102
#endif
99
103
Original file line number Diff line number Diff line change @@ -2145,7 +2145,11 @@ is_valid_fd(int fd)
2145
2145
if (fd < 0 ) {
2146
2146
return 0 ;
2147
2147
}
2148
- #if defined(F_GETFD ) && (defined(__linux__ ) || defined(__APPLE__ ) || defined(MS_WINDOWS ))
2148
+ #if defined(F_GETFD ) && ( \
2149
+ defined(__linux__ ) || \
2150
+ defined(__APPLE__ ) || \
2151
+ defined(MS_WINDOWS ) || \
2152
+ defined(__wasm__ ))
2149
2153
int res ;
2150
2154
_Py_BEGIN_SUPPRESS_IPH
2151
2155
res = fcntl (fd , F_GETFD );
You can’t perform that action at this time.
0 commit comments