]>
granicus.if.org Git - graphviz/commit
cgraph: [nfc] guard 'strcasecmp' definition to avoid duplication
When compiling with Microsoft Visual Studio 2019, the compiler emits:
…\lib\cgraph\strcasecmp.h(12,64): warning C4211: nonstandard extension used:
redefined extern to static
Investigation reveals libgd defines their own `strcasecmp` shim in gd.h:
/* VS2012+ disable keyword macroizing unless _ALLOW_KEYWORD_MACROS is set
We define inline, and strcasecmp if they're missing
*/
#ifdef _MSC_VER
# define _ALLOW_KEYWORD_MACROS
# ifndef inline
# define inline __inline
# endif
# ifndef strcasecmp
# define strcasecmp _stricmp
# endif
#endif
To avoid this warning, guard Graphviz’ shim so it is only used when the libgd
shim is not in use.
Note that this also explains why MSVC is able to compile diffimg.c despite the
Graphviz shim file not being included.