mirror of
https://sourceware.org/git/glibc.git
synced 2025-01-05 17:11:06 +00:00
Declare wcs functions only if compiling with MBS_SUPPORT. Don't use #elif for traditional C.
This commit is contained in:
parent
5301af2d6d
commit
e3c1ab91ea
@ -406,9 +406,6 @@ typedef char boolean;
|
|||||||
static reg_errcode_t byte_regex_compile _RE_ARGS ((const char *pattern, size_t size,
|
static reg_errcode_t byte_regex_compile _RE_ARGS ((const char *pattern, size_t size,
|
||||||
reg_syntax_t syntax,
|
reg_syntax_t syntax,
|
||||||
struct re_pattern_buffer *bufp));
|
struct re_pattern_buffer *bufp));
|
||||||
static reg_errcode_t wcs_regex_compile _RE_ARGS ((const char *pattern, size_t size,
|
|
||||||
reg_syntax_t syntax,
|
|
||||||
struct re_pattern_buffer *bufp));
|
|
||||||
|
|
||||||
static int byte_re_match_2_internal PARAMS ((struct re_pattern_buffer *bufp,
|
static int byte_re_match_2_internal PARAMS ((struct re_pattern_buffer *bufp,
|
||||||
const char *string1, int size1,
|
const char *string1, int size1,
|
||||||
@ -416,6 +413,19 @@ static int byte_re_match_2_internal PARAMS ((struct re_pattern_buffer *bufp,
|
|||||||
int pos,
|
int pos,
|
||||||
struct re_registers *regs,
|
struct re_registers *regs,
|
||||||
int stop));
|
int stop));
|
||||||
|
static int byte_re_search_2 PARAMS ((struct re_pattern_buffer *bufp,
|
||||||
|
const char *string1, int size1,
|
||||||
|
const char *string2, int size2,
|
||||||
|
int startpos, int range,
|
||||||
|
struct re_registers *regs, int stop));
|
||||||
|
static int byte_re_compile_fastmap PARAMS ((struct re_pattern_buffer *bufp));
|
||||||
|
|
||||||
|
#ifdef MBS_SUPPORT
|
||||||
|
static reg_errcode_t wcs_regex_compile _RE_ARGS ((const char *pattern, size_t size,
|
||||||
|
reg_syntax_t syntax,
|
||||||
|
struct re_pattern_buffer *bufp));
|
||||||
|
|
||||||
|
|
||||||
static int wcs_re_match_2_internal PARAMS ((struct re_pattern_buffer *bufp,
|
static int wcs_re_match_2_internal PARAMS ((struct re_pattern_buffer *bufp,
|
||||||
const char *cstring1, int csize1,
|
const char *cstring1, int csize1,
|
||||||
const char *cstring2, int csize2,
|
const char *cstring2, int csize2,
|
||||||
@ -425,19 +435,13 @@ static int wcs_re_match_2_internal PARAMS ((struct re_pattern_buffer *bufp,
|
|||||||
wchar_t *string1, int size1,
|
wchar_t *string1, int size1,
|
||||||
wchar_t *string2, int size2,
|
wchar_t *string2, int size2,
|
||||||
int *mbs_offset1, int *mbs_offset2));
|
int *mbs_offset1, int *mbs_offset2));
|
||||||
static int byte_re_search_2 PARAMS ((struct re_pattern_buffer *bufp,
|
|
||||||
const char *string1, int size1,
|
|
||||||
const char *string2, int size2,
|
|
||||||
int startpos, int range,
|
|
||||||
struct re_registers *regs, int stop));
|
|
||||||
static int wcs_re_search_2 PARAMS ((struct re_pattern_buffer *bufp,
|
static int wcs_re_search_2 PARAMS ((struct re_pattern_buffer *bufp,
|
||||||
const char *string1, int size1,
|
const char *string1, int size1,
|
||||||
const char *string2, int size2,
|
const char *string2, int size2,
|
||||||
int startpos, int range,
|
int startpos, int range,
|
||||||
struct re_registers *regs, int stop));
|
struct re_registers *regs, int stop));
|
||||||
static int byte_re_compile_fastmap PARAMS ((struct re_pattern_buffer *bufp));
|
|
||||||
static int wcs_re_compile_fastmap PARAMS ((struct re_pattern_buffer *bufp));
|
static int wcs_re_compile_fastmap PARAMS ((struct re_pattern_buffer *bufp));
|
||||||
|
#endif
|
||||||
|
|
||||||
/* These are the command codes that appear in compiled regular
|
/* These are the command codes that appear in compiled regular
|
||||||
expressions. Some opcodes are followed by argument bytes. A
|
expressions. Some opcodes are followed by argument bytes. A
|
||||||
@ -607,29 +611,31 @@ typedef enum
|
|||||||
# define PREFIX(name) byte_##name
|
# define PREFIX(name) byte_##name
|
||||||
# define ARG_PREFIX(name) name
|
# define ARG_PREFIX(name) name
|
||||||
# define PUT_CHAR(c) putchar (c)
|
# define PUT_CHAR(c) putchar (c)
|
||||||
#elif defined WCHAR
|
|
||||||
# define CHAR_T wchar_t
|
|
||||||
# define UCHAR_T wchar_t
|
|
||||||
# define COMPILED_BUFFER_VAR wc_buffer
|
|
||||||
# define OFFSET_ADDRESS_SIZE 1 /* the size which STORE_NUMBER macro use */
|
|
||||||
# define CHAR_CLASS_SIZE ((__alignof__(wctype_t)+sizeof(wctype_t))/sizeof(CHAR_T)+1)
|
|
||||||
# define PREFIX(name) wcs_##name
|
|
||||||
# define ARG_PREFIX(name) c##name
|
|
||||||
/* Should we use wide stream?? */
|
|
||||||
# define PUT_CHAR(c) printf ("%C", c);
|
|
||||||
# define TRUE 1
|
|
||||||
# define FALSE 0
|
|
||||||
#else
|
#else
|
||||||
# ifdef MBS_SUPPORT
|
# ifdef WCHAR
|
||||||
# define WCHAR
|
# define CHAR_T wchar_t
|
||||||
|
# define UCHAR_T wchar_t
|
||||||
|
# define COMPILED_BUFFER_VAR wc_buffer
|
||||||
|
# define OFFSET_ADDRESS_SIZE 1 /* the size which STORE_NUMBER macro use */
|
||||||
|
# define CHAR_CLASS_SIZE ((__alignof__(wctype_t)+sizeof(wctype_t))/sizeof(CHAR_T)+1)
|
||||||
|
# define PREFIX(name) wcs_##name
|
||||||
|
# define ARG_PREFIX(name) c##name
|
||||||
|
/* Should we use wide stream?? */
|
||||||
|
# define PUT_CHAR(c) printf ("%C", c);
|
||||||
|
# define TRUE 1
|
||||||
|
# define FALSE 0
|
||||||
|
# else
|
||||||
|
# ifdef MBS_SUPPORT
|
||||||
|
# define WCHAR
|
||||||
|
# define INSIDE_RECURSION
|
||||||
|
# include "regex.c"
|
||||||
|
# undef INSIDE_RECURSION
|
||||||
|
# endif
|
||||||
|
# define BYTE
|
||||||
# define INSIDE_RECURSION
|
# define INSIDE_RECURSION
|
||||||
# include "regex.c"
|
# include "regex.c"
|
||||||
# undef INSIDE_RECURSION
|
# undef INSIDE_RECURSION
|
||||||
# endif
|
# endif
|
||||||
# define BYTE
|
|
||||||
# define INSIDE_RECURSION
|
|
||||||
# include "regex.c"
|
|
||||||
# undef INSIDE_RECURSION
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef INSIDE_RECURSION
|
#ifdef INSIDE_RECURSION
|
||||||
|
Loading…
Reference in New Issue
Block a user