summaryrefslogtreecommitdiff
path: root/include/epoxy
diff options
context:
space:
mode:
authorYaron Cohen-Tal <yaronct@gmail.com>2015-09-03 23:17:39 +0300
committerYaron Cohen-Tal <yaronct@gmail.com>2015-09-03 23:17:39 +0300
commit44d51f28445d40451bc600b26f3b4b17fd003c67 (patch)
tree3ee52bcfb7ed16621bd467e7a7f871d560df7620 /include/epoxy
parent64e2ee2ca81cf7d772bad2f471073e1066572c17 (diff)
downloadlibepoxy-44d51f28445d40451bc600b26f3b4b17fd003c67.tar.gz
Fix support for a static build of Epoxy. Add support building and running tests with CMake. Add support for linking with the static run-time library with MSVC.
Diffstat (limited to 'include/epoxy')
-rw-r--r--include/epoxy/common.h29
1 files changed, 18 insertions, 11 deletions
diff --git a/include/epoxy/common.h b/include/epoxy/common.h
index a190e02..cf1badf 100644
--- a/include/epoxy/common.h
+++ b/include/epoxy/common.h
@@ -38,28 +38,35 @@ extern "C" {
#endif
#if defined _WIN32 || defined __CYGWIN__
- #ifdef EPOXY_EXPORTS
- #ifdef __GNUC__
- #define EPOXY_IMPORTEXPORT __attribute__ ((dllexport))
- #else
- #define EPOXY_IMPORTEXPORT __declspec(dllexport)
- #endif
+ #if defined EPOXY_STATIC_LIB
+ #define EPOXY_IMPORTEXPORT
#else
- #ifdef __GNUC__
- #define EPOXY_IMPORTEXPORT __attribute__ ((dllimport))
+ #if defined EPOXY_BUILDING_LIB
+ #ifdef __GNUC__
+ #define EPOXY_IMPORTEXPORT __attribute__((dllexport))
+ #else
+ #define EPOXY_IMPORTEXPORT __declspec(dllexport)
+ #endif
#else
- #define EPOXY_IMPORTEXPORT __declspec(dllimport)
+ #ifdef __GNUC__
+ #define EPOXY_IMPORTEXPORT __attribute__((dllimport))
+ #else
+ #define EPOXY_IMPORTEXPORT __declspec(dllimport)
+ #endif
#endif
#endif
#elif defined __ANDROID__
#include <sys/cdefs.h>
#define EPOXY_IMPORTEXPORT __attribute__((visibility("default"))) __NDK_FPABI__
-#elif (defined __GNUC__ && __GNUC__ >= 4) || (defined __SUNPRO_C && __SUNPRO_C >= 0x590)
- #define EPOXY_IMPORTEXPORT __attribute__ ((visibility ("default")))
+#elif (defined __GNUC__ && __GNUC__ >= 4) || (defined __SUNPRO_C && __SUNPRO_C >= 0x590)
+ #define EPOXY_IMPORTEXPORT __attribute__((visibility("default")))
#else
#define EPOXY_IMPORTEXPORT
#endif
+// Prevent "unused variable/parameter" warnings.
+#define EPOXY_UNUSED(var) ((void)var)
+
#ifdef __cplusplus
}
#endif