[Mesa-dev] [PATCH 4/9] configure.ac: define WL_HIDE_DEPRECATED at global scale

Pekka Paalanen pekka.paalanen at collabora.co.uk
Fri Sep 8 09:52:30 UTC 2017


On Thu,  7 Sep 2017 19:05:01 +0100
Emil Velikov <emil.l.velikov at gmail.com> wrote:

> From: Emil Velikov <emil.velikov at collabora.com>
> 
> Due to GCC feature described in previous commit, the expected
> deprecation warnings may be missing.
> 
> Set the WL_HIDE_DEPRECATED macro which will omit the deprecated
> functionality, resulting in more distinct build issues.
> 
> Patch is UNTESTED, see the open question below.
> 
> Cc: Pekka Paalanen <pekka.paalanen at collabora.co.uk>
> Suggested-by: Pekka Paalanen <pekka.paalanen at collabora.co.uk>
> Signed-off-by: Emil Velikov <emil.velikov at collabora.com>
> ---
> Pekka, I'm not 100% sold that having the macro all together is a good
> idea. Consider the following example:
> 
>  - Project X uses Wayland vY, set as min. requirement.
>  - Project X sets the 'hide' macro
>  - In nearly all cases, the check does not guard the upper version.
>  - Wayland vY+Z, deprecates (and hides) functionality A
>  - Project X fails to build against Wayland vY+Z

Hi Emil,

yes, that is exactly the problem of the macro: in reality, we cannot
add more stuff under it. It was a one-shot macro, it has been used, and
now the things it may hide have been carved in stone.

If we want to hide more stuff in libwayland API in a similar way, we
need a new macro per release or something.

In any case, using WL_HIDE_DEPRECATED in Mesa and extending it to cover
all code that deals with Wayland is a good thing, so:
Acked-by: Pekka Paalanen <pekka.paalanen at collabora.co.uk>


Thanks,
pq

> ---
>  configure.ac                    | 2 +-
>  src/egl/drivers/dri2/egl_dri2.c | 2 --
>  2 files changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/configure.ac b/configure.ac
> index d0d4c0dfd1d..f0368570b12 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -1713,7 +1713,7 @@ for plat in $platforms; do
>          if test "x$have_wayland_protocols" = xno; then
>                  AC_MSG_ERROR([wayland-protocols >= $WAYLAND_PROTOCOLS_REQUIRED is needed to compile the wayland platform])
>          fi
> -        DEFINES="$DEFINES -DHAVE_WAYLAND_PLATFORM"
> +        DEFINES="$DEFINES -DHAVE_WAYLAND_PLATFORM -DWL_HIDE_DEPRECATED"
>          ;;
>  
>      x11)
> diff --git a/src/egl/drivers/dri2/egl_dri2.c b/src/egl/drivers/dri2/egl_dri2.c
> index 2667aa5d647..60d5e1ffddf 100644
> --- a/src/egl/drivers/dri2/egl_dri2.c
> +++ b/src/egl/drivers/dri2/egl_dri2.c
> @@ -25,8 +25,6 @@
>   *    Kristian Høgsberg <krh at bitplanet.net>
>   */
>  
> -#define WL_HIDE_DEPRECATED
> -
>  #include <stdbool.h>
>  #include <stdint.h>
>  #include <stdbool.h>



More information about the mesa-dev mailing list