Skip to content

Commit

Permalink
Only #include <stdfloat> on MSVC when in C++23 mode to remove a warni…
Browse files Browse the repository at this point in the history
…ng (#930)

* Only #include <stdfloat> on MSVC when in C++23 mode to remove a warning

The __has_include test for <stdfloat> returns true even in C++20 because the file exists, but the stdfloat header emits an error when not compiled with C++23.

Fixes #929

* Simplified condition for #including <stdfloat> thanks to gregmarr
  • Loading branch information
bluetarpmedia authored Jan 16, 2024
1 parent aee3816 commit 68120f8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion include/cpp2util.h
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,9 @@
#endif
#include <stdexcept>
#if __has_include(<stdfloat>)
#include <stdfloat>
#if !defined(_MSC_VER) || _HAS_CXX23
#include <stdfloat>
#endif
#endif
#ifdef __cpp_lib_jthread
#include <stop_token>
Expand Down

0 comments on commit 68120f8

Please sign in to comment.