[Mesa-dev] [PATCH 1/9] android: always set __STDC_*_MACROS for C++ sources
Jose Fonseca
jfonseca at vmware.com
Thu Jan 26 17:18:56 UTC 2017
On 26/01/17 13:24, Emil Velikov wrote:
> From: Emil Velikov <emil.velikov at collabora.com>
>
> Various parts of the code depend on the macros being defined.
>
> Just set those unconditionally, only where needed (c++ sources) so that
> we can drop the workarounds through the code.
>
> Cc: Rob Herring <robh at kernel.org>
> Cc: Chih-Wei Huang <cwhuang at android-x86.org>
> Signed-off-by: Emil Velikov <emil.velikov at collabora.com>
> ---
> UNTESTED
> ---
> Android.common.mk | 11 ++++++-----
> 1 file changed, 6 insertions(+), 5 deletions(-)
>
> diff --git a/Android.common.mk b/Android.common.mk
> index 30166a620b..4fa02ae052 100644
> --- a/Android.common.mk
> +++ b/Android.common.mk
> @@ -44,7 +44,6 @@ LOCAL_CFLAGS += \
>
> LOCAL_CFLAGS += \
> -DENABLE_SHADER_CACHE \
> - -D__STDC_LIMIT_MACROS \
> -DHAVE___BUILTIN_EXPECT \
> -DHAVE___BUILTIN_FFS \
> -DHAVE___BUILTIN_FFSLL \
> @@ -64,6 +63,11 @@ LOCAL_CFLAGS += \
> -fvisibility=hidden \
> -Wno-sign-compare
>
> +LOCAL_CPPFLAGS += \
> + -D__STDC_CONSTANT_MACROS \
> + -D__STDC_FORMAT_MACROS \
> + -D__STDC_LIMIT_MACROS
> +
> # mesa requires at least c99 compiler
> LOCAL_CONLYFLAGS += \
> -std=c99
> @@ -78,10 +82,7 @@ endif
>
> ifeq ($(MESA_ENABLE_LLVM),true)
> LOCAL_CFLAGS += \
> - -DHAVE_LLVM=0x0305 -DMESA_LLVM_VERSION_PATCH=2 \
> - -D__STDC_CONSTANT_MACROS \
> - -D__STDC_FORMAT_MACROS \
> - -D__STDC_LIMIT_MACROS
> + -DHAVE_LLVM=0x0305 -DMESA_LLVM_VERSION_PATCH=2
> endif
>
> ifneq ($(LOCAL_IS_HOST_MODULE),true)
>
Series looks great to me. Thanks for the nice cleanup Emil.
Reviewed-by: Jose Fonseca <jfonseca at vmware.com>
More information about the mesa-dev
mailing list