From: Gerhard Sittig Date: Sun, 26 Dec 2021 07:21:02 +0000 (+0100) Subject: ir_irmp: wrapper lib, silence warnings in "Windows or Unix" condition X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=de219b2b77dba06815869823789458581500ca03;p=libsigrokdecode.git ir_irmp: wrapper lib, silence warnings in "Windows or Unix" condition Platform detection in the external IRMP library works best when either the WIN32 or the unix identifiers are provided, which the sigrokdecode build environment derives from other identifiers which are more reliably available. It turns out that other external dependencies like glib or Python may provide some of these identifiers, too. Which results in the compiler warning about symbols' redefinition. Only define derived identifiers when they haven't been provided yet. This amends commit ab88bae1c7b9. --- diff --git a/irmp/irmp-main-sharedlib.c b/irmp/irmp-main-sharedlib.c index 6f5c058..cbf239a 100644 --- a/irmp/irmp-main-sharedlib.c +++ b/irmp/irmp-main-sharedlib.c @@ -31,9 +31,13 @@ * upstream project. */ #if defined _WIN32 -# define WIN32 +# if !defined WIN32 +# define WIN32 +# endif #else -# define unix +# if !defined unix +# define unix +# endif #endif #include "irmp.h" #include "irmp.c"