From 13987e752a557d35be02e4a88010f81300f92b75 Mon Sep 17 00:00:00 2001 From: Magnus Jacobsson Date: Sun, 3 Apr 2022 08:49:41 +0200 Subject: [PATCH] render: unconditionally include stdlib.h Without this change, attempting to include geomproc.h in render.h would cause the following warning: In file included from /home/magjac/graphviz/lib/common/shapes.c:12: /home/magjac/graphviz/lib/common/render.h:24: warning: "__USE_GNU" redefined 24 | #define __USE_GNU | In file included from /usr/include/x86_64-linux-gnu/bits/libc-header-start.h:33, from /usr/include/limits.h:26, from /usr/lib/gcc/x86_64-linux-gnu/11/include/limits.h:203, from /usr/lib/gcc/x86_64-linux-gnu/11/include/syslimits.h:7, from /usr/lib/gcc/x86_64-linux-gnu/11/include/limits.h:34, from /home/magjac/graphviz/lib/common/arith.h:21, from /home/magjac/graphviz/lib/common/geom.h:16, from /home/magjac/graphviz/lib/common/geomprocs.h:21, from /home/magjac/graphviz/lib/common/shapes.c:11: /usr/include/features.h:407: note: this is the location of the previous definition 407 | # define __USE_GNU 1 | This is casued by arith.h defining _GNU_SOURCE to 1 which seems to implicitly set __USE_GNU. --- lib/common/render.h | 6 ------ 1 file changed, 6 deletions(-) diff --git a/lib/common/render.h b/lib/common/render.h index 28ef222ae..9bdda0bc9 100644 --- a/lib/common/render.h +++ b/lib/common/render.h @@ -20,13 +20,7 @@ extern "C" { #include #endif #include -#if !defined(_WIN32) && !defined(DARWIN) -#define __USE_GNU #include -#undef __USE_GNU -#else -#include -#endif #include #include -- 2.40.0