libstdc++: Add #error to some files that depend on a specific standard mode

Give more explicit errors if these files are not built with the correct
-std options.

libstdc++-v3/ChangeLog:

	* src/c++98/locale_init.cc: Require C++11.
	* src/c++98/localename.cc: Likewise.
	* src/c++98/misc-inst.cc: Require C++98.
This commit is contained in:
Jonathan Wakely 2021-08-12 13:33:43 +01:00
parent 432de08498
commit d3a7fbcb7c
3 changed files with 12 additions and 0 deletions

View File

@ -20,6 +20,10 @@
// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
// <http://www.gnu.org/licenses/>.
#if __cplusplus != 201103L
# error This file must be compiled as C++11
#endif
#define _GLIBCXX_USE_CXX11_ABI 1
#include <clocale>
#include <cstring>

View File

@ -20,6 +20,10 @@
// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
// <http://www.gnu.org/licenses/>.
#if __cplusplus != 201103L
# error This file must be compiled as C++11
#endif
#define _GLIBCXX_USE_CXX11_ABI 1
#include <clocale>
#include <cstring>

View File

@ -26,6 +26,10 @@
// ISO C++ 14882:
//
#if __cplusplus != 199711L
# error This file must be compiled as C++98
#endif
#define _GLIBCXX_USE_CXX11_ABI 1
#define _GLIBCXX_DISAMBIGUATE_REPLACE_INST 1
#include <string>