Skip to content
This repository was archived by the owner on Jul 15, 2023. It is now read-only.

Commit 6cce140

Browse files
committed
Disable Ogawa on big-endian systems. Bumped version to 1.7.2.
1 parent 39b8397 commit 6cce140

File tree

2 files changed

+18
-2
lines changed

2 files changed

+18
-2
lines changed

export/Field3DFile.h

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -661,7 +661,23 @@ class FIELD3D_API Field3DOutputFile : public Field3DFileBase
661661

662662
//! Whether to output ogawa files
663663
static void useOgawa(const bool enabled)
664-
{ ms_doOgawa = enabled; }
664+
{
665+
// simple temporary endian check
666+
union {
667+
uint32_t l;
668+
char c[4];
669+
} u;
670+
671+
u.l = 0x01234567;
672+
673+
if (u.c[0] == 0x67) {
674+
ms_doOgawa = enabled;
675+
} else {
676+
std::cerr << "WARNING: Field3D only supports Ogawa-backed files "
677+
<< "on little-endian systems." << std::endl;
678+
ms_doOgawa = false;
679+
}
680+
}
665681

666682
//! \name Writing layer to disk
667683
//! \{

export/ns.h

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

3838
#define FIELD3D_MAJOR_VER 1
3939
#define FIELD3D_MINOR_VER 7
40-
#define FIELD3D_MICRO_VER 1
40+
#define FIELD3D_MICRO_VER 2
4141

4242
#define FIELD3D_VERSION_NS v1_7
4343

0 commit comments

Comments
 (0)