aboutsummaryrefslogtreecommitdiffhomepage
path: root/templates
diff options
context:
space:
mode:
authorGravatar Masood Malekghassemi <atash@google.com>2016-02-16 21:08:49 -0800
committerGravatar Masood Malekghassemi <atash@google.com>2016-02-17 12:00:49 -0800
commitd01391233ad11cfd77b909e22cfd7bc6de62c2af (patch)
treea7052a16a0a46dca071d69e4d90b5f51828d6862 /templates
parent84ef9d75d7a33f6b2bf61709d6229c769cf227b4 (diff)
Extern "C" Python DLL support
Diffstat (limited to 'templates')
-rw-r--r--templates/src/python/grpcio/grpc/_cython/imports.generated.c.template9
-rw-r--r--templates/src/python/grpcio/grpc/_cython/imports.generated.h.template8
2 files changed, 17 insertions, 0 deletions
diff --git a/templates/src/python/grpcio/grpc/_cython/imports.generated.c.template b/templates/src/python/grpcio/grpc/_cython/imports.generated.c.template
index be33280c0c..62fe0947d2 100644
--- a/templates/src/python/grpcio/grpc/_cython/imports.generated.c.template
+++ b/templates/src/python/grpcio/grpc/_cython/imports.generated.c.template
@@ -43,10 +43,19 @@
${api.name}_type ${api.name}_import;
%endfor
+ #ifdef __cplusplus
+ extern "C" {
+ #endif /* __cpluslus */
+
void pygrpc_load_imports(HMODULE library) {
%for api in c_apis:
${api.name}_import = (${api.name}_type) GetProcAddress(library, "${api.name}");
%endfor
}
+ #ifdef __cplusplus
+ }
+ #endif /* __cpluslus */
+
#endif /* !GPR_WIN32 */
+
diff --git a/templates/src/python/grpcio/grpc/_cython/imports.generated.h.template b/templates/src/python/grpcio/grpc/_cython/imports.generated.h.template
index 6866a61cae..8e7c183180 100644
--- a/templates/src/python/grpcio/grpc/_cython/imports.generated.h.template
+++ b/templates/src/python/grpcio/grpc/_cython/imports.generated.h.template
@@ -52,8 +52,16 @@
#define ${api.name} ${api.name}_import
%endfor
+ #ifdef __cplusplus
+ extern "C" {
+ #endif /* __cpluslus */
+
void pygrpc_load_imports(HMODULE library);
+ #ifdef __cplusplus
+ }
+ #endif /* __cpluslus */
+
#else /* !GPR_WIN32 */
#include <grpc/support/alloc.h>