summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Include/internal/pycore_hashtable.h (renamed from Modules/hashtable.h)17
-rw-r--r--Makefile.pre.in2
-rw-r--r--Modules/Setup2
-rw-r--r--Modules/_tracemalloc.c2
-rw-r--r--PCbuild/pythoncore.vcxproj3
-rw-r--r--PCbuild/pythoncore.vcxproj.filters9
-rw-r--r--Python/hashtable.c (renamed from Modules/hashtable.c)2
-rw-r--r--Python/marshal.c2
8 files changed, 26 insertions, 13 deletions
diff --git a/Modules/hashtable.h b/Include/internal/pycore_hashtable.h
index dbec23d..585f76b 100644
--- a/Modules/hashtable.h
+++ b/Include/internal/pycore_hashtable.h
@@ -1,7 +1,12 @@
-#ifndef Py_HASHTABLE_H
-#define Py_HASHTABLE_H
-/* The whole API is private */
-#ifndef Py_LIMITED_API
+#ifndef Py_INTERNAL_HASHTABLE_H
+#define Py_INTERNAL_HASHTABLE_H
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef Py_BUILD_CORE
+# error "this header requires Py_BUILD_CORE define"
+#endif
/* Single linked list */
@@ -207,5 +212,7 @@ PyAPI_FUNC(int) _Py_hashtable_pop(
_Py_hashtable_pop(TABLE, sizeof(KEY), &(KEY), sizeof(DATA), &(DATA))
-#endif /* Py_LIMITED_API */
+#ifdef __cplusplus
+}
#endif
+#endif /* !Py_INTERNAL_HASHTABLE_H */
diff --git a/Makefile.pre.in b/Makefile.pre.in
index 0d616d3..d545a9e 100644
--- a/Makefile.pre.in
+++ b/Makefile.pre.in
@@ -351,6 +351,7 @@ PYTHON_OBJS= \
Python/getversion.o \
Python/graminit.o \
Python/hamt.o \
+ Python/hashtable.o \
Python/import.o \
Python/importdl.o \
Python/initconfig.o \
@@ -1131,6 +1132,7 @@ PYTHON_HEADERS= \
$(srcdir)/Include/internal/pycore_getopt.h \
$(srcdir)/Include/internal/pycore_gil.h \
$(srcdir)/Include/internal/pycore_hamt.h \
+ $(srcdir)/Include/internal/pycore_hashtable.h \
$(srcdir)/Include/internal/pycore_import.h \
$(srcdir)/Include/internal/pycore_initconfig.h \
$(srcdir)/Include/internal/pycore_interp.h \
diff --git a/Modules/Setup b/Modules/Setup
index 6bf1424..87e73ba 100644
--- a/Modules/Setup
+++ b/Modules/Setup
@@ -132,7 +132,7 @@ faulthandler faulthandler.c
#
# bpo-35053: The module must be builtin since _Py_NewReference()
# can call _PyTraceMalloc_NewReference().
-_tracemalloc _tracemalloc.c hashtable.c
+_tracemalloc _tracemalloc.c
# PEG-based parser module -- slated to be *the* parser
_peg_parser _peg_parser.c
diff --git a/Modules/_tracemalloc.c b/Modules/_tracemalloc.c
index ea7e012..f223381 100644
--- a/Modules/_tracemalloc.c
+++ b/Modules/_tracemalloc.c
@@ -2,7 +2,7 @@
#include "pycore_gc.h" // PyGC_Head
#include "pycore_pymem.h" // _Py_tracemalloc_config
#include "pycore_traceback.h"
-#include "hashtable.h"
+#include "pycore_hashtable.h"
#include "frameobject.h" // PyFrame_GetBack()
#include "clinic/_tracemalloc.c.h"
diff --git a/PCbuild/pythoncore.vcxproj b/PCbuild/pythoncore.vcxproj
index 73274ac..b6b0cf3 100644
--- a/PCbuild/pythoncore.vcxproj
+++ b/PCbuild/pythoncore.vcxproj
@@ -181,6 +181,7 @@
<ClInclude Include="..\Include\internal\pycore_getopt.h" />
<ClInclude Include="..\Include\internal\pycore_gil.h" />
<ClInclude Include="..\Include\internal\pycore_hamt.h" />
+ <ClInclude Include="..\Include\internal\pycore_hashtable.h" />
<ClInclude Include="..\Include\internal\pycore_import.h" />
<ClInclude Include="..\Include\internal\pycore_initconfig.h" />
<ClInclude Include="..\Include\internal\pycore_interp.h" />
@@ -335,7 +336,6 @@
<ClCompile Include="..\Modules\errnomodule.c" />
<ClCompile Include="..\Modules\faulthandler.c" />
<ClCompile Include="..\Modules\gcmodule.c" />
- <ClCompile Include="..\Modules\hashtable.c" />
<ClCompile Include="..\Modules\itertoolsmodule.c" />
<ClCompile Include="..\Modules\main.c" />
<ClCompile Include="..\Modules\mathmodule.c" />
@@ -462,6 +462,7 @@
<ClCompile Include="..\Python\getversion.c" />
<ClCompile Include="..\Python\graminit.c" />
<ClCompile Include="..\Python\hamt.c" />
+ <ClCompile Include="..\Python\hashtable.c" />
<ClCompile Include="..\Python\import.c" />
<ClCompile Include="..\Python\importdl.c" />
<ClCompile Include="..\Python\initconfig.c" />
diff --git a/PCbuild/pythoncore.vcxproj.filters b/PCbuild/pythoncore.vcxproj.filters
index 254c8fb..10dfffb 100644
--- a/PCbuild/pythoncore.vcxproj.filters
+++ b/PCbuild/pythoncore.vcxproj.filters
@@ -237,6 +237,9 @@
<ClInclude Include="..\Include\internal\pycore_hamt.h">
<Filter>Include</Filter>
</ClInclude>
+ <ClInclude Include="..\Include\internal\pycore_hashtable.h">
+ <Filter>Include</Filter>
+ </ClInclude>
<ClInclude Include="..\Include\internal\pycore_import.h">
<Filter>Include</Filter>
</ClInclude>
@@ -1034,6 +1037,9 @@
<ClCompile Include="..\Python\hamt.h">
<Filter>Python</Filter>
</ClCompile>
+ <ClCompile Include="..\Python\hashtable.c">
+ <Filter>Modules</Filter>
+ </ClCompile>
<ClCompile Include="..\Python\import.c">
<Filter>Python</Filter>
</ClCompile>
@@ -1142,9 +1148,6 @@
<ClCompile Include="..\Modules\_tracemalloc.c">
<Filter>Modules</Filter>
</ClCompile>
- <ClCompile Include="..\Modules\hashtable.c">
- <Filter>Modules</Filter>
- </ClCompile>
<ClCompile Include="..\PC\invalid_parameter_handler.c">
<Filter>PC</Filter>
</ClCompile>
diff --git a/Modules/hashtable.c b/Python/hashtable.c
index 4a36a1e..22b8459 100644
--- a/Modules/hashtable.c
+++ b/Python/hashtable.c
@@ -45,7 +45,7 @@
*/
#include "Python.h"
-#include "hashtable.h"
+#include "pycore_hashtable.h"
#define HASHTABLE_MIN_SIZE 16
#define HASHTABLE_HIGH 0.50
diff --git a/Python/marshal.c b/Python/marshal.c
index b4429ae..d2bff52 100644
--- a/Python/marshal.c
+++ b/Python/marshal.c
@@ -12,7 +12,7 @@
#include "longintrepr.h"
#include "code.h"
#include "marshal.h"
-#include "../Modules/hashtable.h"
+#include "pycore_hashtable.h"
/*[clinic input]
module marshal