Skip to content

Commit 0c1d2b2

Browse files
committed
Define PyInit_cmodule so the Windows build will pass
1 parent 5ae85ff commit 0c1d2b2

File tree

1 file changed

+10
-0
lines changed
  • pyperformance/data-files/benchmarks/bm_ctypes

1 file changed

+10
-0
lines changed

pyperformance/data-files/benchmarks/bm_ctypes/cmodule.c

+10
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,13 @@ void void_foo_constchar(const char* str) {
2626

2727
}
2828

29+
PyMODINIT_FUNC
30+
PyInit_cmodule(void) {
31+
// DELIBERATELY EMPTY
32+
33+
// This isn't actually a Python extension module (it's used via ctypes), so
34+
// this entry point function will never be called. However, we are utilizing
35+
// setuptools to build it, and on Windows, setuptools explicitly passes the
36+
// flag /EXPORT:PyInit_cmodule, so it must be defined.
37+
return NULL;
38+
}

0 commit comments

Comments
 (0)