Skip to content

Commit de83172

Browse files
lznuaagitster
authored andcommitted
Change regerror() declaration from K&R style to ANSI C (C89)
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 <[email protected]> Signed-off-by: Marius Storm-Olsen <[email protected]> Acked-by: Johannes Sixt <[email protected]> Signed-off-by: Junio C Hamano <[email protected]> Signed-off-by: Ævar Arnfjörð Bjarmason <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent a997bf4 commit de83172

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

compat/regex/regcomp.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -546,11 +546,8 @@ weak_alias (__regcomp, regcomp)
546546
from either regcomp or regexec. We don't use PREG here. */
547547

548548
size_t
549-
regerror (errcode, preg, errbuf, errbuf_size)
550-
int errcode;
551-
const regex_t *__restrict preg;
552-
char *__restrict errbuf;
553-
size_t errbuf_size;
549+
regerror(int errcode, const regex_t *__restrict preg,
550+
char *__restrict errbuf, size_t errbuf_size)
554551
{
555552
const char *msg;
556553
size_t msg_size;

0 commit comments

Comments
 (0)