summaryrefslogtreecommitdiff
path: root/libmediaart/extractgeneric.h
diff options
context:
space:
mode:
authorSam Thursfield <sam@afuera.me.uk>2017-07-21 12:33:49 +0100
committerCarlos Garnacho <carlosg@gnome.org>2017-08-09 17:12:02 +0200
commit213a8c015b0d233dc32ca3b2699da71c706958a7 (patch)
tree79fee0065119184dbc1edd3d9c55fb13c1b94f5b /libmediaart/extractgeneric.h
parent9c2091d67d581fed07dae8dc4b0e0541bc6be3f8 (diff)
downloadlibmediaart-213a8c015b0d233dc32ca3b2699da71c706958a7.tar.gz
Use compiler symbol visiblity features to hide internal functions
Previously we relied on libtool's -export-symbols-regex feature, but we are hoping to drop GNU Autotools and GNU Libtool in soon in favour of Meson. Meson doesn't have an equivalent feature, instead the advice is to control symbol visibility at compile time. The approach taken in this patch is based on Pango's build system. Pango tells the compiler to hide symbols by default (if possible), and then defines a _PANGO_EXTERN variable at compile time which marks a single symbol as public. In Pango's case there is then further machinary to hide symbols based on deprecation policies but I have not copied that here, instead I used _LIBMEDIAART_EXTERN directly. If a compiler doesn't support hiding symbols then the library we build makes all symbols available, which is exactly what would happen before on platforms where the libtool didn't have an implementation for -export-symbols-regex. See also: http://mesonbuild.com/FAQ.html#how-do-i-do-the-equivalent-of-libtools-exportsymbol-and-exportregex https://git.gnome.org/browse/pango/ https://git.gnome.org/browse/pango/tree/pango/pango-version-macros.h https://gcc.gnu.org/wiki/Visibility https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html#Code-Gen-Options (-fvisibility) https://bugzilla.gnome.org/show_bug.cgi?id=783562
Diffstat (limited to 'libmediaart/extractgeneric.h')
-rw-r--r--libmediaart/extractgeneric.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/libmediaart/extractgeneric.h b/libmediaart/extractgeneric.h
index 8fa114b..b08fe2c 100644
--- a/libmediaart/extractgeneric.h
+++ b/libmediaart/extractgeneric.h
@@ -25,18 +25,24 @@
#include <glib.h>
+#include "mediaart-macros.h"
+
#if !defined (__LIBMEDIAART_INSIDE__) && !defined (LIBMEDIAART_COMPILATION)
#error "Only <libmediaart/mediaart.h> must be included directly."
#endif
G_BEGIN_DECLS
+_LIBMEDIAART_EXTERN
void media_art_plugin_init (gint max_width);
+_LIBMEDIAART_EXTERN
void media_art_plugin_shutdown (void);
+_LIBMEDIAART_EXTERN
gboolean media_art_file_to_jpeg (const gchar *filename,
const gchar *target,
GError **error);
+_LIBMEDIAART_EXTERN
gboolean media_art_buffer_to_jpeg (const unsigned char *buffer,
size_t len,
const gchar *buffer_mime,