Skip to content

Commit

Permalink
Fix check for the availability of std::bit_cast
Browse files Browse the repository at this point in the history
See AcademySoftwareFoundation#346: Checking for the language version is not going to help for
incomplete libraries such as on Apple or Android. This fixes this by
using the bit_cast-specific macro.

Signed-off-by: Cary Phillips <[email protected]>
  • Loading branch information
cary-ilm committed Sep 19, 2023
1 parent 4d4e01c commit 3793cf3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/ImathTest/testFun.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#endif

#include <ImathFun.h>
#if __cplusplus >= 202002L
#if defined(__cpp_lib_bit_cast) && __cpp_lib_bit_cast >= 201806L
# include <bit>
#endif
#include "testFun.h"
Expand All @@ -20,7 +20,7 @@

using namespace std;

#if __cplusplus < 202002L
#if !defined(__cpp_lib_bit_cast) || __cpp_lib_bit_cast < 201806L
template <typename To, typename From>
static inline To
bit_cast (From from)
Expand Down

0 comments on commit 3793cf3

Please sign in to comment.