liblcf icon indicating copy to clipboard operation
liblcf copied to clipboard

Possibly missing byte order swapping when using autotools

Open carstene1ns opened this issue 4 years ago • 3 comments
trafficstars

While configuring, this warning is shown:

configure.ac:82: warning: AC_C_BIGENDIAN should be used with AC_CONFIG_HEADERS

Reason is AC_C_BIGENDIAN wants to define WORDS_BIGENDIAN (which we use), but since we do not use the normal config.h anymore, this is not possible. This at least affects the Wii version and Apple universal builds (uncommon nowadays).

carstene1ns avatar Jan 15 '21 04:01 carstene1ns

We could make this a runtime check. The idiom used in the player is recognized by GCC and replaced with a constant during compile.

Ghabry avatar Jan 15 '21 09:01 Ghabry

though this still appears to work. WORDS_BIGENDIAN is correctly passed on the command line

Ghabry avatar Nov 07 '21 20:11 Ghabry

Yes, the issue is about universal builds mostly.

From config.h in Player:

/* Define if building universal (internal helper macro) */
/* #undef AC_APPLE_UNIVERSAL_BUILD */



/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
   significant byte first (like Motorola and SPARC, unlike Intel). */
#if defined AC_APPLE_UNIVERSAL_BUILD
# if defined __BIG_ENDIAN__
#  define WORDS_BIGENDIAN 1
# endif
#else
# ifndef WORDS_BIGENDIAN
/* #  undef WORDS_BIGENDIAN */
# endif
#endif

carstene1ns avatar Nov 09 '21 19:11 carstene1ns