summaryrefslogtreecommitdiff
path: root/lib/mkmf.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/mkmf.rb')
-rw-r--r--lib/mkmf.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/mkmf.rb b/lib/mkmf.rb
index d456438..5dc843f 100644
--- a/lib/mkmf.rb
+++ b/lib/mkmf.rb
@@ -159,8 +159,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; }
@@ -213,8 +221,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; }