summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
Diffstat (limited to 'ext')
-rw-r--r--ext/extmk.rb.in10
-rw-r--r--ext/nkf/nkf.c2
-rw-r--r--ext/socket/extconf.rb3
-rw-r--r--ext/socket/socket.c5
4 files changed, 16 insertions, 4 deletions
diff --git a/ext/extmk.rb.in b/ext/extmk.rb.in
index d7f58d7b3b..7f4087472f 100644
--- a/ext/extmk.rb.in
+++ b/ext/extmk.rb.in
@@ -37,7 +37,13 @@ if $topdir !~ "^/"
$topdir = Dir.pwd
Dir.chdir save
end
-$dots = if "@INSTALL@" =~ /^\// then "" else "#{$topdir}/ext/" end
+
+## drive letter
+if PLATFORM == "i386-os2_emx" then
+ $dots = ""
+else
+ $dots = if "@INSTALL@" =~ /^\// then "" else "#{$topdir}/ext/" end
+end
if File.exist?("config.cache") then
f = open("config.cache", "r")
@@ -75,7 +81,7 @@ end
LINK = "@CC@ -o conftest -I#$topdir -I#$top_srcdir -I@includedir@ #{CFLAGS} %s @LDFLAGS@ %s conftest.c @LIBS@ %s"
CPP = "@CPP@ @CPPFLAGS@ -I#$topdir -I#$top_srcdir -I@includedir@ #{CFLAGS} %s conftest.c"
-if /cygwin|mswin32|djgpp|mingw32|m68k-human/i =~ PLATFORM
+if /cygwin|mswin32|djgpp|mingw32|m68k-human|i386-os2_emx/i =~ PLATFORM
$null = open("nul", "w")
else
$null = open("/dev/null", "w")
diff --git a/ext/nkf/nkf.c b/ext/nkf/nkf.c
index 2442973f2f..4c46948538 100644
--- a/ext/nkf/nkf.c
+++ b/ext/nkf/nkf.c
@@ -78,7 +78,7 @@ rb_nkf_kconv(obj, opt, src)
}
kanji_convert(NULL);
- output_ctr--;
+ if (output_ctr > 0) output_ctr--;
if (output[output_ctr] == '\0') {
/*
printf("([%c][%d])\n", output[output_ctr], output_ctr);
diff --git a/ext/socket/extconf.rb b/ext/socket/extconf.rb
index 449d5a2785..5b3986735c 100644
--- a/ext/socket/extconf.rb
+++ b/ext/socket/extconf.rb
@@ -9,6 +9,9 @@ when /cygwin32/
when /beos/
test_func = "socket"
have_library("net", "socket")
+when /i386-os2_emx/
+ test_func = "socket"
+ have_library("socket", "socket")
else
test_func = "socket"
have_library("nsl", "t_open")
diff --git a/ext/socket/socket.c b/ext/socket/socket.c
index fcf8f18c1b..b7502e2915 100644
--- a/ext/socket/socket.c
+++ b/ext/socket/socket.c
@@ -19,6 +19,9 @@
#include <netdb.h>
#endif
#include <errno.h>
+#ifdef __EMX__
+#undef HAVE_SYS_UN_H
+#endif
#ifdef HAVE_SYS_UN_H
#include <sys/un.h>
#endif
@@ -1244,7 +1247,7 @@ static VALUE
sock_s_socketpair(class, domain, type, protocol)
VALUE class, domain, type, protocol;
{
-#if !defined(NT) && !defined(__BEOS__)
+#if !defined(NT) && !defined(__BEOS__) && !defined(__EMX__)
int d, t, sp[2];
setup_domain_and_type(domain, &d, type, &t);