aboutsummaryrefslogtreecommitdiff
path: root/libpkgconf/libpkgconf-api.h
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2017-09-06 17:40:06 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2017-09-11 13:58:25 +0300
commit4beec8f055fd3b0cc4ef618cce8b52c58dd0ee08 (patch)
tree08dc183e96625ef8b2068432154851e014047d89 /libpkgconf/libpkgconf-api.h
parent507d73eaa2accb7ad880e8582fd4ffab45b7effd (diff)
Add implementation
Diffstat (limited to 'libpkgconf/libpkgconf-api.h')
-rw-r--r--libpkgconf/libpkgconf-api.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/libpkgconf/libpkgconf-api.h b/libpkgconf/libpkgconf-api.h
new file mode 100644
index 0000000..1c4fb73
--- /dev/null
+++ b/libpkgconf/libpkgconf-api.h
@@ -0,0 +1,20 @@
+#ifndef PKGCONFG_API
+#define PKGCONFG_API
+
+/* Makefile.am specifies visibility using the libtool option -export-symbols-regex '^pkgconf_'
+ * Unfortunately, that is not available when building with cmake, so use attributes instead,
+ * in a way that doesn't depend on any cmake magic.
+ */
+#if defined(PKGCONFIG_IS_STATIC)
+# define PKGCONF_API
+#elif defined(_WIN32) || defined(_WIN64)
+# ifdef LIBPKGCONF_EXPORT
+# define PKGCONF_API __declspec(dllexport)
+# else
+# define PKGCONF_API __declspec(dllimport)
+# endif
+#else
+# define PKGCONF_API __attribute__((visibility("default")))
+#endif
+
+#endif