]> sjero.net Git - wget/commitdiff
[svn] Check for a recent gcc version before using the statement-as-expression
authorhniksic <devnull@localhost>
Mon, 30 May 2005 18:44:20 +0000 (11:44 -0700)
committerhniksic <devnull@localhost>
Mon, 30 May 2005 18:44:20 +0000 (11:44 -0700)
extension.

src/ChangeLog
src/url.c

index 212f28007bf3ce9ec5a55d0b2a4d9b05131de53a..023fec4977f4c702139e5b4eabaced622c0e9932 100644 (file)
@@ -1,3 +1,8 @@
+2005-05-30  Hrvoje Niksic  <hniksic@xemacs.org>
+
+       * url.c (strpbrk_or_eos): Check for a recent GCC version before
+       using the statement-as-expression extension.
+
 2005-05-30  Hrvoje Niksic  <hniksic@xemacs.org>
 
        * http.c (gethttp): Don't attempt to "skip short body" if we're
index 8cbb8923e2fed5898ca42967eefe0f479dcf671e..3db7c2fb20e584ba16fbd6cfff88aa5ea57ec3d5 100644 (file)
--- a/src/url.c
+++ b/src/url.c
@@ -584,7 +584,7 @@ static void split_path PARAMS ((const char *, char **, char **));
    help because the check for literal accept is in the
    preprocessor.)  */
 
-#ifdef __GNUC__
+#if defined(__GNUC__) && __GNUC__ >= 3
 
 #define strpbrk_or_eos(s, accept) ({           \
   char *SOE_p = strpbrk (s, accept);           \
@@ -593,7 +593,7 @@ static void split_path PARAMS ((const char *, char **, char **));
   SOE_p;                                       \
 })
 
-#else  /* not __GNUC__ */
+#else  /* not __GNUC__ or old gcc */
 
 static inline char *
 strpbrk_or_eos (const char *s, const char *accept)
@@ -603,7 +603,7 @@ strpbrk_or_eos (const char *s, const char *accept)
     p = strchr (s, '\0');
   return p;
 }
-#endif /* not __GNUC__ */
+#endif /* not __GNUC__ or old gcc */
 
 /* Turn STR into lowercase; return non-zero if a character was
    actually changed. */