[RFC wayland v1 1/1] private, server: Make define consistent, reorder include

Pekka Paalanen ppaalanen at gmail.com
Tue Jun 7 13:29:19 UTC 2016


On Mon, 23 May 2016 19:54:05 -0600
Yong Bakos <junk at humanoriented.com> wrote:

> From: Yong Bakos <ybakos at humanoriented.com>
> 
> wayland-private.h defines WL_HIDE_DEPRECATED with a token-string, which
> is unnecessary. Remove the token-string from the define.
> 
> wayland-server.h includes wayland-server-protocol.h at the end of the file,
> after the ifndef WL_HIDE_DEPRECATED block, but it is not necessary for the
> include to follow the ifndef block. Move the include to the top of the file,
> for clarity.
> 
> Place the use of extern "C" inside the ifndef WL_HIDE_DEPRECATED block, since
> an empty extern "C" block would be pointless.
> 
> Signed-off-by: Yong Bakos <ybakos at humanoriented.com>
> ---
>  src/wayland-private.h | 2 +-
>  src/wayland-server.h  | 9 ++++-----
>  2 files changed, 5 insertions(+), 6 deletions(-)
> 
> diff --git a/src/wayland-private.h b/src/wayland-private.h
> index 045109b..14baf28 100644
> --- a/src/wayland-private.h
> +++ b/src/wayland-private.h
> @@ -31,7 +31,7 @@
>  #include <stdarg.h>
>  #include <stdlib.h>
> 
> -#define WL_HIDE_DEPRECATED 1
> +#define WL_HIDE_DEPRECATED

This looks a little odd to me. autoconf generated config.h also
#defines things to 1 when they are "true".

> 
>  #include "wayland-util.h"
> 
> diff --git a/src/wayland-server.h b/src/wayland-server.h
> index 3124703..156e39d 100644
> --- a/src/wayland-server.h
> +++ b/src/wayland-server.h
> @@ -37,13 +37,14 @@
>  #define WAYLAND_SERVER_H
> 
>  #include "wayland-server-core.h"
> +#include "wayland-server-protocol.h"
> +
> +#ifndef WL_HIDE_DEPRECATED
> 
>  #ifdef  __cplusplus
>  extern "C" {
>  #endif
> 
> -#ifndef WL_HIDE_DEPRECATED
> -
>  struct wl_object {
>  	const struct wl_interface *interface;
>  	const void *implementation;
> @@ -90,12 +91,10 @@ void
>  wl_display_remove_global(struct wl_display *display,
>  			 struct wl_global *global) WL_DEPRECATED;
> 
> -#endif
> -
>  #ifdef  __cplusplus
>  }
>  #endif
> 
> -#include "wayland-server-protocol.h"
> +#endif

I think the old ordering was left to mimic the original header where
these were pulled out from.

wayland-server-protocol.h depends on some of the function declarations
that used to be below the deprecated block.


Thanks,
pq
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 811 bytes
Desc: OpenPGP digital signature
URL: <https://lists.freedesktop.org/archives/wayland-devel/attachments/20160607/10c9a0f7/attachment.sig>


More information about the wayland-devel mailing list