File tree Expand file tree Collapse file tree 2 files changed +20
-9
lines changed Expand file tree Collapse file tree 2 files changed +20
-9
lines changed Original file line number Diff line number Diff line change 77
88
99struct pyhash_runtime_state {
10- // This is a placeholder so the struct isn't empty on Windows.
11- int _not_used ;
12- #ifndef MS_WINDOWS
1310 struct {
11+ #ifndef MS_WINDOWS
1412 int fd ;
1513 dev_t st_dev ;
1614 ino_t st_ino ;
17- } urandom_cache ;
15+ #else
16+ // This is a placeholder so the struct isn't empty on Windows.
17+ int _not_used ;
1818#endif
19+ } urandom_cache ;
1920};
2021
22+ #ifndef MS_WINDOWS
23+ # define _py_urandom_cache_INIT \
24+ { \
25+ .fd = -1, \
26+ }
27+ #else
28+ # define _py_urandom_cache_INIT {0}
29+ #endif
30+
31+ #define pyhash_state_INIT \
32+ { \
33+ .urandom_cache = _py_urandom_cache_INIT, \
34+ }
35+
2136
2237uint64_t _Py_KeyedHash (uint64_t , const char * , Py_ssize_t );
2338
Original file line number Diff line number Diff line change @@ -25,11 +25,7 @@ extern "C" {
2525 _pymem_allocators_obj_arena_INIT, \
2626 }, \
2727 .obmalloc = _obmalloc_state_INIT(runtime.obmalloc), \
28- .pyhash_state = { \
29- .urandom_cache = { \
30- .fd = -1, \
31- }, \
32- }, \
28+ .pyhash_state = pyhash_state_INIT, \
3329 .interpreters = { \
3430 /* This prevents interpreters from getting created \
3531 until _PyInterpreterState_Enable() is called. */ \
You can’t perform that action at this time.
0 commit comments