From: Bruno Haible Date: Mon, 13 Jun 2011 15:49:56 +0000 (+0200) Subject: Avoid compilation error on Solaris 7 with cc. X-Git-Tag: v0.18.2~71 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a7f869070589ccec34dcc7aceb503d210bb03847;p=thirdparty%2Fgettext.git Avoid compilation error on Solaris 7 with cc. --- diff --git a/gettext-tools/src/ChangeLog b/gettext-tools/src/ChangeLog index e02c44fa3..7ede00670 100644 --- a/gettext-tools/src/ChangeLog +++ b/gettext-tools/src/ChangeLog @@ -1,3 +1,8 @@ +2011-06-13 Bruno Haible + + Avoid compilation error on Solaris 7 with cc. + * msgl-fsearch.c (SHORT_MSG_MAX): Define more directly with SunPRO C. + 2011-06-04 Bruno Haible Avoid link error when linking statically on AIX 7. diff --git a/gettext-tools/src/msgl-fsearch.c b/gettext-tools/src/msgl-fsearch.c index d5cf71b65..4cacf398c 100644 --- a/gettext-tools/src/msgl-fsearch.c +++ b/gettext-tools/src/msgl-fsearch.c @@ -1,5 +1,5 @@ /* Fast fuzzy searching among messages. - Copyright (C) 2006, 2008 Free Software Foundation, Inc. + Copyright (C) 2006, 2008, 2011 Free Software Foundation, Inc. Written by Bruno Haible , 2006. This program is free software: you can redistribute it and/or modify @@ -182,7 +182,12 @@ add_index (index_list_ty list, index_ty idx) limit the search to lengths l' in the range l / (2 / FUZZY_THRESHOLD - 1) <= l' <= l * (2 / FUZZY_THRESHOLD - 1) Thus we need the list of the short strings up to length: */ -#define SHORT_MSG_MAX (int) (SHORT_STRING_MAX_BYTES * (2 / FUZZY_THRESHOLD - 1)) +#if !defined __SUNPRO_C +# define SHORT_MSG_MAX (int) (SHORT_STRING_MAX_BYTES * (2 / FUZZY_THRESHOLD - 1)) +#else +/* Sun C on Solaris 8 cannot compute this constant expression. */ +# define SHORT_MSG_MAX 28 +#endif /* A fuzzy index contains a hash table mapping all n-grams to their occurrences list. */