From 384ece6125c1d7f941c9afdc5420c1e0f8c5eb3d Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Mon, 8 Apr 2002 18:56:39 +0000 Subject: (__restrict_arr): Define for GCC 3.1 and up. --- lib/posix/regex.h | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'lib/posix/regex.h') diff --git a/lib/posix/regex.h b/lib/posix/regex.h index 1e2efd9..29f8e32 100644 --- a/lib/posix/regex.h +++ b/lib/posix/regex.h @@ -1,6 +1,6 @@ /* Definitions for data structures and routines for the regular expression library, version 0.12. - Copyright (C) 1985,1989-1993,1995-1998, 2000 Free Software Foundation, Inc. + Copyright (C) 1985,1989-93,1995-98,2000,2001 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -526,10 +526,14 @@ extern int re_exec _RE_ARGS ((const char *)); # endif # endif #endif -/* For now unconditionally define __restrict_arr to expand to nothing. - Ideally we would have a test for the compiler which allows defining - it to restrict. */ -#define __restrict_arr +/* gcc 3.1 and up support the [restrict] syntax. */ +#ifndef __restrict_arr +# if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1) +# define __restrict_arr __restrict +# else +# define __restrict_arr +# endif +#endif /* POSIX compatibility. */ extern int regcomp _RE_ARGS ((regex_t *__restrict __preg, -- cgit v1.2.1