]> git.lyx.org Git - lyx.git/commitdiff
Clean up after removal of strfwd.h
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Sat, 5 Oct 2024 13:04:51 +0000 (15:04 +0200)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Sat, 5 Oct 2024 13:15:21 +0000 (15:15 +0200)
Remove autoconf tests for whether std::string uses COW, since this is
forbidden by C++11 standard.

Forbid the use of gcc 4.9 (which still uses COW).

Remove code in debug.h that added forward declarations for LLVM's
libc++, since we do not do forward declarations anymore.

Remove configure test for libc++.

INSTALL
config/lyxinclude.m4
src/support/debug.h

diff --git a/INSTALL b/INSTALL
index 52044fa1f36c15f01bf0dcf298c94c5b7b2788c7..9d505dff33f2c2067ed3d8133018b1db7ad1e911 100644 (file)
--- a/INSTALL
+++ b/INSTALL
@@ -52,8 +52,9 @@ You will also probably need GNU m4 (perhaps installed as gm4).
 Requirements
 ------------
 
-First of all, you will need a C++11 standard conforming compiler, like g++ (at
-least 5.0, to have proper std::regex & std::string) or clang++.
+First of all, you will need a C++11 standard conforming compiler, like
+g++ (at least 5.0, to have proper std::regex & std::string) or
+clang++.
 
 LyX makes great use of the C++ Standard Library. This means that gcc
 users will have to install the relevant libstdc++ library to be able
index 03e40581c9049c8cf70c4d3f2832ab75785dcbae..2138a8482ef6a8d27486d4f26182fb472ed2a40c 100644 (file)
@@ -248,19 +248,6 @@ AC_DEFUN([LYX_LIB_STDCXX],
 ])
 
 
-dnl Usage: LYX_LIB_STDCXX_CXX11_ABI: set lyx_cv_lib_stdcxx_cxx11_abi to yes
-dnl        if the STL library is GNU libstdc++ and the C++11 ABI is used.
-AC_DEFUN([LYX_LIB_STDCXX_CXX11_ABI],
-[AC_CACHE_CHECK([whether STL is libstdc++ using the C++11 ABI],
-               [lyx_cv_lib_stdcxx_cxx11_abi],
-[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include<vector>]], [[
-#if ! defined(_GLIBCXX_USE_CXX11_ABI) || ! _GLIBCXX_USE_CXX11_ABI
-           this is not libstdc++ using the C++11 ABI
-#endif
-]])],[lyx_cv_lib_stdcxx_cxx11_abi=yes],[lyx_cv_lib_stdcxx_cxx11_abi=no])])
-])
-
-
 AC_DEFUN([LYX_PROG_CXX],
 [AC_REQUIRE([AC_PROG_CXX])
 AC_REQUIRE([AC_PROG_CXXCPP])
@@ -275,22 +262,9 @@ AC_LANG_PUSH(C++)
 LYX_PROG_CLANG
 LYX_CXX_CXX11_FLAGS($enable_cxx_mode)
 LYX_LIB_STDCXX
-LYX_LIB_STDCXX_CXX11_ABI
 LYX_CXX_USE_CALL_ONCE
 AC_LANG_POP(C++)
 
-if test $lyx_cv_lib_stdcxx = "yes" ; then
-  if test $lyx_cv_lib_stdcxx_cxx11_abi = "yes" ; then
-    AC_DEFINE(USE_GLIBCXX_CXX11_ABI, 1, [use GNU libstdc++ with C++11 ABI])
-  else
-    AC_DEFINE(STD_STRING_USES_COW, 1, [std::string uses copy-on-write])
-  fi
-else
-  if test $lyx_cv_prog_clang = "yes" ; then
-    AC_DEFINE(USE_LLVM_LIBCPP, 1, [use libc++ provided by llvm instead of GNU libstdc++])
-  fi
-fi
-
 ### We might want to get or shut warnings.
 AC_ARG_ENABLE(warnings,
   AS_HELP_STRING([--enable-warnings],[tell the compiler to display more warnings]),,
@@ -363,7 +337,7 @@ if test x$GXX = xyes; then
   fi
 
   case $gxx_version in
-      2.*|3.*|4.@<:@0-8@:>@*) AC_MSG_ERROR([gcc >= 4.9 is required]);;
+      2.*|3.*|4.*) AC_MSG_ERROR([gcc >= 5 is required]);;
   esac
 
   AM_CXXFLAGS="$lyx_optim $AM_CXXFLAGS"
index 6ab59b553899cbb9eacdf487edc39ffc3f8f0927..137016a99a8cddda4039030202dedd0b1748e2c8 100644 (file)
 
 #include "support/docstring.h"
 
-// Forward definitions do not work with libc++
-// but ios_base has already been defined in strfwd
-// if compiling with it
-#ifndef USE_LLVM_LIBCPP
-namespace std {
-
-class ios_base;
-
-template<typename CharT, typename Traits> class basic_streambuf;
-typedef basic_streambuf<char, char_traits<char> > streambuf;
-
-} // namespace std
-#endif
-
 
 // Make sure at compile time that sizeof(unsigned long long) >= 8
 typedef char p__LINE__[ (sizeof(unsigned long long) > 7) ? 1 : -1];