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

2017-09-08 Thread Pekka Paalanen
On Thu,  7 Sep 2017 19:05:01 +0100
Emil Velikov  wrote:

> From: Emil Velikov 
> 
> 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 
> Suggested-by: Pekka Paalanen 
> Signed-off-by: Emil Velikov 
> ---
> 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 


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 
>   */
>  
> -#define WL_HIDE_DEPRECATED
> -
>  #include 
>  #include 
>  #include 

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


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

2017-09-08 Thread Emil Velikov
On 8 September 2017 at 10:52, Pekka Paalanen
 wrote:
> On Thu,  7 Sep 2017 19:05:01 +0100
> Emil Velikov  wrote:
>
>> From: Emil Velikov 
>>
>> 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 
>> Suggested-by: Pekka Paalanen 
>> Signed-off-by: Emil Velikov 
>> ---
>> 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 
>
Smashing, thanks for the confirmation.
I'll send a patch to Wayland that documents things and adds a "don't
add stuff here" note ;-)

-Emil
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


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

2017-09-07 Thread Emil Velikov
From: Emil Velikov 

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 
Suggested-by: Pekka Paalanen 
Signed-off-by: Emil Velikov 
---
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
---
 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 
  */
 
-#define WL_HIDE_DEPRECATED
-
 #include 
 #include 
 #include 
-- 
2.14.1

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev