From 091fc81d485594d4b751c10518230769c905430c Mon Sep 17 00:00:00 2001 From: Konstantin Varlamov Date: Tue, 6 Feb 2024 13:45:31 -0800 Subject: [libc++][hardening] Check that `_LIBCPP_HARDENING_MODE_DEFAULT` is defined (#80353) If the `_LIBCPP_HARDENING_MODE_DEFAULT` macro is not defined, `_LIBCPP_HARDENING_MODE` will be considered defined but fail the check for a valid hardening mode, resulting in a slightly less understandable error (that error is really meant more to prevent users from passing incorrect values such as `0` or `1` directly rather than catching configuration issues). --- libcxx/include/__config | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/libcxx/include/__config b/libcxx/include/__config index d356960..0797880 100644 --- a/libcxx/include/__config +++ b/libcxx/include/__config @@ -325,6 +325,12 @@ // clang-format on # ifndef _LIBCPP_HARDENING_MODE + +# ifndef _LIBCPP_HARDENING_MODE_DEFAULT +# error _LIBCPP_HARDENING_MODE_DEFAULT is not defined. This definition should be set at configuration time in the \ +`__config_site` header, please make sure your installation of libc++ is not broken. +# endif + # define _LIBCPP_HARDENING_MODE _LIBCPP_HARDENING_MODE_DEFAULT # endif -- cgit v1.1