[evince/wip/chpe/symbols-visibility: 10/11] backends: Use symbol visibility for exported symbols
- From: Christian Persch <chpe src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evince/wip/chpe/symbols-visibility: 10/11] backends: Use symbol visibility for exported symbols
- Date: Thu, 18 Nov 2021 22:38:08 +0000 (UTC)
commit 27aec5e654809b56358ec3f6ceb1590e853fad93
Author: Christian Persch <chpe src gnome org>
Date: Thu Nov 18 23:37:10 2021 +0100
backends: Use symbol visibility for exported symbols
Instead of using a symbol file, use the visibility attribute to export only
the public API.
backend/backend-symbol.map | 6 ------
backend/comics/comics-document.h | 6 ++++--
backend/comics/meson.build | 3 +--
backend/djvu/djvu-document.h | 6 ++++--
backend/djvu/meson.build | 3 +--
backend/dvi/dvi-document.h | 6 ++++--
backend/dvi/meson.build | 3 +--
backend/meson.build | 3 ---
backend/pdf/ev-poppler.h | 5 +++--
backend/pdf/meson.build | 3 +--
backend/ps/ev-spectre.h | 4 +++-
backend/ps/meson.build | 3 +--
backend/tiff/meson.build | 3 +--
backend/tiff/tiff-document.h | 7 +++++--
backend/xps/meson.build | 3 +--
backend/xps/xps-document.h | 4 +++-
16 files changed, 33 insertions(+), 35 deletions(-)
---
diff --git a/backend/comics/comics-document.h b/backend/comics/comics-document.h
index 76feef051..227e71f31 100644
--- a/backend/comics/comics-document.h
+++ b/backend/comics/comics-document.h
@@ -19,6 +19,7 @@
#ifndef __COMICS_DOCUMENT_H__
#define __COMICS_DOCUMENT_H__
+#include "ev-macros.h"
#include "ev-document.h"
G_BEGIN_DECLS
@@ -31,8 +32,9 @@ typedef struct _ComicsDocument ComicsDocument;
GType comics_document_get_type (void) G_GNUC_CONST;
-G_MODULE_EXPORT GType register_evince_backend (GTypeModule *module);
-
+EV_PUBLIC
+GType register_evince_backend (GTypeModule *module);
+
G_END_DECLS
#endif /* __COMICS_DOCUMENT_H__ */
diff --git a/backend/comics/meson.build b/backend/comics/meson.build
index f1a80ca38..1e740194b 100644
--- a/backend/comics/meson.build
+++ b/backend/comics/meson.build
@@ -16,8 +16,7 @@ shared_module(
include_directories: incs,
dependencies: deps,
c_args: backends_cflags,
- link_args: backends_ldflags,
- link_depends: backends_symbol_map,
+ gnu_symbol_visibility: 'hidden',
install: true,
install_dir: ev_backendsdir,
name_suffix: name_suffix,
diff --git a/backend/djvu/djvu-document.h b/backend/djvu/djvu-document.h
index bcb916af5..6ba3a1897 100644
--- a/backend/djvu/djvu-document.h
+++ b/backend/djvu/djvu-document.h
@@ -19,6 +19,7 @@
#ifndef __DJVU_DOCUMENT_H__
#define __DJVU_DOCUMENT_H__
+#include "ev-macros.h"
#include "ev-document.h"
G_BEGIN_DECLS
@@ -31,8 +32,9 @@ typedef struct _DjvuDocument DjvuDocument;
GType djvu_document_get_type (void) G_GNUC_CONST;
-G_MODULE_EXPORT GType register_evince_backend (GTypeModule *module);
-
+EV_PUBLIC
+GType register_evince_backend (GTypeModule *module);
+
G_END_DECLS
#endif /* __DJVU_DOCUMENT_H__ */
diff --git a/backend/djvu/meson.build b/backend/djvu/meson.build
index b5328974d..1a687acf6 100644
--- a/backend/djvu/meson.build
+++ b/backend/djvu/meson.build
@@ -10,8 +10,7 @@ shared_module(
include_directories: backends_incs,
dependencies: backends_deps + [ddjvuapi_dep],
c_args: backends_cflags + ['-DGNOMEICONDIR="@0@"'.format(join_paths(ev_datadir, 'pixmaps'))],
- link_args: backends_ldflags,
- link_depends: backends_symbol_map,
+ gnu_symbol_visibility: 'hidden',
install: true,
install_dir: ev_backendsdir,
name_suffix: name_suffix,
diff --git a/backend/dvi/dvi-document.h b/backend/dvi/dvi-document.h
index 845301b62..4afd288b0 100644
--- a/backend/dvi/dvi-document.h
+++ b/backend/dvi/dvi-document.h
@@ -19,6 +19,7 @@
#ifndef __DVI_DOCUMENT_H__
#define __DVI_DOCUMENT_H__
+#include "ev-macros.h"
#include "ev-document.h"
G_BEGIN_DECLS
@@ -31,8 +32,9 @@ typedef struct _DviDocument DviDocument;
GType dvi_document_get_type (void) G_GNUC_CONST;
-G_MODULE_EXPORT GType register_evince_backend (GTypeModule *module);
-
+EV_PUBLIC
+GType register_evince_backend (GTypeModule *module);
+
G_END_DECLS
#endif /* __DVI_DOCUMENT_H__ */
diff --git a/backend/dvi/meson.build b/backend/dvi/meson.build
index 26aba04f5..3809b6271 100644
--- a/backend/dvi/meson.build
+++ b/backend/dvi/meson.build
@@ -21,8 +21,7 @@ shared_module(
include_directories: backends_incs,
dependencies: deps,
c_args: backends_cflags,
- link_args: backends_ldflags,
- link_depends: backends_symbol_map,
+ gnu_symbol_visibility: 'hidden',
install: true,
install_dir: ev_backendsdir,
name_suffix: name_suffix,
diff --git a/backend/meson.build b/backend/meson.build
index 14629f2f0..e44c1d6d7 100644
--- a/backend/meson.build
+++ b/backend/meson.build
@@ -11,9 +11,6 @@ backends_cflags = [
'-DGTK_MULTIHEAD_SAFE',
]
-backends_symbol_map = join_paths(meson.current_source_dir(), 'backend-symbol.map')
-backends_ldflags = cc.get_supported_link_arguments('-Wl,--version-script,' + backends_symbol_map)
-
foreach backend, backend_mime_types: backends
backend_name = backend + 'document'
diff --git a/backend/pdf/ev-poppler.h b/backend/pdf/ev-poppler.h
index f37f22688..45d1a12db 100644
--- a/backend/pdf/ev-poppler.h
+++ b/backend/pdf/ev-poppler.h
@@ -19,6 +19,7 @@
#ifndef __PDF_DOCUMENT_H__
#define __PDF_DOCUMENT_H__
+#include "ev-macros.h"
#include "ev-document.h"
G_BEGIN_DECLS
@@ -32,8 +33,8 @@ typedef struct _PdfDocumentClass PdfDocumentClass;
GType pdf_document_get_type (void) G_GNUC_CONST;
-G_MODULE_EXPORT GType register_evince_backend (GTypeModule *module);
-
+EV_PUBLIC
+GType register_evince_backend (GTypeModule *module);
G_END_DECLS
diff --git a/backend/pdf/meson.build b/backend/pdf/meson.build
index 320203195..94c087db4 100644
--- a/backend/pdf/meson.build
+++ b/backend/pdf/meson.build
@@ -11,8 +11,7 @@ shared_module(
include_directories: backends_incs,
dependencies: deps,
c_args: backends_cflags,
- link_args: backends_ldflags,
- link_depends: backends_symbol_map,
+ gnu_symbol_visibility: 'hidden',
install: true,
install_dir: ev_backendsdir,
name_suffix: name_suffix,
diff --git a/backend/ps/ev-spectre.h b/backend/ps/ev-spectre.h
index 42bf969dc..9ece58015 100644
--- a/backend/ps/ev-spectre.h
+++ b/backend/ps/ev-spectre.h
@@ -26,6 +26,7 @@
#include <glib-object.h>
+#include "ev-macros.h"
#include "ev-document.h"
G_BEGIN_DECLS
@@ -41,7 +42,8 @@ typedef struct _PSDocumentClass PSDocumentClass;
GType ps_document_get_type (void) G_GNUC_CONST;
-G_MODULE_EXPORT GType register_evince_backend (GTypeModule *module);
+EV_PUBLIC
+GType register_evince_backend (GTypeModule *module);
G_END_DECLS
diff --git a/backend/ps/meson.build b/backend/ps/meson.build
index 109cb5223..5dfdbee78 100644
--- a/backend/ps/meson.build
+++ b/backend/ps/meson.build
@@ -4,8 +4,7 @@ shared_module(
include_directories: backends_incs,
dependencies: backends_deps + [libspectre_dep],
c_args: backends_cflags,
- link_args: backends_ldflags,
- link_depends: backends_symbol_map,
+ gnu_symbol_visibility: 'hidden',
install: true,
install_dir: ev_backendsdir,
name_suffix: name_suffix,
diff --git a/backend/tiff/meson.build b/backend/tiff/meson.build
index 91b2b0522..b531b345e 100644
--- a/backend/tiff/meson.build
+++ b/backend/tiff/meson.build
@@ -9,8 +9,7 @@ shared_module(
include_directories: backends_incs,
dependencies: backends_deps + [libtiff_dep, m_dep],
c_args: backends_cflags,
- link_args: backends_ldflags,
- link_depends: backends_symbol_map,
+ gnu_symbol_visibility: 'hidden',
install: true,
install_dir: ev_backendsdir,
name_suffix: name_suffix,
diff --git a/backend/tiff/tiff-document.h b/backend/tiff/tiff-document.h
index a188f1430..6e9cc0fc1 100644
--- a/backend/tiff/tiff-document.h
+++ b/backend/tiff/tiff-document.h
@@ -20,6 +20,7 @@
#ifndef __TIFF_DOCUMENT_H__
#define __TIFF_DOCUMENT_H__
+#include "ev-macros.h"
#include "ev-document.h"
G_BEGIN_DECLS
@@ -31,8 +32,10 @@ G_BEGIN_DECLS
typedef struct _TiffDocument TiffDocument;
GType tiff_document_get_type (void) G_GNUC_CONST;
-G_MODULE_EXPORT GType register_evince_backend (GTypeModule *module);
-
+
+EV_PUBLIC
+GType register_evince_backend (GTypeModule *module);
+
G_END_DECLS
#endif /* __TIFF_DOCUMENT_H__ */
diff --git a/backend/xps/meson.build b/backend/xps/meson.build
index 361ac7be0..0e1a6c0be 100644
--- a/backend/xps/meson.build
+++ b/backend/xps/meson.build
@@ -4,8 +4,7 @@ shared_module(
include_directories: backends_incs,
dependencies: backends_deps + [libgxps_dep],
c_args: backends_cflags,
- link_args: backends_ldflags,
- link_depends: backends_symbol_map,
+ gnu_symbol_visibility: 'hidden',
install: true,
install_dir: ev_backendsdir,
name_suffix: name_suffix,
diff --git a/backend/xps/xps-document.h b/backend/xps/xps-document.h
index f20fbf32f..7cafa72c6 100644
--- a/backend/xps/xps-document.h
+++ b/backend/xps/xps-document.h
@@ -22,6 +22,7 @@
#include <glib-object.h>
+#include "ev-macros.h"
#include "ev-document.h"
G_BEGIN_DECLS
@@ -37,7 +38,8 @@ typedef struct _XPSDocumentClass XPSDocumentClass;
GType xps_document_get_type (void) G_GNUC_CONST;
-G_MODULE_EXPORT GType register_evince_backend (GTypeModule *module);
+EV_PUBLIC
+GType register_evince_backend (GTypeModule *module);
G_END_DECLS
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]