[VDPAU] [PATCH 2/2] vdpau: do not export _vdp_DRI2* functions

Aaron Plattner aplattner at nvidia.com
Sat Jul 19 09:30:19 PDT 2014


On 07/19/2014 08:22 AM, Emil Velikov wrote:
> Neither one is part of the public API, thus should never be used outside
> of the library itself.
>
> Add a PUBLIC and PRIVATE macros, that are used to annotate the function
> visibility by setting the respective __attribute__((visibility("bla"))).
>
> Signed-off-by: Emil Velikov <emil.l.velikov at gmail.com>
> ---
>   src/mesa_dri2.h | 17 +++++++++++++----
>   1 file changed, 13 insertions(+), 4 deletions(-)
>
> diff --git a/src/mesa_dri2.h b/src/mesa_dri2.h
> index 09bde8c..0b7dbf1 100644
> --- a/src/mesa_dri2.h
> +++ b/src/mesa_dri2.h
> @@ -37,17 +37,26 @@
>
>   #include <X11/extensions/dri2tokens.h>
>
> -extern Bool
> +#if (defined(__GNUC__) && __GNUC__ >= 4)
> +  #define PUBLIC  __attribute__ ((visibility("default")))

Do you plan on using PUBLIC for something later?  If not, I'd just drop 
them for now.  We can always add them later if we need them.

> +  #define PRIVATE __attribute__ ((visibility("hidden")))
> +#else
> +  #define PUBLIC
> +  #define PRIVATE
> +#endif
> +
> +
> +PRIVATE extern Bool
>   _vdp_DRI2QueryExtension(Display * display, int *eventBase, int *errorBase);
>
> -extern Bool
> +PRIVATE extern Bool
>   _vdp_DRI2QueryVersion(Display * display, int *major, int *minor);
>
> -extern Bool
> +PRIVATE extern Bool
>   _vdp_DRI2Connect(Display * display, XID window, char **driverName,
>                    char **deviceName);
>
> -extern void
> +PRIVATE extern void
>   _vdp_DRI2RemoveExtension(Display * display);
>
>   #endif
>



More information about the VDPAU mailing list