ruby-changes:16931
From: yugui <ko1@a...>
Date: Mon, 9 Aug 2010 00:04:10 +0900 (JST)
Subject: [ruby-changes:16931] Ruby:r28927 (ruby_1_9_2): merges r28835 from trunk into ruby_1_9_2.
yugui 2010-08-09 00:01:21 +0900 (Mon, 09 Aug 2010) New Revision: 28927 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=28927 Log: merges r28835 from trunk into ruby_1_9_2. -- * ext/win32ole/win32ole.c: NONAMELESSUNION defined only if gcc version is older than 3.4.4. [ruby-core:31567] [Bug #3637] * ext/win32ole/extconf.rb: ditto. Modified files: branches/ruby_1_9_2/ChangeLog branches/ruby_1_9_2/ext/win32ole/extconf.rb branches/ruby_1_9_2/ext/win32ole/win32ole.c Index: ruby_1_9_2/ChangeLog =================================================================== --- ruby_1_9_2/ChangeLog (revision 28926) +++ ruby_1_9_2/ChangeLog (revision 28927) @@ -1,3 +1,9 @@ +Mon Aug 2 21:16:03 2010 Masaki Suketa <masaki.suketa@n...> + + * ext/win32ole/win32ole.c: NONAMELESSUNION defined only if gcc + version is older than 3.4.4. [ruby-core:31567] [Bug #3637] + * ext/win32ole/extconf.rb: ditto. + Fri Jul 30 07:48:04 2010 Hidetoshi NAGAI <nagai@a...> * ext/tk/extconf.rb: use TK_XINCLUDES on tkConfig.sh when not empty, Index: ruby_1_9_2/ext/win32ole/win32ole.c =================================================================== --- ruby_1_9_2/ext/win32ole/win32ole.c (revision 28926) +++ ruby_1_9_2/ext/win32ole/win32ole.c (revision 28927) @@ -18,7 +18,15 @@ #include "ruby/ruby.h" #include "ruby/st.h" #include "ruby/encoding.h" + +#if (defined(__GNUC__)) && (__GNUC__ <= 3) && (__GNUC_MINOR__ <= 4) && (__GNUC_PATCHLEVEL__ <= 4) +#ifndef NONAMELESSUNION +#define NONAMELESSUNION 1 +#endif +#endif + #include <ctype.h> + #include <windows.h> #include <ocidl.h> #include <olectl.h> @@ -43,13 +51,13 @@ #define DOUTI(x) fprintf(stderr, "[%ld]:" #x "=%d\n",__LINE__,x) #define DOUTD(x) fprintf(stderr, "[%d]:" #x "=%f\n",__LINE__,x) -#if defined NONAMELESSUNION && __GNUC__ +#if (defined(__GNUC__)) && (__GNUC__ <= 3) && (__GNUC_MINOR__ <= 4) && (__GNUC_PATCHLEVEL__ <= 4) #define V_UNION1(X, Y) ((X)->u.Y) #else #define V_UNION1(X, Y) ((X)->Y) #endif -#if defined NONAMELESSUNION && __GNUC__ +#if (defined(__GNUC__)) && (__GNUC__ <= 3) && (__GNUC_MINOR__ <= 4) && (__GNUC_PATCHLEVEL__ <= 4) #undef V_UNION #define V_UNION(X,Y) ((X)->n1.n2.n3.Y) Index: ruby_1_9_2/ext/win32ole/extconf.rb =================================================================== --- ruby_1_9_2/ext/win32ole/extconf.rb (revision 28926) +++ ruby_1_9_2/ext/win32ole/extconf.rb (revision 28927) @@ -38,7 +38,5 @@ case RUBY_PLATFORM when /mswin/ $CFLAGS += ' /W3' -when /cygwin/, /mingw/ - $defs << '-DNONAMELESSUNION' end create_win32ole_makefile -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/