[libvirt] [ocaml PATCH 7/6] Hide again the internal helpers

Pino Toscano ptoscano at redhat.com
Tue Sep 3 11:41:16 UTC 2019


Use a GCC pragma to hide all the internal helpers, so they are not
exposed as public symbols of the stub library.

Signed-off-by: Pino Toscano <ptoscano at redhat.com>
---
 libvirt/libvirt_c.h | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/libvirt/libvirt_c.h b/libvirt/libvirt_c.h
index 541d8e3..45937f6 100644
--- a/libvirt/libvirt_c.h
+++ b/libvirt/libvirt_c.h
@@ -40,6 +40,13 @@
 
 /* Please read libvirt/README file. */
 
+/* Make sure to not expose our internal helpers as public symbols.
+ * https://gcc.gnu.org/wiki/Visibility
+ */
+#ifdef __GNUC__
+#pragma GCC visibility push(hidden)
+#endif
+
 const char *Optstring_val (value strv);
 typedef value (*Val_ptr_t) (void *);
 value Val_opt (void *ptr, Val_ptr_t Val_ptr);
@@ -153,4 +160,8 @@ value Val_pool (virStoragePoolPtr pol, value connv);
 value Val_volume (virStorageVolPtr vol, value connv);
 value Val_secret (virSecretPtr sec, value connv);
 
+#ifdef __GNUC__
+#pragma GCC visibility pop
+#endif
+
 #endif
-- 
2.21.0




More information about the libvir-list mailing list