[Mesa-dev] [PATCH v3 3/3] vulkan: use STATIC_ASSERT instead of static_assert

Jason Ekstrand jason at jlekstrand.net
Wed Dec 7 01:58:23 UTC 2016


Reviewed-by: Jason Ekstrand <jason at jlekstrand.net>

On Tue, Dec 6, 2016 at 3:30 PM, Edward O'Callaghan <
funfunctor at folklore1984.net> wrote:

> Following the spirit of commit 23d1799f, fixes compilation
> warnings on Android build due to lack of C11 features.
>
> Signed-off-by: Edward O'Callaghan <funfunctor at folklore1984.net>
> ---
>  src/amd/vulkan/radv_private.h       | 2 +-
>  src/vulkan/wsi/wsi_common_wayland.c | 2 +-
>  src/vulkan/wsi/wsi_common_x11.c     | 2 +-
>  3 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/src/amd/vulkan/radv_private.h b/src/amd/vulkan/radv_private.h
> index def0af2..4b72017 100644
> --- a/src/amd/vulkan/radv_private.h
> +++ b/src/amd/vulkan/radv_private.h
> @@ -173,7 +173,7 @@ radv_clear_mask(uint32_t *inout_mask, uint32_t
> clear_mask)
>              __dword &= ~(1 << (b)))
>
>  #define typed_memcpy(dest, src, count) ({                              \
> -                       static_assert(sizeof(*src) == sizeof(*dest), ""); \
> +                       STATIC_ASSERT(sizeof(*src) == sizeof(*dest)); \
>                         memcpy((dest), (src), (count) * sizeof(*(src))); \
>                 })
>
> diff --git a/src/vulkan/wsi/wsi_common_wayland.c
> b/src/vulkan/wsi/wsi_common_wayland.c
> index f6c218b..2fe889e 100644
> --- a/src/vulkan/wsi/wsi_common_wayland.c
> +++ b/src/vulkan/wsi/wsi_common_wayland.c
> @@ -38,7 +38,7 @@
>  #include <util/u_vector.h>
>
>  #define typed_memcpy(dest, src, count) ({ \
> -   static_assert(sizeof(*src) == sizeof(*dest), ""); \
> +   STATIC_ASSERT(sizeof(*src) == sizeof(*dest)); \
>     memcpy((dest), (src), (count) * sizeof(*(src))); \
>  })
>
> diff --git a/src/vulkan/wsi/wsi_common_x11.c b/src/vulkan/wsi/wsi_common_
> x11.c
> index 56398ce..25ba0c1 100644
> --- a/src/vulkan/wsi/wsi_common_x11.c
> +++ b/src/vulkan/wsi/wsi_common_x11.c
> @@ -42,7 +42,7 @@
>  #include "wsi_common_queue.h"
>
>  #define typed_memcpy(dest, src, count) ({ \
> -   static_assert(sizeof(*src) == sizeof(*dest), ""); \
> +   STATIC_ASSERT(sizeof(*src) == sizeof(*dest)); \
>     memcpy((dest), (src), (count) * sizeof(*(src))); \
>  })
>
> --
> 2.9.3
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20161206/4183a822/attachment.html>


More information about the mesa-dev mailing list