diff options
author | Piotr Kubaj <pkubaj@FreeBSD.org> | 2023-08-03 10:39:58 +0000 |
---|---|---|
committer | Piotr Kubaj <pkubaj@FreeBSD.org> | 2023-08-03 10:39:58 +0000 |
commit | 6483d7e6e5f341dbcc6483d30f353b3fb2dd2c45 (patch) | |
tree | b5028f270b6a4f36d23a9537fdc6d5a52c1b7853 | |
parent | 6a56ecb3558d6377dad78d7080c9eb8d12f47530 (diff) | |
download | ports-6483d7e6e5f341dbcc6483d30f353b3fb2dd2c45.tar.gz ports-6483d7e6e5f341dbcc6483d30f353b3fb2dd2c45.zip |
games/oblige: fix build on powerpc*
gui/sys_endian.h:66:58: error: unsupported inline asm: input with type 'int' matching output with type 'u16_t' (aka 'unsigned short')
__asm__("rlwimi %0,%2,8,16,23" : "=&r" (result) : "0" (x >> 8), "r" (x));
~~~~~~ ^~~~~~
-rw-r--r-- | games/oblige/Makefile | 3 | ||||
-rw-r--r-- | games/oblige/files/patch-ajpoly__src_pl__endian.h | 14 | ||||
-rw-r--r-- | games/oblige/files/patch-gui_sys__endian.h | 14 |
3 files changed, 30 insertions, 1 deletions
diff --git a/games/oblige/Makefile b/games/oblige/Makefile index d68a02bb80af..7d04609679d7 100644 --- a/games/oblige/Makefile +++ b/games/oblige/Makefile @@ -17,7 +17,8 @@ LIB_DEPENDS= libfltk.so:x11-toolkits/fltk \ libphysfs.so:devel/physfs \ libpng.so:graphics/png -USES= gmake jpeg xorg zip +USES= dos2unix gmake jpeg xorg zip +DOS2UNIX_FILES= ajpoly_src/pl_endian.h gui/sys_endian.h USE_XORG= x11 xcursor xext xfixes xft xinerama xrender WRKSRC= ${WRKDIR}/Oblige-${PORTVERSION}-source diff --git a/games/oblige/files/patch-ajpoly__src_pl__endian.h b/games/oblige/files/patch-ajpoly__src_pl__endian.h new file mode 100644 index 000000000000..c10fb7058fbc --- /dev/null +++ b/games/oblige/files/patch-ajpoly__src_pl__endian.h @@ -0,0 +1,14 @@ +--- ajpoly_src/pl_endian.h.orig 2023-07-31 15:43:19 UTC ++++ ajpoly_src/pl_endian.h +@@ -57,10 +57,7 @@ static inline u16_t UT_Swap16(u16_t x) + #elif defined(__GNUC__) && (defined(__powerpc__) || defined(__ppc__)) + static inline u16_t UT_Swap16(u16_t x) + { +- u16_t result; +- +- __asm__("rlwimi %0,%2,8,16,23" : "=&r" (result) : "0" (x >> 8), "r" (x)); +- return result; ++ return __builtin_bswap16(x); + } + #else + static inline u16_t UT_Swap16(u16_t x) { diff --git a/games/oblige/files/patch-gui_sys__endian.h b/games/oblige/files/patch-gui_sys__endian.h new file mode 100644 index 000000000000..a240f00393e3 --- /dev/null +++ b/games/oblige/files/patch-gui_sys__endian.h @@ -0,0 +1,14 @@ +--- gui/sys_endian.h.orig 2023-07-31 15:43:29 UTC ++++ gui/sys_endian.h +@@ -61,10 +61,7 @@ static inline u16_t UT_Swap16(u16_t x) + #elif defined(__GNUC__) && (defined(__powerpc__) || defined(__ppc__)) + static inline u16_t UT_Swap16(u16_t x) + { +- u16_t result; +- +- __asm__("rlwimi %0,%2,8,16,23" : "=&r" (result) : "0" (x >> 8), "r" (x)); +- return result; ++ return __builtin_bswap16(x); + } + #else + static inline u16_t UT_Swap16(u16_t x) { |