summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog9
-rw-r--r--include/ruby/missing.h8
-rw-r--r--include/ruby/ruby.h4
-rw-r--r--include/ruby/subst.h15
4 files changed, 28 insertions, 8 deletions
diff --git a/ChangeLog b/ChangeLog
index 6eee5944011..27f784eeb63 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+Sun Aug 8 00:41:42 2010 Tanaka Akira <akr@fsij.org>
+
+ * include/ruby/subst.h: new file for substitute standard functions..
+
+ * include/ruby/missing.h: don't substitute "close", etc. here.
+
+ * include/ruby/ruby.h: include ruby/subst.h at last.
+ This prevents substituting "close" in unitstd.h.
+
Sat Aug 7 19:51:10 2010 Tanaka Akira <akr@fsij.org>
* test/ruby/envutil.rb (EnvUtil.invoke_ruby): merge stdout and stderr
diff --git a/include/ruby/missing.h b/include/ruby/missing.h
index d884d382fff..abbd2bf870f 100644
--- a/include/ruby/missing.h
+++ b/include/ruby/missing.h
@@ -191,14 +191,6 @@ RUBY_EXTERN int ruby_getpeername(int, struct sockaddr *, socklen_t *);
RUBY_EXTERN int ruby_getsockname(int, struct sockaddr *, socklen_t *);
RUBY_EXTERN int ruby_shutdown(int, int);
RUBY_EXTERN int ruby_close(int);
-#undef getpeername
-#define getpeername ruby_getpeername
-#undef getsockname
-#define getsockname ruby_getsockname
-#undef shutdown
-#define shutdown ruby_shutdown
-#undef close
-#define close ruby_close
#endif
#if defined __GNUC__ && __GNUC__ >= 4
diff --git a/include/ruby/ruby.h b/include/ruby/ruby.h
index 83f68ec083f..1b0b111d5e0 100644
--- a/include/ruby/ruby.h
+++ b/include/ruby/ruby.h
@@ -1442,6 +1442,10 @@ int ruby_vsnprintf(char *str, size_t n, char const *fmt, va_list ap);
#pragma GCC visibility pop
#endif
+#ifndef RUBY_DONT_SUBST
+#include "ruby/subst.h"
+#endif
+
#if defined(__cplusplus)
#if 0
{ /* satisfy cc-mode */
diff --git a/include/ruby/subst.h b/include/ruby/subst.h
new file mode 100644
index 00000000000..2287baeafe2
--- /dev/null
+++ b/include/ruby/subst.h
@@ -0,0 +1,15 @@
+#ifndef RUBY_SUBST_H
+#define RUBY_SUBST_H 1
+
+#ifdef BROKEN_CLOSE
+#undef getpeername
+#define getpeername ruby_getpeername
+#undef getsockname
+#define getsockname ruby_getsockname
+#undef shutdown
+#define shutdown ruby_shutdown
+#undef close
+#define close ruby_close
+#endif
+
+#endif