From: Bruno Haible Date: Mon, 18 Apr 2005 09:40:01 +0000 (+0000) Subject: Tweaks for use of gcc-4.0 on MacOS X. X-Git-Tag: v0.15~553 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8a43734139e55474e85fd784101e565b6bbd4bb9;p=thirdparty%2Fgettext.git Tweaks for use of gcc-4.0 on MacOS X. --- diff --git a/gettext-runtime/intl/ChangeLog b/gettext-runtime/intl/ChangeLog index f511cb8b5..ea7b44b22 100644 --- a/gettext-runtime/intl/ChangeLog +++ b/gettext-runtime/intl/ChangeLog @@ -1,3 +1,11 @@ +2005-04-18 Bruno Haible + + * libgnuintl.h.in (_INTL_REDIRECT_ASM): Test for __APPLE_CC__ > 1. + Needed because gcc-4.0 defines __APPLE_CC__ and implements + __USER_LABEL_PREFIX__ correctly. + * plural-exp.c (GERMANIC_PLURAL): Test for __APPLE_CC > 1. + Needed because gcc-4.0 defines __APPLE_CC__. + 2005-04-11 Bruno Haible * gettext-0.14.4 released. diff --git a/gettext-runtime/intl/libgnuintl.h.in b/gettext-runtime/intl/libgnuintl.h.in index afc21dad4..24ecbb373 100644 --- a/gettext-runtime/intl/libgnuintl.h.in +++ b/gettext-runtime/intl/libgnuintl.h.in @@ -83,7 +83,7 @@ extern "C" { If he doesn't, we choose the method. A third possible method is _INTL_REDIRECT_ASM, supported only by GCC. */ #if !(defined _INTL_REDIRECT_INLINE || defined _INTL_REDIRECT_MACROS) -# if __GNUC__ >= 2 && !defined __APPLE_CC__ && !defined __MINGW32__ && !(__GNUC__ == 2 && defined _AIX) && (defined __STDC__ || defined __cplusplus) +# if __GNUC__ >= 2 && !(__APPLE_CC__ > 1) && !defined __MINGW32__ && !(__GNUC__ == 2 && defined _AIX) && (defined __STDC__ || defined __cplusplus) # define _INTL_REDIRECT_ASM # else # ifdef __cplusplus diff --git a/gettext-runtime/intl/plural-exp.c b/gettext-runtime/intl/plural-exp.c index 8c04e6426..bff626f2f 100644 --- a/gettext-runtime/intl/plural-exp.c +++ b/gettext-runtime/intl/plural-exp.c @@ -27,7 +27,7 @@ #include "plural-exp.h" -#if (defined __GNUC__ && !defined __APPLE_CC__) \ +#if (defined __GNUC__ && !(__APPLE_CC__ > 1)) \ || (defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L) /* These structs are the constant expression for the germanic plural diff --git a/gettext-tools/libgrep/ChangeLog b/gettext-tools/libgrep/ChangeLog index 991fc1b89..924fab2d4 100644 --- a/gettext-tools/libgrep/ChangeLog +++ b/gettext-tools/libgrep/ChangeLog @@ -1,3 +1,8 @@ +2005-04-18 Bruno Haible + + * dfa.c (update_mb_len_index): Change argument type to 'const char *'. + Avoids gcc-4.0 warnings. + 2005-04-11 Bruno Haible * gettext-0.14.4 released. diff --git a/gettext-tools/libgrep/dfa.c b/gettext-tools/libgrep/dfa.c index 536f0aafa..e08e799e3 100644 --- a/gettext-tools/libgrep/dfa.c +++ b/gettext-tools/libgrep/dfa.c @@ -343,7 +343,7 @@ static unsigned char const *buf_end; /* refference to end in dfaexec(). */ /* This function update cur_mb_len, and cur_mb_index. p points current lexptr, len is the remaining buffer length. */ static void -update_mb_len_index (unsigned char const *p, int len) +update_mb_len_index (char const *p, int len) { /* If last character is a part of a multibyte character, we update cur_mb_index. */ diff --git a/gettext-tools/src/ChangeLog b/gettext-tools/src/ChangeLog index 1710b89fd..9a75d92da 100644 --- a/gettext-tools/src/ChangeLog +++ b/gettext-tools/src/ChangeLog @@ -1,3 +1,12 @@ +2005-04-18 Bruno Haible + + * po-lex.h (po_gram_error, po_gram_error_at_line): Test for + __APPLE_CC__ > 1. Needed because gcc-4.0 defines __APPLE_CC__ and + implements __VA_ARGS__ correctly. + * po-lex.c (po_gram_error, po_gram_error_at_line): Likewise. + * read-stringtable.c (phase2_getc): Optimize UTF-8 code. Avoids + gcc-4.0 warnings. + 2005-04-11 Bruno Haible * gettext-0.14.4 released. diff --git a/gettext-tools/src/po-lex.c b/gettext-tools/src/po-lex.c index 1da40f908..9dadf716f 100644 --- a/gettext-tools/src/po-lex.c +++ b/gettext-tools/src/po-lex.c @@ -72,7 +72,7 @@ int gram_pos_column; #if !(__STDC__ && \ ((defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L && !defined __DECC) \ - || (defined __GNUC__ && __GNUC__ >= 2 && !defined __APPLE_CC__))) + || (defined __GNUC__ && __GNUC__ >= 2 && !(__APPLE_CC__ > 1)))) /* CAUTION: If you change this function, you must also make identical changes to the macro of the same name in src/po-lex.h */ diff --git a/gettext-tools/src/po-lex.h b/gettext-tools/src/po-lex.h index 10533e0ab..81db87b76 100644 --- a/gettext-tools/src/po-lex.h +++ b/gettext-tools/src/po-lex.h @@ -109,7 +109,7 @@ extern void po_lex_pass_obsolete_entries (bool flag); } while (0) /* GCC is also smart enough to allow optimizations like this. */ -#elif __STDC__ && defined __GNUC__ && __GNUC__ >= 2 && !defined __APPLE_CC__ +#elif __STDC__ && defined __GNUC__ && __GNUC__ >= 2 && !(__APPLE_CC__ > 1) /* CAUTION: If you change this macro, you must also make identical changes to the function of the same name in src/po-lex.c */ diff --git a/gettext-tools/src/read-stringtable.c b/gettext-tools/src/read-stringtable.c index b96d036b7..316dc3909 100644 --- a/gettext-tools/src/read-stringtable.c +++ b/gettext-tools/src/read-stringtable.c @@ -229,52 +229,46 @@ phase2_getc () return UEOF; buf[1] = c; count = 2; - } - - if (buf[0] >= 0xe0 - && ((buf[1] ^ 0x80) < 0x40)) - { - c = phase1_getc (); - if (c == EOF) - return UEOF; - buf[2] = c; - count = 3; - } - if (buf[0] >= 0xf0 - && ((buf[1] ^ 0x80) < 0x40) - && ((buf[2] ^ 0x80) < 0x40)) - { - c = phase1_getc (); - if (c == EOF) - return UEOF; - buf[3] = c; - count = 4; - } - - if (buf[0] >= 0xf8 - && ((buf[1] ^ 0x80) < 0x40) - && ((buf[2] ^ 0x80) < 0x40) - && ((buf[3] ^ 0x80) < 0x40)) - { - c = phase1_getc (); - if (c == EOF) - return UEOF; - buf[4] = c; - count = 5; - } - - if (buf[0] >= 0xfc - && ((buf[1] ^ 0x80) < 0x40) - && ((buf[2] ^ 0x80) < 0x40) - && ((buf[3] ^ 0x80) < 0x40) - && ((buf[4] ^ 0x80) < 0x40)) - { - c = phase1_getc (); - if (c == EOF) - return UEOF; - buf[5] = c; - count = 6; + if (buf[0] >= 0xe0 + && ((buf[1] ^ 0x80) < 0x40)) + { + c = phase1_getc (); + if (c == EOF) + return UEOF; + buf[2] = c; + count = 3; + + if (buf[0] >= 0xf0 + && ((buf[2] ^ 0x80) < 0x40)) + { + c = phase1_getc (); + if (c == EOF) + return UEOF; + buf[3] = c; + count = 4; + + if (buf[0] >= 0xf8 + && ((buf[3] ^ 0x80) < 0x40)) + { + c = phase1_getc (); + if (c == EOF) + return UEOF; + buf[4] = c; + count = 5; + + if (buf[0] >= 0xfc + && ((buf[4] ^ 0x80) < 0x40)) + { + c = phase1_getc (); + if (c == EOF) + return UEOF; + buf[5] = c; + count = 6; + } + } + } + } } u8_mbtouc (&uc, buf, count);