Skip to content

Commit ce7e1fb

Browse files
committed
Ensure that monoclr is linked as a C++ library
1 parent d8f5d9a commit ce7e1fb

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

setup.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -285,8 +285,8 @@ def build_extension(self, ext):
285285
if "libpython" not in lddout:
286286
enable_shared = False
287287

288-
if not enable_shared:
289-
defines.append("PYTHON_WITHOUT_ENABLE_SHARED")
288+
#if not enable_shared:
289+
# defines.append("PYTHON_WITHOUT_ENABLE_SHARED")
290290

291291
if hasattr(sys, "abiflags"):
292292
if "d" in sys.abiflags:
@@ -406,6 +406,7 @@ def _build_monoclr(self):
406406
# build the clr python module
407407
clr_ext = Extension(
408408
"clr",
409+
language="c++",
409410
sources=["src/monoclr/pynetinit.c", "src/monoclr/clrmod.c"],
410411
extra_compile_args=cflags.split(" "),
411412
extra_link_args=libs.split(" "),

src/monoclr/pynetclr.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@
1313
#define MONO_DOMAIN "Python.Runtime"
1414
#define PR_ASSEMBLY "Python.Runtime.dll"
1515

16+
#ifdef __cplusplus
17+
extern "C" {
18+
#endif
19+
1620
typedef struct
1721
{
1822
MonoDomain *domain;
@@ -30,4 +34,8 @@ void PyNet_Finalize(PyNet_Args *);
3034
void main_thread_handler(gpointer user_data);
3135
char *PyNet_ExceptionToString(MonoObject *);
3236

37+
#ifdef __cplusplus
38+
}
39+
#endif
40+
3341
#endif // PYNET_CLR_H

0 commit comments

Comments
 (0)