Merge pull request #5277 from soltanmm/abimerp

Extern "C" Python DLL support
pull/5124/merge
Bogdan Drutu 9 years ago
commit a3d33b93c4
  1. 8
      src/python/grpcio/grpc/_cython/imports.generated.c
  2. 8
      src/python/grpcio/grpc/_cython/imports.generated.h
  3. 11
      src/python/grpcio/grpc/_cython/loader.c
  4. 9
      src/python/grpcio/grpc/_cython/loader.h
  5. 9
      templates/src/python/grpcio/grpc/_cython/imports.generated.c.template
  6. 8
      templates/src/python/grpcio/grpc/_cython/imports.generated.h.template

@ -296,6 +296,10 @@ gpr_thd_options_is_joinable_type gpr_thd_options_is_joinable_import;
gpr_thd_currentid_type gpr_thd_currentid_import;
gpr_thd_join_type gpr_thd_join_import;
#ifdef __cplusplus
extern "C" {
#endif /* __cpluslus */
void pygrpc_load_imports(HMODULE library) {
census_initialize_import = (census_initialize_type) GetProcAddress(library, "census_initialize");
census_shutdown_import = (census_shutdown_type) GetProcAddress(library, "census_shutdown");
@ -557,4 +561,8 @@ void pygrpc_load_imports(HMODULE library) {
gpr_thd_join_import = (gpr_thd_join_type) GetProcAddress(library, "gpr_thd_join");
}
#ifdef __cplusplus
}
#endif /* __cpluslus */
#endif /* !GPR_WIN32 */

@ -836,8 +836,16 @@ typedef void(*gpr_thd_join_type)(gpr_thd_id t);
extern gpr_thd_join_type gpr_thd_join_import;
#define gpr_thd_join gpr_thd_join_import
#ifdef __cplusplus
extern "C" {
#endif /* __cpluslus */
void pygrpc_load_imports(HMODULE library);
#ifdef __cplusplus
}
#endif /* __cpluslus */
#else /* !GPR_WIN32 */
#include <grpc/support/alloc.h>

@ -33,6 +33,10 @@
#include "loader.h"
#ifdef __cplusplus
extern "C" {
#endif /* __cpluslus */
#if GPR_WIN32
int pygrpc_load_core(char *path) {
@ -56,4 +60,9 @@ int pygrpc_load_core(char *path) {
int pygrpc_load_core(char *path) { return 1; }
#endif
#endif /* !GPR_WIN32 */
#ifdef __cplusplus
}
#endif /* __cpluslus */

@ -39,7 +39,16 @@
/* Additional inclusions not covered by "imports.generated.h" */
#include <grpc/byte_buffer_reader.h>
#ifdef __cplusplus
extern "C" {
#endif /* __cpluslus */
/* Attempts to load the core if necessary, and return non-zero upon succes. */
int pygrpc_load_core(char *path);
#ifdef __cplusplus
}
#endif /* __cpluslus */
#endif /* GRPC_RB_BYTE_BUFFER_H_ */

@ -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 */

@ -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>

Loading…
Cancel
Save