Skip to content

Commit f6db204

Browse files
committed
Merge remote-tracking branch 'origin/v10-minor'
2 parents 1d02391 + 7ed2d1f commit f6db204

File tree

2 files changed

+26
-2
lines changed

2 files changed

+26
-2
lines changed

CHANGELOG

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ Fixed bugs
6969

7070
- fixed call of SCIPcreateConsBasicSOCNonlinear() with coefs being NULL, and fixed check for offsets being finite
7171
- avoid crash when initial IIS solve fails while reporting errors explicitly
72+
- fixed failure in nl writing on big endian machines
7273

7374

7475
@section RN1000 SCIP 10.0.0

src/amplmp/src/dtoa.cpp

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,30 @@ extern void *REALLOC(void*,size_t);
278278
static double private_mem[PRIVATE_mem], *pmem_next = private_mem;
279279
#endif
280280

281+
// SV added define of IEEE_MC68k or IEEE_8087, depending on guess of endianness
282+
#if defined(__BYTE_ORDER) && __BYTE_ORDER == __BIG_ENDIAN || \
283+
defined(__BIG_ENDIAN__) || \
284+
defined(__ARMEB__) || \
285+
defined(__THUMBEB__) || \
286+
defined(__AARCH64EB__) || \
287+
defined(_MIBSEB) || defined(__MIBSEB) || defined(__MIBSEB__)
288+
// It's a big-endian target architecture
289+
#define IEEE_MC68k
290+
#elif defined(__BYTE_ORDER) && __BYTE_ORDER == __LITTLE_ENDIAN || \
291+
defined(__LITTLE_ENDIAN__) || \
292+
defined(__ARMEL__) || \
293+
defined(__THUMBEL__) || \
294+
defined(__AARCH64EL__) || \
295+
defined(_MIPSEL) || defined(__MIPSEL) || defined(__MIPSEL__)
296+
// It's a little-endian target architecture
297+
#define IEEE_8087
298+
#else
299+
#ifndef _MSC_VER // MSVS does not have #warning
300+
#warning "Not recognizing endianness of architecture, assuming little endian."
301+
#endif
302+
#define IEEE_8087
303+
#endif
304+
281305
#undef IEEE_Arith
282306
#undef Avoid_Underflow
283307
#ifdef IEEE_MC68k
@@ -349,8 +373,7 @@ static double private_mem[PRIVATE_mem], *pmem_next = private_mem;
349373
extern "C" {
350374
#endif
351375

352-
#define IEEE_8087
353-
#define IEEE_Arith
376+
// SV removed define of IEEE_8087 and IEEE_Arith - they are defined at the top now
354377
#if defined(IEEE_8087) + defined(IEEE_MC68k) + defined(VAX) + defined(IBM) != 1
355378
Exactly one of IEEE_8087, IEEE_MC68k, VAX, or IBM should be defined.
356379
#endif

0 commit comments

Comments
 (0)