Skip to content

Commit

Permalink
Fix check for the availability of std::bit_cast (#350)
Browse files Browse the repository at this point in the history
See #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 <cary@ilm.com>
  • Loading branch information
cary-ilm authored Oct 12, 2023
1 parent 0e0f4a7 commit e92af36
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 e92af36

Please sign in to comment.