Skip to content

Commit

Permalink
Fixed ptrdiff_t type support for MacOSX
Browse files Browse the repository at this point in the history
Signed-off-by: Steena Monteiro <[email protected]>
  • Loading branch information
steenax86 committed Jun 23, 2023
1 parent bacb12a commit b6307a4
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions src/include/OSL/encodedtypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ template<> struct TypeEncoder<int64_t> {

// On macOS 10.+ ptrdiff_t is a long, but on linux this
// specialization would conflict with int64_t
#if OSL_APPLE_CLANG_VERSION
#if defined(__APPLE__) && defined(__MACH__)
template<> struct TypeEncoder<ptrdiff_t> {
using DataType = int64_t;
static constexpr EncodedType value = EncodedType::kInt64;
Expand All @@ -127,14 +127,6 @@ template<> struct TypeEncoder<ptrdiff_t> {
};
#endif

// template<> struct TypeEncoder<std::ptrdiff_t> {
// using DataType = int64_t;
// static constexpr EncodedType value = EncodedType::kInt64;
// static_assert(size_of_encoded_type(value) == sizeof(DataType),
// "unexpected");
// static DataType Encode(const std::ptrdiff_t val) { return val; }
// };

template<> struct TypeEncoder<double> {
using DataType = double;
static constexpr EncodedType value = EncodedType::kDouble;
Expand Down

0 comments on commit b6307a4

Please sign in to comment.