diff options
author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-08-07 15:44:27 +0000 |
---|---|---|
committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-08-07 15:44:27 +0000 |
commit | bb0ef922db4682dc57f5150c065b1a3fe2fc1f02 (patch) | |
tree | 11d797506a212d517aea591bb8fd27a930598782 /include/ruby | |
parent | 06efb04e8e2dd45c96b8f245d601f1d3c38486de (diff) | |
download | ruby-bb0ef922db4682dc57f5150c065b1a3fe2fc1f02.tar.gz |
* 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.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28907 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'include/ruby')
-rw-r--r-- | include/ruby/missing.h | 8 | ||||
-rw-r--r-- | include/ruby/ruby.h | 4 | ||||
-rw-r--r-- | include/ruby/subst.h | 15 |
3 files changed, 19 insertions, 8 deletions
diff --git a/include/ruby/missing.h b/include/ruby/missing.h index d884d382ff..abbd2bf870 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 83f68ec083..1b0b111d5e 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 0000000000..2287baeafe --- /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 |