[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]


From: Moritz Klammler
Subject: [patch #8714] Unified AX_CXX_COMPILE_STDCXX_11 and AX_CXX_COMPILE_STDCXX_14 Macros
Date: Tue, 11 Aug 2015 02:19:55 +0000
User-agent: Mozilla/5.0 (Windows NT 6.1; rv:38.0) Gecko/20100101 Firefox/38.0


                 Summary: Unified AX_CXX_COMPILE_STDCXX_11 and
                 Project: GNU Autoconf Archive
            Submitted by: moritz_klammler
            Submitted on: Tue 11 Aug 2015 04:19:53 AM CEST
                Priority: 5 - Normal
                  Status: None
             Assigned to: None
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any



I find the `AX_CXX_COMPILE_STDCXX_11` macro very useful and have used it a lot
in the past.  Today, I wanted to use C++14 features and found that there was
no macro in the archive yet that would allow me to check for them, so I
started writing one.

Checking for a specific version of C++ should offer the same interface for all
versions and be using the same logic so I have factored the common logic out
of `AX_CXX_COMPILE_STDCXX_11` and created a new internal macro
`ax_cxx_compile_stdcxx_generic_impl.m4`) that accepts an additional parameter
-- the version of the standard.  This was very straight-forward because
`AX_CXX_COMPILE_STDCXX_11` already separated M4 and C++ code.

There is also a code-sharing opportunity at the C++ level.  Since C++14 is a
strict superset of C++11, I found that it would be best to use all the code
for the C++11 check and then some code specific for C++14 if checking for the
latter.  For this, I have defined the two macros
`_AX_CXX_COMPILE_STDCXX_testbody_new_in_11` and
`_AX_CXX_COMPILE_STDCXX_testbody_new_in_14` (also in the file

While doing this, I have also added more C++11 checks, introduced a consistent
style and tried to check one feature at a time with hopefully self-explanatory
checks.  To speed up the checks, I have wrapped the test code into `#if
__cplusplus >= ...` blocks.  I hope this was a good idea.

The new macros work fine for me but I'm not sure whether the splitting into
multiple macro files and the documentation of the internal
`ax_cxx_compile_stdcxx_generic_impl.m4` file is in accordance with the rules
for the macro archive.  I could put all the code into a single file but then I
would violate the "one file per macro" rule unless I'd expose the generic
macro that accepts the language version as a parameter.  But doing so would
leave duplicated functionality in the existing `AX_CXX_COMPILE_STDCXX_11`
macro.  There also is `AX_CXX_COMPILE_STDCXX_0X` which I thought would be an
alias for `AX_CXX_COMPILE_STDCXX_11` but it isn't.  What should we do about
this macro?

I'd be glad if somebody more acquainted with the rules of the macro archive
could review my submission and tell me what to do in order to get it accepted.


File Attachments:

Date: Tue 11 Aug 2015 04:19:53 AM CEST  Name: ax_cxx_compile_stdcxx_11.m4 
Size: 2kB   By: moritz_klammler

Date: Tue 11 Aug 2015 04:19:53 AM CEST  Name:
ax_cxx_compile_stdcxx_generic_impl.m4  Size: 11kB   By: moritz_klammler

Date: Tue 11 Aug 2015 04:19:53 AM CEST  Name: ax_cxx_compile_stdcxx_14.m4 
Size: 2kB   By: moritz_klammler



Reply to this item at:


  Message sent via/by Savannah

reply via email to

[Prev in Thread] Current Thread [Next in Thread]