From: Uwe Hermann Date: Mon, 16 Apr 2012 21:16:00 +0000 (+0200) Subject: sr/srd: SR_API/SRD_API/etc. is a no-op on MinGW. X-Git-Tag: libsigrok-0.1.0~1 X-Git-Url: http://sigrok.org/gitweb/?a=commitdiff_plain;h=69e70c233ef6186131369ad596a96a2632bdcf85;p=libsigrok.git sr/srd: SR_API/SRD_API/etc. is a no-op on MinGW. This avoids warnings on a MinGW build. The feature depends on ELF files, but MinGW/Windows uses PE files. --- diff --git a/sigrok.h.in b/sigrok.h.in index 96059d22..7b3f122e 100644 --- a/sigrok.h.in +++ b/sigrok.h.in @@ -115,14 +115,25 @@ extern "C" { * * This uses the 'visibility' feature of gcc (requires gcc >= 4.0). * + * This feature is not available on MinGW/Windows, as it is a feature of + * ELF files and MinGW/Windows uses PE files. + * * Details: http://gcc.gnu.org/wiki/Visibility */ /* Marks public libsigrok API symbols. */ +#ifndef _WIN32 #define SR_API __attribute__((visibility("default"))) +#else +#define SR_API +#endif /* Marks private, non-public libsigrok symbols (not part of the API). */ +#ifndef _WIN32 #define SR_PRIV __attribute__((visibility("hidden"))) +#else +#define SR_PRIV +#endif typedef int (*sr_receive_data_callback_t)(int fd, int revents, void *cb_data);