Skip to content

Endian issue FreeBSD/powerpc64 (Big Endian) #1655

Open
@lenoil98

Description

@lenoil98

Build on FreeBSD/powerpc64 (big endian) failed with error:

FAILED: CMakeFiles/engine-lib.dir/src/common/cm/cm_load.cpp.o
/usr/bin/c++ -DBUILD_ENGINE -DDAEMON_ARCH_ppc64 -DDAEMON_BUILD_Release -DDAEMON_CXX_COMPILER_Clang=1 -DDAEMON_C_COMPILER_Clang=1 -DDAEMON_OPENGL_ABI -DDAEMON_OPENGL_ABI_LEGACY -DDAEMON_USE_ARCH_INTRINSICS=1 -DDAEMON_USE_ARCH_INTRINSICS_ppc64=1 -DDAEMON_USE_COMPILER_CUSTOMIZATION=1 -DDAEMON_USE_COMPILER_INTRINSICS=1 -DNACL_ANDROID=0 -DNACL_FREEBSD=1 -DNACL_LINUX=0 -DNACL_OSX=0 -DNACL_WINDOWS=0 -DTHIS_IS_NOT_A_DEBUG_BUILD -DUSE_CURSES -DUSE_CURSES_NCURSES -DUSE_MUMBLE -I/root/Devel/Daemon/build/GeneratedSource -I/root/Devel/Daemon/src -I/root/Devel/Daemon/libs -I/root/Devel/Daemon/libs/nacl -I/usr/local/include -I/root/Devel/Daemon/CURSESW_NCURSESW_INCLUDE_PATH-NOTFOUND/ncursesw -I/usr/local/include/opus -I/usr/local/include/freetype2 -I/usr/local/include/AL -I/root/Devel/Daemon/src/engine -std=gnu++14 -fvisibility=hidden -fno-strict-aliasing -pthread -fPIC -O3 -DNDEBUG -D_FORTIFY_SOURCE=2 -Wall -Wextra -Wno-pragmas -Wno-unknown-pragmas -Wno-missing-field-initializers -Wno-old-style-cast -Woverloaded-virtual -Wno-sign-compare -MD -MT CMakeFiles/engine-lib.dir/src/common/cm/cm_load.cpp.o -MF CMakeFiles/engine-lib.dir/src/common/cm/cm_load.cpp.o.d -o CMakeFiles/engine-lib.dir/src/common/cm/cm_load.cpp.o -c /root/Devel/Daemon/src/common/cm/cm_load.cpp
/root/Devel/Daemon/src/common/cm/cm_load.cpp:669:8: error: no matching function for call to 'Swap32'
669 | if ( LittleLong( in->surfaceType ) == mapSurfaceType_t::MST_PATCH )
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/root/Devel/Daemon/src/common/Endian.h:201:23: note: expanded from macro 'LittleLong'
201 | #define LittleLong(x) Swap32(x)
| ^~~~~~
/root/Devel/Daemon/src/common/Endian.h:134:16: note: candidate function not viable: no known conversion from 'mapSurfaceType_t' to 'int32_t' (aka 'int') for 1st argument
134 | inline int32_t Swap32(int32_t x)
| ^ ~~~~~~~~~
/root/Devel/Daemon/src/common/cm/cm_load.cpp:669:38: error: invalid operands to binary expression ('int32_t' (aka 'int') and 'mapSurfaceType_t')
669 | if ( LittleLong( in->surfaceType ) == mapSurfaceType_t::MST_PATCH )
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~
/root/Devel/Daemon/src/common/cm/cm_load.cpp:701:13: error: no matching function for call to 'Swap32'
701 | else if ( LittleLong( in->surfaceType ) == mapSurfaceType_t::MST_TRIANGLE_SOUP && ( cm.perPolyCollision || cm_forceTriangles.Get() ) )
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/root/Devel/Daemon/src/common/Endian.h:201:23: note: expanded from macro 'LittleLong'
201 | #define LittleLong(x) Swap32(x)
| ^~~~~~
/root/Devel/Daemon/src/common/Endian.h:134:16: note: candidate function not viable: no known conversion from 'mapSurfaceType_t' to 'int32_t' (aka 'int') for 1st argument
134 | inline int32_t Swap32(int32_t x)
| ^ ~~~~~~~~~
/root/Devel/Daemon/src/common/cm/cm_load.cpp:701:43: error: invalid operands to binary expression ('int32_t' (aka 'int') and 'mapSurfaceType_t')
701 | else if ( LittleLong( in->surfaceType ) == mapSurfaceType_t::MST_TRIANGLE_SOUP && ( cm.perPolyCollision || cm_forceTriangles.Get() ) )
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4 errors generated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions