commit c12734230f00b338e22d94c8dda9a66af32b737e Author: Samuel Thibault Date: Tue Mar 25 20:40:05 2025 +0100 focuspoll: Force c++11 standard only when needed We need at least c++11 to get unique_ptr, but we can thus not force using c++11 any more nowadays, otherwise we get In file included from /usr/include/unicode/uenum.h:25, from /usr/include/unicode/ucnv.h:52, from /usr/include/libxml2/libxml/encoding.h:31, from /usr/include/libxml2/libxml/parser.h:812, from /usr/include/compiz/compiz.h:29, from /usr/include/compiz/compiz-plugin.h:29, from /usr/include/compiz/compiz-core.h:29, from focuspoll.cpp:36: /usr/include/unicode/localpointer.h:561:26: error: parameter declared 'auto' 561 | template | ^~~~ Because icu started requiring c++17 in its version 76. Leaving this empty makes gcc >= 11 assume c++17, and should fare fine on the long run. To avoid breaking building with gcc 10 and earlier which does not default to c++>=11, we can use ‘ac_prog_cxx_stdcxx’ to detect when -std=c++11 is needed. diff --git a/configure.ac b/configure.ac index 0860d99..fc61e6c 100644 --- a/configure.ac +++ b/configure.ac @@ -82,6 +82,11 @@ if test "x$GCC" = "xyes"; then fi fi +if test "$ac_prog_cxx_stdcxx" = "cxx98"; then + # Old gcc, we need to enable C++11 explicitly + CPPFLAGS="-std=c++11" +fi + AC_C_BIGENDIAN plugindir=$libdir/compiz diff --git a/src/focuspoll/Makefile.am b/src/focuspoll/Makefile.am index 16ec6c5..199acb0 100644 --- a/src/focuspoll/Makefile.am +++ b/src/focuspoll/Makefile.am @@ -16,8 +16,6 @@ AM_CPPFLAGS = \ -DLOCALEDIR="\"@datadir@/locale\"" \ -DIMAGEDIR='"$(imagedir)"' -AM_CXXFLAGS = -std=c++11 - moduledir = $(plugindir) if FOCUSPOLL_PLUGIN