Skip to content

Commit

Permalink
Change regerror() declaration from K&R style to ANSI C (C89)
Browse files Browse the repository at this point in the history
The MSVC headers typedef errcode as int, and thus confused the compiler in
the K&R style definition. ANSI style deconfuses it.

This patch was originally applied as v1.6.5-rc2~23 but needs to be
re-applied since compat/regex was overwritten by Ævar Arnfjörð
Bjarmason with the gawk regex engine.

Signed-off-by: Frank Li <lznuaa@gmail.com>
Signed-off-by: Marius Storm-Olsen <mstormo@gmail.com>
Acked-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Frank Li authored and Junio C Hamano committed Aug 18, 2010
1 parent a997bf4 commit de83172
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions compat/regex/regcomp.c
Original file line number Diff line number Diff line change
Expand Up @@ -546,11 +546,8 @@ weak_alias (__regcomp, regcomp)
from either regcomp or regexec. We don't use PREG here. */

size_t
regerror (errcode, preg, errbuf, errbuf_size)
int errcode;
const regex_t *__restrict preg;
char *__restrict errbuf;
size_t errbuf_size;
regerror(int errcode, const regex_t *__restrict preg,
char *__restrict errbuf, size_t errbuf_size)
{
const char *msg;
size_t msg_size;
Expand Down

0 comments on commit de83172

Please sign in to comment.