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

Richard W.M. Jones rjones at redhat.com
Tue Sep 3 11:42:20 UTC 2019


On Tue, Sep 03, 2019 at 01:41:16PM +0200, Pino Toscano wrote:
> 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

Even better :-)

ACK series.

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
virt-df lists disk usage of guests without needing to install any
software inside the virtual machine.  Supports Linux and Windows.
http://people.redhat.com/~rjones/virt-df/




More information about the libvir-list mailing list