Skip to content

Commit b09e75b

Browse files
committed
Use sizeof(long double) == sizeof(double) instead of std::is_same<>
1 parent 8abe0e9 commit b09e75b

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

tests/test_buffers.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
#include "pybind11_tests.h"
1515

1616
TEST_SUBMODULE(buffers, m) {
17-
m.attr("std_is_same_double_long_double") = std::is_same<double, long double>::value;
17+
m.attr("long_double_and_double_have_same_size") = (sizeof(long double) == sizeof(double));
1818

1919
m.def("format_descriptor_format_buffer_info_compare",
2020
[](const std::string &cpp_name, const py::buffer &buffer) {

tests/test_buffers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
np = pytest.importorskip("numpy")
1212

13-
if m.std_is_same_double_long_double: # Windows.
13+
if m.long_double_and_double_have_same_size: # Windows.
1414
np_float128 = None
1515
np_complex256 = None
1616
else:

0 commit comments

Comments
 (0)