diff --git a/ChangeLog b/ChangeLog index 7b497826ae..45b43f9504 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Sat Aug 7 09:47:06 2010 Masaki Suketa + + * ext/win32ole/win32ole.c: fix checking version of GCC. + Sat Aug 7 09:31:48 2010 Tanaka Akira * ext/pathname/pathname.c (Init_pathname): fix number of arguments for diff --git a/ext/win32ole/win32ole.c b/ext/win32ole/win32ole.c index a6db6a03b2..70deed3748 100644 --- a/ext/win32ole/win32ole.c +++ b/ext/win32ole/win32ole.c @@ -19,7 +19,12 @@ #include "ruby/st.h" #include "ruby/encoding.h" -#if (defined(__GNUC__)) && (__GNUC__ <= 3) && (__GNUC_MINOR__ <= 4) && (__GNUC_PATCHLEVEL__ <= 4) +#define GNUC_OLDER_3_4_4 \ + ((__GNUC__ < 3) || \ + ((__GNUC__ <= 3) && (__GNUC_MINOR__ < 4)) || \ + ((__GNUC__ <= 3) && (__GNUC_MINOR__ <= 4) && (__GNUC_PATCHLEVEL__ <= 4))) + +#if (defined(__GNUC__)) && (GNUC_OLDER_3_4_4) #ifndef NONAMELESSUNION #define NONAMELESSUNION 1 #endif @@ -51,13 +56,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(__GNUC__)) && (__GNUC__ <= 3) && (__GNUC_MINOR__ <= 4) && (__GNUC_PATCHLEVEL__ <= 4) +#if (defined(__GNUC__)) && (GNUC_OLDER_3_4_4) #define V_UNION1(X, Y) ((X)->u.Y) #else #define V_UNION1(X, Y) ((X)->Y) #endif -#if (defined(__GNUC__)) && (__GNUC__ <= 3) && (__GNUC_MINOR__ <= 4) && (__GNUC_PATCHLEVEL__ <= 4) +#if (defined(__GNUC__)) && (GNUC_OLDER_3_4_4) #undef V_UNION #define V_UNION(X,Y) ((X)->n1.n2.n3.Y)