Enforce the availability of std::byte

MS-STL has an opt-out that makes std::byte unavailable.
This causes build errors in our headers in case client code opts out,
so detect this case and provide a clean(er) error message.

Change-Id: Iec0790f4c33eb876a98e2e34afbc9889f42333b5
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 5a3859e0a455d82aea9e7c09b87f0dec91dec4e9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Giuseppe D'Angelo 2024-10-22 11:57:25 +02:00 committed by Qt Cherry-pick Bot
parent 25b754dbf1
commit 41eccd318a

View File

@ -12,6 +12,9 @@
#ifdef __cplusplus
# include <cstddef>
# if defined(_HAS_STD_BYTE) && _HAS_STD_BYTE == 0
# error "Qt requires std::byte, but _HAS_STD_BYTE has been set to 0"
# endif
# include <cstdint>
# if defined(__STDCPP_FLOAT16_T__) && __has_include(<stdfloat>)
// P1467 implementation - https://wg21.link/p1467