File tree Expand file tree Collapse file tree 5 files changed +24
-13
lines changed Expand file tree Collapse file tree 5 files changed +24
-13
lines changed Original file line number Diff line number Diff line change 1+ #ifndef Py_CPYTHON_HASH_H
2+ # error "this header file must not be included directly"
3+ #endif
4+
5+ /* hash function definition */
6+ typedef struct {
7+ Py_hash_t (* const hash )(const void * , Py_ssize_t );
8+ const char * name ;
9+ const int hash_bits ;
10+ const int seed_bits ;
11+ } PyHash_FuncDef ;
12+
13+ PyAPI_FUNC (PyHash_FuncDef * ) PyHash_GetFuncDef (void );
Original file line number Diff line number Diff line change 44extern "C" {
55#endif
66
7- #ifndef Py_LIMITED_API
8- /* hash function definition */
9- typedef struct {
10- Py_hash_t (* const hash )(const void * , Py_ssize_t );
11- const char * name ;
12- const int hash_bits ;
13- const int seed_bits ;
14- } PyHash_FuncDef ;
15-
16- PyAPI_FUNC (PyHash_FuncDef * ) PyHash_GetFuncDef (void );
17- #endif
18-
19-
207/* Cutoff for small string DJBX33A optimization in range [1, cutoff).
218 *
229 * About 50% of the strings in a typical Python application are smaller than
@@ -60,6 +47,12 @@ PyAPI_FUNC(PyHash_FuncDef*) PyHash_GetFuncDef(void);
6047# endif /* uint64_t && uint32_t && aligned */
6148#endif /* Py_HASH_ALGORITHM */
6249
50+ #ifndef Py_LIMITED_API
51+ # define Py_CPYTHON_HASH_H
52+ # include "cpython/pyhash.h"
53+ # undef Py_CPYTHON_HASH_H
54+ #endif
55+
6356#ifdef __cplusplus
6457}
6558#endif
Original file line number Diff line number Diff line change @@ -1768,6 +1768,7 @@ PYTHON_HEADERS= \
17681768 $(srcdir)/Include/cpython/pyerrors.h \
17691769 $(srcdir)/Include/cpython/pyfpe.h \
17701770 $(srcdir)/Include/cpython/pyframe.h \
1771+ $(srcdir)/Include/cpython/pyhash.h \
17711772 $(srcdir)/Include/cpython/pylifecycle.h \
17721773 $(srcdir)/Include/cpython/pymem.h \
17731774 $(srcdir)/Include/cpython/pystate.h \
Original file line number Diff line number Diff line change 172172 <ClInclude Include =" ..\Include\cpython\pyerrors.h" />
173173 <ClInclude Include =" ..\Include\cpython\pyfpe.h" />
174174 <ClInclude Include =" ..\Include\cpython\pyframe.h" />
175+ <ClInclude Include =" ..\Include\cpython\pyhash.h" />
175176 <ClInclude Include =" ..\Include\cpython\pylifecycle.h" />
176177 <ClInclude Include =" ..\Include\cpython\pymem.h" />
177178 <ClInclude Include =" ..\Include\cpython\pystate.h" />
Original file line number Diff line number Diff line change 468468 <ClInclude Include =" ..\Include\cpython\pyframe.h" >
469469 <Filter >Include\cpython</Filter >
470470 </ClInclude >
471+ <ClInclude Include =" ..\Include\cpython\pyhash.h" >
472+ <Filter >Include\cpython</Filter >
473+ </ClInclude >
471474 <ClInclude Include =" ..\Include\cpython\pylifecycle.h" >
472475 <Filter >Include\cpython</Filter >
473476 </ClInclude >
You can’t perform that action at this time.
0 commit comments