Skip to content

Commit dae3b6b

Browse files
committed
Fix type comparison for Windows
1 parent 579e063 commit dae3b6b

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

include/openPMD/backend/PatchRecordComponent.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,8 @@ template <typename T>
122122
inline void PatchRecordComponent::load(std::shared_ptr<T> data)
123123
{
124124
Datatype dtype = determineDatatype<T>();
125-
if (dtype != getDatatype())
125+
// Attention: Do NOT use operator==(), doesnt work properly on Windows!
126+
if (!isSame(dtype, getDatatype()))
126127
throw std::runtime_error(
127128
"Type conversion during particle patch loading not yet "
128129
"implemented");

src/RecordComponent.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -834,7 +834,7 @@ void RecordComponent::loadChunk(std::shared_ptr<T> data, Offset o, Extent e)
834834
* constant component. The frontend needs to catch such edge cases.
835835
* Ref. `if (constant())` branch.
836836
*/
837-
if (dtype != getDatatype() && !constant())
837+
if (!isSame(dtype, getDatatype()) && !constant())
838838
{
839839
std::string const data_type_str = datatypeToString(getDatatype());
840840
std::string const requ_type_str =

0 commit comments

Comments
 (0)