From a3541f853c2f59901be1b5c7c7a0341521b9684e Mon Sep 17 00:00:00 2001 From: pkubaj Date: Thu, 4 Apr 2019 08:05:31 +0200 Subject: [PATCH] Fix build on big-endian platforms GCC 8 complains that it can't find relevant functions: /wrkdirs/usr/ports/games/gzdoom/work/gzdoom-g3.7.2/src/m_png.cpp:669:42: error: call of overloaded 'BigLong(uint32_t)' is ambiguous chunklen = BigLong((unsigned int)x[1]); ^ In file included from /wrkdirs/usr/ports/games/gzdoom/work/gzdoom-g3.7.2/src/m_png.cpp:44: /wrkdirs/usr/ports/games/gzdoom/work/gzdoom-g3.7.2/src/m_swap.h:212:15: note: candidate: 'long unsigned int BigLong(long unsigned int)' unsigned long BigLong(unsigned long) = delete; ^~~~~~~ /wrkdirs/usr/ports/games/gzdoom/work/gzdoom-g3.7.2/src/m_swap.h:213:6: note: candidate: 'long int BigLong(long int)' long BigLong(long) = delete; This is on FreeBSD/powerpc64. --- src/utility/m_swap.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/utility/m_swap.h b/src/utility/m_swap.h index a3e03bea2a..f5b90770fe 100644 --- a/src/utility/m_swap.h +++ b/src/utility/m_swap.h @@ -129,6 +129,16 @@ inline int BigLong(int &x) return x; } +inline unsigned int BigLong(unsigned int x) +{ + return x; +} + +inline int BigLong(int x) +{ + return x; +} + #else inline short LittleShort(short x)