summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
Diffstat (limited to 'ext')
-rw-r--r--ext/extmk.rb.in16
1 files changed, 16 insertions, 0 deletions
diff --git a/ext/extmk.rb.in b/ext/extmk.rb.in
index 0c134671ec..44232da7a1 100644
--- a/ext/extmk.rb.in
+++ b/ext/extmk.rb.in
@@ -174,8 +174,16 @@ def have_library(lib, func="main")
#include <windows.h>
#include <winsock.h>
int main() { return 0; }
+int t() { #{func}(); return 0; }
+SRC
+ unless r
+ r = try_link(<<"SRC", libs)
+#include <windows.h>
+#include <winsock.h>
+int main() { return 0; }
int t() { void ((*p)()); p = (void ((*)()))#{func}; return 0; }
SRC
+ end
else
r = try_link(<<"SRC", libs)
int main() { return 0; }
@@ -218,8 +226,16 @@ def have_func(func)
#include <windows.h>
#include <winsock.h>
int main() { return 0; }
+int t() { #{func}(); return 0; }
+SRC
+ unless r
+ r = try_link(<<"SRC", libs)
+#include <windows.h>
+#include <winsock.h>
+int main() { return 0; }
int t() { void ((*p)()); p = (void ((*)()))#{func}; return 0; }
SRC
+ end
else
r = try_link(<<"SRC", libs)
int main() { return 0; }