[vlc-devel] [PATCH] m4/stdcxx_11: enable compilation with GCC 4.8.x

Rémi Denis-Courmont remi at remlab.net
Tue Feb 7 18:04:11 CET 2017


Le tiistaina 7. helmikuuta 2017, 2.39.41 EET Jan Ekström a écrit :
> The tested functionality is not utilized in actual VLC code, and
> it exists in GCC 4.8.x, albeit under an incorrect name. 4.8.x is
> still utilized in LTS systems, such as Ubuntu 14.04.

AFAIU, the guideline is to support the last Ubuntu LTS and Debian (stable) 
releases. I don´t really see the point in supporting the Ubuntu 14.04 
toolchain.

Also, the C++11 ABI in GCC 4.8 is notoriously broken. So I would argue that 
supporting it is giving people the gun to shoot themselves in the feet.

> ---
>  m4/stdcxx_11.m4 | 12 +++++++++++-
>  1 file changed, 11 insertions(+), 1 deletion(-)
> 
> diff --git a/m4/stdcxx_11.m4 b/m4/stdcxx_11.m4
> index 59df0a0..0c515ae 100644
> --- a/m4/stdcxx_11.m4
> +++ b/m4/stdcxx_11.m4
> @@ -87,10 +87,20 @@ m4_define([_AX_CXX_COMPILE_STDCXX_11_testbody], [[
>      #include <climits>
>      #include <cstddef>
> 
> +    #define MAX_ALIGN std::max_align_t
> +
> +    #if defined(__GNUC__) && defined(__GNUC_MINOR__) && !defined(__clang__)
> +    #define GCC_VERSION (__GNUC__ * 100 + __GNUC_MINOR__)
> +    #if GCC_VERSION <= 408
> +    #undef MAX_ALIGN
> +    #define MAX_ALIGN ::max_align_t
> +    #endif
> +    #endif
> +
>      constexpr uint64_t constant_u64 = UINT64_C(0x100000000);
>      constexpr unsigned constant_lim = UINT_MAX;
>      const char *constant_fmt = "%" PRIu64, *constant_scn = "%" SCNu64;
> -    constexpr size_t constant_align = alignof (std::max_align_t);
> +    constexpr size_t constant_align = alignof (MAX_ALIGN);
>  ]])
> 
>  AC_DEFUN([AX_CXX_COMPILE_STDCXX_11], [dnl


-- 
雷米‧德尼-库尔蒙
https://www.remlab.net/



More information about the vlc-devel mailing list