From: Derek R. Price Date: Thu, 15 Sep 2005 19:14:23 +0000 (+0000) Subject: * regex_internal.h: Blank `pure' for GNUC < 3. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=594190cb0d9ea2cfcf9689f4e1abaf21dead8f87;p=pspp * regex_internal.h: Blank `pure' for GNUC < 3. * regex_internal.c: Ditto, using this... (__GNUC_PREREQ): ...new macro. * regcomp.c, regexec.c: Blank `always_inline' for GNUC < 3.1 using... (__GNUC_PREREQ): ...this new macro. --- diff --git a/lib/ChangeLog b/lib/ChangeLog index 493218c521..8042262618 100644 --- a/lib/ChangeLog +++ b/lib/ChangeLog @@ -1,5 +1,11 @@ 2005-09-15 Derek Price + * regex_internal.h: Blank `pure' for GNUC < 3. + * regex_internal.c: Ditto, using this... + (__GNUC_PREREQ): ...new macro. + * regcomp.c, regexec.c: Blank `always_inline' for GNUC < 3.1 using... + (__GNUC_PREREQ): ...this new macro. + * strstr.h: Include string.h. Define strstr as a macro here. 2005-09-13 Derek Price diff --git a/lib/regcomp.c b/lib/regcomp.c index 279b20c4c8..847f385eec 100644 --- a/lib/regcomp.c +++ b/lib/regcomp.c @@ -17,6 +17,19 @@ with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +#ifndef __GNUC_PREREQ +# if defined __GNUC__ && defined __GNUC_MINOR__ +# define __GNUC_PREREQ(maj, min) \ + ((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min)) +# else +# define __GNUC_PREREQ(maj, min) 0 +# endif +#endif + +#if !__GNUC_PREREQ (3, 1) +# define always_inline +#endif + static reg_errcode_t re_compile_internal (regex_t *preg, const char * pattern, Idx length, reg_syntax_t syntax); static void re_compile_fastmap_iter (regex_t *bufp, diff --git a/lib/regex_internal.c b/lib/regex_internal.c index ad618cf661..349ec52bcd 100644 --- a/lib/regex_internal.c +++ b/lib/regex_internal.c @@ -17,6 +17,19 @@ with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +#ifndef __GNUC_PREREQ +# if defined __GNUC__ && defined __GNUC_MINOR__ +# define __GNUC_PREREQ(maj, min) \ + ((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min)) +# else +# define __GNUC_PREREQ(maj, min) 0 +# endif +#endif + +#if !__GNUC_PREREQ (3, 0) +# define pure +#endif + static void re_string_construct_common (const char *str, Idx len, re_string_t *pstr, REG_TRANSLATE_TYPE trans, bool icase, diff --git a/lib/regex_internal.h b/lib/regex_internal.h index 02087592bc..c34271022a 100644 --- a/lib/regex_internal.h +++ b/lib/regex_internal.h @@ -89,6 +89,7 @@ #else # define BE(expr, val) (expr) # define inline +# define pure #endif /* Number of single byte character. */ diff --git a/lib/regexec.c b/lib/regexec.c index a85077c932..9abdd77384 100644 --- a/lib/regexec.c +++ b/lib/regexec.c @@ -17,6 +17,19 @@ with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +#ifndef __GNUC_PREREQ +# if defined __GNUC__ && defined __GNUC_MINOR__ +# define __GNUC_PREREQ(maj, min) \ + ((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min)) +# else +# define __GNUC_PREREQ(maj, min) 0 +# endif +#endif + +#if !__GNUC_PREREQ (3, 1) +# define always_inline +#endif + static reg_errcode_t match_ctx_init (re_match_context_t *cache, int eflags, Idx n) internal_function; static void match_ctx_clean (re_match_context_t *mctx) internal_function;