From: Wolfgang Stöggl Date: Sun, 27 Jan 2019 00:09:34 +0000 (+0100) Subject: Fix _errno inconsistent dll linkage (Windows) X-Git-Tag: v1.7.1~11 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=492f9f525e204d77ca417fb6077c1e573f885431;p=thirdparty%2Frrdtool-1.x.git Fix _errno inconsistent dll linkage (Windows) - Exclude in case of _WIN32 in rrd_snprintf.c: extern int errno; - Fixes warnings: MSVC: rrd_snprintf.c(583): warning C4273: '_errno': inconsistent dll linkage errno.h(19): note: see previous definition of '_errno' MinGW-w64 (gcc): rrd_snprintf.c:583:12: warning: '_errno' redeclared without dllimport attribute: previous dllimport ignored [-Wattributes] --- diff --git a/src/rrd_snprintf.c b/src/rrd_snprintf.c index 125ebb83..6f36a9dc 100644 --- a/src/rrd_snprintf.c +++ b/src/rrd_snprintf.c @@ -580,7 +580,9 @@ static UINTMAX_T cast(LDOUBLE); static UINTMAX_T myround(LDOUBLE); static LDOUBLE mypow10(int); +#ifndef _WIN32 /* Avoid warning under Windows */ extern int errno; +#endif int rpl_vsnprintf(char *str, size_t size, const char *format, va_list args)