X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;ds=inline;f=lib%2Fregex_internal.h;h=859832f513f5dabb44d2856a006d800b9b061105;hb=e9b552cf52b6200633c335b19a2f703f72f8683a;hp=b2c44fe18610363f34d7d794a582522fb9e96da2;hpb=8335a4d6c7b4448cd0bcb6d0bebf1d456bcfdb17;p=gnulib.git diff --git a/lib/regex_internal.h b/lib/regex_internal.h index b2c44fe18..859832f51 100644 --- a/lib/regex_internal.h +++ b/lib/regex_internal.h @@ -1,5 +1,6 @@ /* Extended regular expression matching and search library. - Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. + Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 + Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Isamu Hasegawa . @@ -27,36 +28,28 @@ #include #include -#ifndef _LIBC -# include "strcase.h" -#endif - -#if defined HAVE_LANGINFO_H || defined HAVE_LANGINFO_CODESET || defined _LIBC +#ifdef _LIBC # include +#else +# include "localcharset.h" #endif #if defined HAVE_LOCALE_H || defined _LIBC # include #endif -#if defined HAVE_WCHAR_H || defined _LIBC -# include -#endif /* HAVE_WCHAR_H || _LIBC */ -#if defined HAVE_WCTYPE_H || defined _LIBC -# include -#endif /* HAVE_WCTYPE_H || _LIBC */ -#if defined HAVE_STDINT_H || defined _LIBC -# include -#endif /* HAVE_STDINT_H || _LIBC */ + +#include +#include +#include #if defined _LIBC # include #else -# define __libc_lock_define(CLASS,NAME) # define __libc_lock_init(NAME) do { } while (0) # define __libc_lock_lock(NAME) do { } while (0) # define __libc_lock_unlock(NAME) do { } while (0) #endif /* In case that the system doesn't have isblank(). */ -#if !defined _LIBC && !defined HAVE_ISBLANK && !defined isblank +#if !defined _LIBC && ! (defined isblank || (HAVE_ISBLANK && HAVE_DECL_ISBLANK)) # define isblank(ch) ((ch) == ' ' || (ch) == '\t') #endif @@ -92,7 +85,7 @@ # define SIZE_MAX ((size_t) -1) #endif -#if (defined MB_CUR_MAX && HAVE_LOCALE_H && HAVE_WCTYPE_H && HAVE_WCHAR_H && HAVE_WCRTOMB && HAVE_MBRTOWC && HAVE_WCSCOLL) || _LIBC +#if (defined MB_CUR_MAX && HAVE_LOCALE_H && HAVE_WCTYPE_H && HAVE_ISWCTYPE && HAVE_WCSCOLL) || _LIBC # define RE_ENABLE_I18N #endif @@ -122,10 +115,8 @@ # define __wctype wctype # define __iswctype iswctype # define __btowc btowc -# ifndef __mempcpy -# define __mempcpy mempcpy -# endif # define __wcrtomb wcrtomb +# define __mbrtowc mbrtowc # define __regfree regfree # define attribute_hidden #endif /* not _LIBC */ @@ -172,9 +163,9 @@ typedef unsigned long int bitset_word_t; instead, deduce it directly from BITSET_WORD_MAX. Avoid greater-than-32-bit integers and unconditional shifts by more than 31 bits, as they're not portable. */ -#if BITSET_WORD_MAX == 0xffffffff +#if BITSET_WORD_MAX == 0xffffffffUL # define BITSET_WORD_BITS 32 -#elif BITSET_WORD_MAX >> 31 >> 5 == 1 +#elif BITSET_WORD_MAX >> 31 >> 4 == 1 # define BITSET_WORD_BITS 36 #elif BITSET_WORD_MAX >> 31 >> 16 == 1 # define BITSET_WORD_BITS 48 @@ -193,10 +184,6 @@ typedef unsigned long int bitset_word_t; # if BITSET_WORD_BITS <= SBC_MAX # error "Invalid SBC_MAX" # endif -#elif BITSET_WORD_MAX == (0xffffffff + 2) * 0xffffffff -/* Work around a bug in 64-bit PGC (before version 6.1-2), where the - preprocessor mishandles large unsigned values as if they were signed. */ -# define BITSET_WORD_BITS 64 #else # error "Add case for new bitset_word_t size" #endif @@ -351,7 +338,7 @@ typedef struct Idx idx; /* for BACK_REF */ re_context_type ctx_type; /* for ANCHOR */ } opr; -#if __GNUC__ >= 2 +#if __GNUC__ >= 2 && !__STRICT_ANSI__ re_token_type_t type : 8; #else re_token_type_t type; @@ -432,7 +419,7 @@ struct re_dfa_t; typedef struct re_dfa_t re_dfa_t; #ifndef _LIBC -# ifdef __i386__ +# if defined __i386__ && !defined __EMX__ # define internal_function __attribute ((regparm (3), stdcall)) # else # define internal_function @@ -711,7 +698,9 @@ struct re_dfa_t #ifdef DEBUG char* re_str; #endif +#ifdef _LIBC __libc_lock_define (, lock) +#endif }; #define re_node_set_init_empty(set) memset (set, '\0', sizeof (re_node_set))