summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
Diffstat (limited to 'ext')
-rw-r--r--ext/Win32API/Win32API.c2
-rw-r--r--ext/Win32API/extconf.rb2
-rw-r--r--ext/curses/extconf.rb2
-rw-r--r--ext/extmk.rb.in10
-rw-r--r--ext/pty/extconf.rb2
-rw-r--r--ext/readline/extconf.rb2
-rw-r--r--ext/socket/extconf.rb4
-rw-r--r--ext/socket/sockport.h5
-rw-r--r--ext/tcltklib/extconf.rb12
-rw-r--r--ext/tcltklib/tcltklib.c4
10 files changed, 26 insertions, 19 deletions
diff --git a/ext/Win32API/Win32API.c b/ext/Win32API/Win32API.c
index 27693c7257d..3f0ceae9e19 100644
--- a/ext/Win32API/Win32API.c
+++ b/ext/Win32API/Win32API.c
@@ -2,7 +2,7 @@
Win32API - Ruby Win32 API Import Facility
*/
-#ifndef _MSC_VER
+#if !defined _MSC_VER && !defined NT
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <stdio.h>
diff --git a/ext/Win32API/extconf.rb b/ext/Win32API/extconf.rb
index 5af3243d966..f8d78e14659 100644
--- a/ext/Win32API/extconf.rb
+++ b/ext/Win32API/extconf.rb
@@ -1,4 +1,4 @@
-case PLATFORM
+case RUBY_PLATFORM
when /cygwin/,/mingw/
$CFLAGS = "-fno-defer-pop"
create_makefile("Win32API")
diff --git a/ext/curses/extconf.rb b/ext/curses/extconf.rb
index e1bf24c4354..5c6881164a8 100644
--- a/ext/curses/extconf.rb
+++ b/ext/curses/extconf.rb
@@ -1,7 +1,7 @@
require 'mkmf'
make=false
-have_library("mytinfo", "tgetent") if /bow/ =~ PLATFORM
+have_library("mytinfo", "tgetent") if /bow/ =~ RUBY_PLATFORM
if have_header("ncurses.h") and have_library("ncurses", "initscr")
make=true
elsif have_header("ncurses/curses.h") and have_library("ncurses", "initscr")
diff --git a/ext/extmk.rb.in b/ext/extmk.rb.in
index 7caa5985c26..279906830f4 100644
--- a/ext/extmk.rb.in
+++ b/ext/extmk.rb.in
@@ -53,7 +53,7 @@ end
LINK = "@CC@ -o conftest -I#$topdir -I#$top_srcdir #{CFLAGS} -I#$includedir @LDFLAGS@ %s %s conftest.c %s %s @LIBS@"
CPP = "@CPP@ @CPPFLAGS@ -I#$topdir -I#$top_srcdir #{CFLAGS} -I#$includedir %s %s conftest.c"
-if /cygwin|mswin32|djgpp|mingw32|m68k-human|i386-os2_emx/i =~ RUBY_PLATFORM
+if /cygwin|mswin32|djgpp|mingw|m68k-human|i386-os2_emx/i =~ RUBY_PLATFORM
$null = open("nul", "w")
else
$null = open("/dev/null", "w")
@@ -158,7 +158,7 @@ end
def have_library(lib, func="main")
if func && func != ""
libs = append_library($libs, lib)
- if /mswin32/ =~ RUBY_PLATFORM
+ if /mswin32|mingw/ =~ RUBY_PLATFORM
r = try_link(<<"SRC", libs)
#include <windows.h>
#include <winsock.h>
@@ -210,7 +210,7 @@ end
def have_func(func)
libs = $libs
- if /mswin32/ =~ RUBY_PLATFORM
+ if /mswin32|mingw/ =~ RUBY_PLATFORM
r = try_link(<<"SRC", libs)
#include <windows.h>
#include <winsock.h>
@@ -253,7 +253,7 @@ def arg_config(config, default=nil)
unless defined? $configure_args
$configure_args = {}
args = "@configure_args@"
- if /mswin32/ =~ RUBY_PLATFORM and ENV["CONFIGURE_ARGS"]
+ if /mswin32|mingw/ =~ RUBY_PLATFORM and ENV["CONFIGURE_ARGS"]
args = args + " " + ENV["CONFIGURE_ARGS"]
end
for arg in args.split
@@ -340,7 +340,7 @@ def create_makefile(target)
end
defflag = ''
- if RUBY_PLATFORM =~ /cygwin/ and not $static
+ if RUBY_PLATFORM =~ /cygwin|mingw/ and not $static
if File.exist? target + ".def"
defflag = "--def=" + target + ".def"
end
diff --git a/ext/pty/extconf.rb b/ext/pty/extconf.rb
index 63383f7faf8..4df2011eb5c 100644
--- a/ext/pty/extconf.rb
+++ b/ext/pty/extconf.rb
@@ -2,7 +2,7 @@ require 'mkmf'
have_header("sys/stropts.h")
have_func("setresuid")
-$CFLAGS << "-DHAVE_DEV_PTMX" if /cygwin/ === PLATFORM
+$CFLAGS << "-DHAVE_DEV_PTMX" if /cygwin/ === RUBY_PLATFORM
if have_func("openpty") or
have_func("_getpty") or
have_func("ioctl")
diff --git a/ext/readline/extconf.rb b/ext/readline/extconf.rb
index 09d42f69c95..63ece61464a 100644
--- a/ext/readline/extconf.rb
+++ b/ext/readline/extconf.rb
@@ -1,7 +1,7 @@
require "mkmf"
dir_config("readline")
-have_library("user32", nil) if /cygwin/ === PLATFORM
+have_library("user32", nil) if /cygwin/ === RUBY_PLATFORM
have_library("termcap", "tgetnum") or
have_library("curses", "tgetnum") or
have_library("ncurses", "tgetnum")
diff --git a/ext/socket/extconf.rb b/ext/socket/extconf.rb
index 91ac8f6123a..46d5120e2e2 100644
--- a/ext/socket/extconf.rb
+++ b/ext/socket/extconf.rb
@@ -2,8 +2,8 @@ require 'mkmf'
$LDFLAGS += " -L/usr/local/lib" if File.directory?("/usr/local/lib")
$CFLAGS += " -Dss_family=__ss_family -Dss_len=__ss_len"
-case PLATFORM
-when /mswin32/
+case RUBY_PLATFORM
+when /mswin32|mingw/
test_func = "WSACleanup"
have_library("wsock32", "WSACleanup")
have_func("closesocket")
diff --git a/ext/socket/sockport.h b/ext/socket/sockport.h
index 1639fcf8285..e3750816c6e 100644
--- a/ext/socket/sockport.h
+++ b/ext/socket/sockport.h
@@ -40,4 +40,9 @@
# define SET_SIN_LEN(si,len)
#endif
+#ifndef IN_MULTICAST
+# define IN_CLASSD(i) (((long)(i) & 0xf0000000) == 0xe0000000)
+# define IN_MULTICAST(i) IN_CLASSD(i)
+#endif
+
#endif
diff --git a/ext/tcltklib/extconf.rb b/ext/tcltklib/extconf.rb
index 713cc811e5e..70a765a0b9b 100644
--- a/ext/tcltklib/extconf.rb
+++ b/ext/tcltklib/extconf.rb
@@ -2,10 +2,12 @@
require 'mkmf'
-have_library("nsl", "t_open")
-have_library("socket", "socket")
-have_library("dl", "dlopen")
-have_library("m", "log")
+if RUBY_PLATFORM !~ /mswin32|mingw/
+ have_library("nsl", "t_open")
+ have_library("socket", "socket")
+ have_library("dl", "dlopen")
+ have_library("m", "log")
+end
dir_config("tk")
dir_config("tcl")
@@ -41,7 +43,7 @@ def find_tk(tklib)
end
if have_header("tcl.h") && have_header("tk.h") &&
- (/mswin32/ =~ RUBY_PLATFORM || find_library("X11", "XOpenDisplay",
+ (/mswin32|mingw|cygwin/ =~ RUBY_PLATFORM || find_library("X11", "XOpenDisplay",
"/usr/X11/lib", "/usr/X11R6/lib", "/usr/openwin/lib")) &&
find_tcl(tcllib) &&
find_tk(tklib)
diff --git a/ext/tcltklib/tcltklib.c b/ext/tcltklib/tcltklib.c
index e846e1f0386..93f7745f283 100644
--- a/ext/tcltklib/tcltklib.c
+++ b/ext/tcltklib/tcltklib.c
@@ -34,6 +34,7 @@ static VALUE ip_invoke_real _((int, VALUE*, VALUE));
/* from tkAppInit.c */
+#if !defined __MINGW32__
/*
* The following variable is a special hack that is needed in order for
* Sun shared libraries to be used for Tcl.
@@ -41,6 +42,7 @@ static VALUE ip_invoke_real _((int, VALUE*, VALUE));
extern int matherr();
int *tclDummyMathPtr = (int *) matherr;
+#endif
/*---- module TclTkLib ----*/
@@ -487,8 +489,6 @@ _macinit()
void
Init_tcltklib()
{
- extern VALUE rb_argv0; /* the argv[0] */
-
VALUE lib = rb_define_module("TclTkLib");
VALUE ip = rb_define_class("TclTkIp", rb_cObject);