Skip to content

Commit 57815f6

Browse files
committed
Ensure that monoclr is linked as a C++ library
1 parent 3915a94 commit 57815f6

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

setup.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -404,6 +404,7 @@ def _build_monoclr(self):
404404
# build the clr python module
405405
clr_ext = Extension(
406406
"clr",
407+
language="c++",
407408
sources=["src/monoclr/pynetinit.c", "src/monoclr/clrmod.c"],
408409
extra_compile_args=cflags.split(" "),
409410
extra_link_args=libs.split(" "),

src/monoclr/pynetclr.h

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

15+
#ifdef __cplusplus
16+
extern "C" {
17+
#endif
18+
1519
typedef struct
1620
{
1721
MonoDomain *domain;
@@ -29,4 +33,8 @@ void PyNet_Finalize(PyNet_Args *);
2933
void main_thread_handler(PyNet_Args *user_data);
3034
char *PyNet_ExceptionToString(MonoObject *);
3135

36+
#ifdef __cplusplus
37+
}
38+
#endif
39+
3240
#endif // PYNET_CLR_H

0 commit comments

Comments
 (0)