Skip to content

Commit

Permalink
Fix compilation on MSVC
Browse files Browse the repository at this point in the history
MSVC complains about `(long double){}` so let's rephrase it.

PiperOrigin-RevId: 590297660
  • Loading branch information
majnemer authored and The ml_dtypes Authors committed Dec 12, 2023
1 parent 34d9e4e commit c9b4c64
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ml_dtypes/_src/int4_numpy.h
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,8 @@ bool CastToInt4(PyObject* arg, T* output) {
return floating_conversion(double{});
}
if (PyArray_IsScalar(arg, LongDouble)) {
return floating_conversion((long double){});
using ld = long double;
return floating_conversion(ld{});
}
return false;
}
Expand Down

0 comments on commit c9b4c64

Please sign in to comment.