]> git.ipfire.org Git - thirdparty/rrdtool-1.x.git/commitdiff
Fix _errno inconsistent dll linkage (Windows)
authorWolfgang Stöggl <c72578@yahoo.de>
Sun, 27 Jan 2019 00:09:34 +0000 (01:09 +0100)
committerTobias Oetiker <tobi@oetiker.ch>
Mon, 28 Jan 2019 10:43:21 +0000 (11:43 +0100)
- 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]

src/rrd_snprintf.c

index 125ebb8371ed50ac02425f28c62b40b4aad332a2..6f36a9dc64564a9d7c8252930a25215d1c4ef506 100644 (file)
@@ -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)