diff options
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | lib/mkmf.rb | 15 | ||||
-rw-r--r-- | version.h | 6 |
3 files changed, 16 insertions, 9 deletions
@@ -1,3 +1,7 @@ +Sun Nov 18 09:09:48 2007 Nobuyoshi Nakada <nobu@ruby-lang.org> + + * lib/mkmf.rb (String#tr_cpp): make preprocessor identifiers. + Sat Nov 17 13:58:11 2007 Masaki Suketa <masaki.suketa@nifty.ne.jp> * ext/win32ole/win32ole.c (ole_invoke): bug fix. [ruby-talk:279100] diff --git a/lib/mkmf.rb b/lib/mkmf.rb index 5e981fba72..b90ee9a487 100644 --- a/lib/mkmf.rb +++ b/lib/mkmf.rb @@ -131,6 +131,9 @@ class String def quote /\s/ =~ self ? "\"#{self}\"" : self end + def tr_cpp + strip.upcase.tr_s("^A-Z0-9_", "_") + end end class Array def quote @@ -654,7 +657,7 @@ end def have_func(func, headers = nil, &b) checking_for checking_message("#{func}()", headers) do if try_func(func, $libs, headers, &b) - $defs.push(format("-DHAVE_%s", func.upcase)) + $defs.push(format("-DHAVE_%s", func.tr_cpp)) true else false @@ -673,7 +676,7 @@ end def have_var(var, headers = nil, &b) checking_for checking_message(var, headers) do if try_var(var, headers, &b) - $defs.push(format("-DHAVE_%s", var.upcase)) + $defs.push(format("-DHAVE_%s", var.tr_cpp)) true else false @@ -746,7 +749,7 @@ def have_struct_member(type, member, headers = nil, &b) int main() { return 0; } int s = (char *)&((#{type}*)0)->#{member} - (char *)0; SRC - $defs.push(format("-DHAVE_ST_%s", member.upcase)) + $defs.push(format("-DHAVE_ST_%s", member.tr_cpp)) true else false @@ -762,7 +765,7 @@ def try_type(type, headers = nil, opt = "", &b) typedef #{type} conftest_type; int conftestval[sizeof(conftest_type)?1:-1]; SRC - $defs.push(format("-DHAVE_TYPE_%s", type.strip.upcase.tr_s("^A-Z0-9_", "_"))) + $defs.push(format("-DHAVE_TYPE_%s", type.tr_cpp)) true else false @@ -817,7 +820,7 @@ def try_const(const, headers = nil, opt = "", &b) typedef #{type || 'int'} conftest_type; conftest_type conftestval = #{type ? '' : '(int)'}#{const}; SRC - $defs.push(format("-DHAVE_CONST_%s", const.strip.upcase.tr_s("^A-Z0-9_", "_"))) + $defs.push(format("-DHAVE_CONST_%s", const.tr_cpp)) true else false @@ -864,7 +867,7 @@ def check_sizeof(type, headers = nil, &b) end checking_for checking_message("size of #{type}", headers), fmt do if size = try_constant(expr, headers, &b) - $defs.push(format("-DSIZEOF_%s=%d", type.upcase.tr_s("^A-Z0-9_", "_"), size)) + $defs.push(format("-DSIZEOF_%s=%d", type.tr_cpp, size)) size end end @@ -1,7 +1,7 @@ #define RUBY_VERSION "1.8.6" -#define RUBY_RELEASE_DATE "2007-11-17" +#define RUBY_RELEASE_DATE "2007-11-18" #define RUBY_VERSION_CODE 186 -#define RUBY_RELEASE_CODE 20071117 +#define RUBY_RELEASE_CODE 20071118 #define RUBY_PATCHLEVEL 5000 #define RUBY_VERSION_MAJOR 1 @@ -9,7 +9,7 @@ #define RUBY_VERSION_TEENY 6 #define RUBY_RELEASE_YEAR 2007 #define RUBY_RELEASE_MONTH 11 -#define RUBY_RELEASE_DAY 17 +#define RUBY_RELEASE_DAY 18 #ifdef RUBY_EXTERN RUBY_EXTERN const char ruby_version[]; |