Re: [PATCH v2 05/14] Change regerror() definition from K&R style to ANSI C (C89)
- From
Erik Faye-Lund <kusmabite@googlemail.com>
- Date
- Aug 24, 2009, 09:42 UTC
- Message-ID
- <40aa078e0908240242t6ff6c5b7y9a5957e6472b7b14@mail.gmail.com>
- In-Reply-To
- <0123e22f50dfd5e1b483a02cf550e5373125f1d.1250860247.git.mstormo@gmail.com>
On Fri, Aug 21, 2009 at 10:10 PM, Marius Storm-Olsen<mstormo@gmail.com> wrote:
Show 9 quoted lines
> size_t
> -regerror (errcode, preg, errbuf, errbuf_size)
> - int errcode;
> - const regex_t *preg;
> - char *errbuf;
> - size_t errbuf_size;
> +regerror(int errcode, const regex_t *preg,
> + char *errbuf, size_t errbuf_size)
> {Since the real reason isn't the K&R style defintion, but that "errcode" has been typedef'ed, perhaps it's better to either do something like this:
#ifdef _MSC_VER #define errcode dummy_def #include <crtdefs.h> #undef errcode #endif
...before the first crt-inclusion, or simply to rename "errcode" to something like "error"? The latter can be done with the preprocessor after the first crt-inclusion.
-- Erik "kusma" Faye-Lund kusmabite@gmail.com (+47) 986 59 656