From 4764c5104abe0acf28ae520e521fec9819fee3d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20D=C3=BCrrenberger?= Date: Thu, 9 Jan 2025 15:24:52 +0100 Subject: [PATCH] Add a C++ language version check --- include/SFML/Config.hpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/include/SFML/Config.hpp b/include/SFML/Config.hpp index 8626a5004..3df34840d 100644 --- a/include/SFML/Config.hpp +++ b/include/SFML/Config.hpp @@ -111,6 +111,14 @@ #endif +//////////////////////////////////////////////////////////// +// Ensure minimum C++ language standard version is met +//////////////////////////////////////////////////////////// +#if (defined(_MSVC_LANG) && _MSVC_LANG < 201703L) || (!defined(_MSVC_LANG) && __cplusplus < 201703L) +#error "Enable C++17 or newer for your compiler (e.g. -std=c++17 for GCC/Clang or /std:c++17 for MSVC)" +#endif + + //////////////////////////////////////////////////////////// // Portable debug macro ////////////////////////////////////////////////////////////