aboutsummaryrefslogtreecommitdiffhomepage
path: root/templates
diff options
context:
space:
mode:
authorGravatar Nicolas "Pixel" Noble <pixel@nobis-crew.org>2016-01-30 05:21:15 +0100
committerGravatar Nicolas "Pixel" Noble <pixel@nobis-crew.org>2016-01-30 06:01:27 +0100
commitd14b6acdcc10059fca1bf1852b9a97de9de7e323 (patch)
tree037fce2cdeac3db9318914bf11613b98a8ab46a8 /templates
parent11b87bfb2a885824350d76332de7e1ddb488cd67 (diff)
Finalizing this a bit.
Diffstat (limited to 'templates')
-rw-r--r--templates/grpc.def.template8
-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
3 files changed, 25 insertions, 7 deletions
diff --git a/templates/grpc.def.template b/templates/grpc.def.template
new file mode 100644
index 0000000000..68147853f1
--- /dev/null
+++ b/templates/grpc.def.template
@@ -0,0 +1,8 @@
+%YAML 1.2
+--- |
+ LIBRARY
+
+ EXPORTS
+ % for api in c_apis:
+ ${api.name}
+ % endfor
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