From: Wolfgang Stöggl Date: Sat, 13 Apr 2019 20:34:48 +0000 (+0200) Subject: Avoid MinGW-w64 strndup compiler warning X-Git-Tag: v1.7.2~7 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1c231bf6dc84160b7c1aed4a3fd04063164e120a;p=thirdparty%2Frrdtool-1.x.git Avoid MinGW-w64 strndup compiler warning - Fixes the following MinGW-w64 GCC compiler warning: rrd_create.c:287:14: warning: declaration of 'strndup' shadows a built-in function [-Wshadow] static char *strndup( - MinGW-w64: strndup is not detected by configure, therefore HAVE_STRNDUP is not defined. Use strndup_() here instead of strndup() to avoid any collisions. --- diff --git a/src/rrd_create.c b/src/rrd_create.c index c2565904..ff501a62 100644 --- a/src/rrd_create.c +++ b/src/rrd_create.c @@ -264,6 +264,8 @@ int rrd_create( } #ifndef HAVE_STRNDUP +/* Avoid MinGW-w64 warning: declaration of 'strndup' shadows a built-in function [-Wshadow] */ +#define strndup strndup_ /* Implement the strndup function. Copyright (C) 2005 Free Software Foundation, Inc. Written by Kaveh R. Ghazi .