X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2Fregex.h;h=e8748e195be85b981db37885101fe09481ceb329;hb=c5ce79f4c514b37b5756e85530112d778cff302a;hp=b1ae24906c464882cb1b4f0926347b52ad9504a5;hpb=8335a4d6c7b4448cd0bcb6d0bebf1d456bcfdb17;p=gnulib.git diff --git a/lib/regex.h b/lib/regex.h index b1ae24906..e8748e195 100644 --- a/lib/regex.h +++ b/lib/regex.h @@ -37,12 +37,6 @@ extern "C" { # define __USE_GNU_REGEX 1 #endif -#ifdef __VMS -/* VMS doesn't have `size_t' in , even though POSIX says it - should be there. */ -# include -#endif - #ifdef _REGEX_LARGE_OFFSETS /* Use types and values that are wide enough to represent signed and @@ -322,7 +316,14 @@ extern reg_syntax_t re_syntax_options; # ifdef RE_DUP_MAX # undef RE_DUP_MAX # endif -/* If sizeof(int) == 2, then ((1 << 15) - 1) overflows. */ + +/* RE_DUP_MAX is 2**15 - 1 because an earlier implementation stored + the counter as a 2-byte signed integer. This is no longer true, so + RE_DUP_MAX could be increased to (INT_MAX / 10 - 1), or to + ((SIZE_MAX - 2) / 10 - 1) if _REGEX_LARGE_OFFSETS is defined. + However, there would be a huge performance problem if someone + actually used a pattern like a\{214748363\}, so RE_DUP_MAX retains + its historical value. */ # define RE_DUP_MAX (0x7fff) #endif /* defined __USE_GNU_REGEX */ @@ -634,9 +635,10 @@ extern int re_exec (const char *); # endif # endif #endif -/* gcc 3.1 and up support the [restrict] syntax, but g++ doesn't. */ +/* gcc 3.1 and up support the [restrict] syntax. */ #ifndef __restrict_arr -# if (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1)) && !defined __cplusplus +# if (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1)) \ + && !defined __GNUG__ # define __restrict_arr __restrict # else # define __restrict_arr