Skip to content

Commit ce518bb

Browse files
j6tgitster
authored andcommitted
Fix compat/regex ANSIfication on MinGW
compat/regexec.c had a weird combination of function declaration in ANSI style and function definition in K&R style, for example: static unsigned re_copy_regs (struct re_registers *regs, regmatch_t *pmatch, int nregs, int regs_allocated) internal_function; static unsigned re_copy_regs (regs, pmatch, nregs, regs_allocated) struct re_registers *regs; regmatch_t *pmatch; int nregs, regs_allocated; { ... } with this #define: #ifndef _LIBC # ifdef __i386__ # define internal_function __attribute ((regparm (3), stdcall)) # else # define internal_function # endif #endif The original version as shown above was fine, but with the ANSIfied function definition and in the case where internal_function is not empty, gcc identifies the declaration and definition as different and bails out. Adding internal_function to the definition doesn't help (it results in a syntax error); hence, remove it from the subset of declarations that gcc flags as erroneous. Signed-off-by: Johannes Sixt <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 2316824 commit ce518bb

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

compat/regex/regexec.c

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,20 +40,19 @@ static reg_errcode_t re_search_internal (const regex_t *preg,
4040
const char *string, int length,
4141
int start, int range, int stop,
4242
size_t nmatch, regmatch_t pmatch[],
43-
int eflags) internal_function;
43+
int eflags);
4444
static int re_search_2_stub (struct re_pattern_buffer *bufp,
4545
const char *string1, int length1,
4646
const char *string2, int length2,
4747
int start, int range, struct re_registers *regs,
48-
int stop, int ret_len) internal_function;
48+
int stop, int ret_len);
4949
static int re_search_stub (struct re_pattern_buffer *bufp,
5050
const char *string, int length, int start,
5151
int range, int stop, struct re_registers *regs,
52-
int ret_len) internal_function;
52+
int ret_len);
5353
static unsigned re_copy_regs (struct re_registers *regs, regmatch_t *pmatch,
54-
int nregs, int regs_allocated) internal_function;
55-
static reg_errcode_t prune_impossible_nodes (re_match_context_t *mctx)
56-
internal_function;
54+
int nregs, int regs_allocated);
55+
static reg_errcode_t prune_impossible_nodes (re_match_context_t *mctx);
5756
static int check_matching (re_match_context_t *mctx, int fl_longest_match,
5857
int *p_match_first) internal_function;
5958
static int check_halt_state_context (const re_match_context_t *mctx,

0 commit comments

Comments
 (0)