Thread (38 messages) flat view 38 messages, 10 authors, 2016-08-13

Re: [PATCH v2 05/14] Change regerror() definition from K&R style to ANSI C (C89)

From: Erik Faye-Lund <hidden>
Date: 2016-08-13 23:24:47

On Fri, Aug 21, 2009 at 10:10 PM, Marius Storm-Olsen[off-list ref] wrote:
 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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help