diff options
author | Nicolas "Pixel" Noble <pixel@nobis-crew.org> | 2016-01-30 05:21:15 +0100 |
---|---|---|
committer | Nicolas "Pixel" Noble <pixel@nobis-crew.org> | 2016-01-30 06:01:27 +0100 |
commit | d14b6acdcc10059fca1bf1852b9a97de9de7e323 (patch) | |
tree | 037fce2cdeac3db9318914bf11613b98a8ab46a8 /templates/src/ruby | |
parent | 11b87bfb2a885824350d76332de7e1ddb488cd67 (diff) |
Finalizing this a bit.
Diffstat (limited to 'templates/src/ruby')
-rw-r--r-- | templates/src/ruby/ext/grpc/rb_grpc_imports.generated.c.template (renamed from templates/src/ruby/ext/grpc/rb_grpc_imports.c.template) | 14 | ||||
-rw-r--r-- | templates/src/ruby/ext/grpc/rb_grpc_imports.generated.h.template (renamed from templates/src/ruby/ext/grpc/rb_grpc_imports.h.template) | 10 |
2 files changed, 17 insertions, 7 deletions
diff --git a/templates/src/ruby/ext/grpc/rb_grpc_imports.c.template b/templates/src/ruby/ext/grpc/rb_grpc_imports.generated.c.template index 5199bd37b3..af2afe168a 100644 --- a/templates/src/ruby/ext/grpc/rb_grpc_imports.c.template +++ b/templates/src/ruby/ext/grpc/rb_grpc_imports.generated.c.template @@ -33,18 +33,20 @@ * */ - #include "rb_grpc_imports.h" + #include <grpc/support/port_platform.h> + + #ifdef GPR_WIN32 + + #include "rb_grpc_imports.h" %for api in c_apis: ${api.name}_type ${api.name}_import; %endfor - int grpc_rb_load_imports(const wchar_t *filename) { - HMODULE hm = LoadLibrary(filename); - if (hm == NULL) return 0; + void grpc_rb_load_imports(HMODULE library) { %for api in c_apis: - ${api.name}_import = (${api.name}_type) GetProcAddress(hm, "${api.name}"); + ${api.name}_import = (${api.name}_type) GetProcAddress(library, "${api.name}"); %endfor } - #endif + #endif /* GPR_WIN32 */ diff --git a/templates/src/ruby/ext/grpc/rb_grpc_imports.h.template b/templates/src/ruby/ext/grpc/rb_grpc_imports.generated.h.template index 4a3c2ca0a2..7873df583a 100644 --- a/templates/src/ruby/ext/grpc/rb_grpc_imports.h.template +++ b/templates/src/ruby/ext/grpc/rb_grpc_imports.generated.h.template @@ -36,6 +36,12 @@ #ifndef GRPC_RB_GRPC_IMPORTS_H_ #define GRPC_RB_GRPC_IMPORTS_H_ + #include <grpc/support/port_platform.h> + + #ifdef GPR_WIN32 + + #include <windows.h> + %for header in sorted(set(api.header for api in c_apis)): #include <${header}> %endfor @@ -46,6 +52,8 @@ #define ${api.name} ${api.name}_import %endfor - int grpc_rb_load_imports(const wchar_t *filename); + void grpc_rb_load_imports(HMODULE library); + + #endif /* GPR_WIN32 */ #endif |