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

Jan Ekström jeebjp at gmail.com
Tue Feb 7 01:39:41 CET 2017


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.
---
 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
-- 
2.9.3



More information about the vlc-devel mailing list