diff options
author | Victor Stinner <vstinner@python.org> | 2023-11-15 00:19:20 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-15 00:19:20 (GMT) |
commit | 62802b6228f001e1a4af6ac668a21d2dcec0ce57 (patch) | |
tree | 586ea64bb854e42a242751f5f2f2ab90c768375b /Include/pyhash.h | |
parent | 9302f05f9af07332c414b3c19003efd1b1763cf3 (diff) | |
download | cpython-62802b6228f001e1a4af6ac668a21d2dcec0ce57.zip cpython-62802b6228f001e1a4af6ac668a21d2dcec0ce57.tar.gz cpython-62802b6228f001e1a4af6ac668a21d2dcec0ce57.tar.bz2 |
gh-111545: Add Include/cpython/pyhash.h header file (#112063)
Move non-limited C API to a new Include/cpython/pyhash.h header file.
Diffstat (limited to 'Include/pyhash.h')
-rw-r--r-- | Include/pyhash.h | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/Include/pyhash.h b/Include/pyhash.h index 6e969f8..3e23e275 100644 --- a/Include/pyhash.h +++ b/Include/pyhash.h @@ -4,19 +4,6 @@ extern "C" { #endif -#ifndef Py_LIMITED_API -/* hash function definition */ -typedef struct { - Py_hash_t (*const hash)(const void *, Py_ssize_t); - const char *name; - const int hash_bits; - const int seed_bits; -} PyHash_FuncDef; - -PyAPI_FUNC(PyHash_FuncDef*) PyHash_GetFuncDef(void); -#endif - - /* Cutoff for small string DJBX33A optimization in range [1, cutoff). * * About 50% of the strings in a typical Python application are smaller than @@ -60,6 +47,12 @@ PyAPI_FUNC(PyHash_FuncDef*) PyHash_GetFuncDef(void); # endif /* uint64_t && uint32_t && aligned */ #endif /* Py_HASH_ALGORITHM */ +#ifndef Py_LIMITED_API +# define Py_CPYTHON_HASH_H +# include "cpython/pyhash.h" +# undef Py_CPYTHON_HASH_H +#endif + #ifdef __cplusplus } #endif |