On 2019-05-03, Christian Weisgerber <[email protected]> wrote: > Would it be possible to use <endian.h> and __LP64__ to set these > instead of hardcoding individual archs?
Here's the diff. ok? Index: Makefile =================================================================== RCS file: /cvs/ports/games/stepmania/Makefile,v retrieving revision 1.25 diff -u -p -r1.25 Makefile --- Makefile 19 Feb 2019 23:40:49 -0000 1.25 +++ Makefile 13 May 2019 03:38:36 -0000 @@ -7,7 +7,7 @@ CATEGORIES = games emulators DISTNAME = stepmania-5.0b2a PKGNAME = stepmania-5.0beta2a -REVISION = 13 +REVISION = 14 EXTRACT_SUFX = -src.tar.bz2 HOMEPAGE = http://www.stepmania.com MASTER_SITES = ${MASTER_SITE_SOURCEFORGE:=stepmania/} Index: patches/patch-src_libtomcrypt_src_headers_tomcrypt_cfg_h =================================================================== RCS file: /cvs/ports/games/stepmania/patches/patch-src_libtomcrypt_src_headers_tomcrypt_cfg_h,v retrieving revision 1.1 diff -u -p -r1.1 patch-src_libtomcrypt_src_headers_tomcrypt_cfg_h --- patches/patch-src_libtomcrypt_src_headers_tomcrypt_cfg_h 2 May 2019 19:58:53 -0000 1.1 +++ patches/patch-src_libtomcrypt_src_headers_tomcrypt_cfg_h 13 May 2019 03:38:36 -0000 @@ -1,23 +1,41 @@ -$OpenBSD: patch-src_libtomcrypt_src_headers_tomcrypt_cfg_h,v 1.1 2019/05/02 19:58:53 bcallah Exp $ +$OpenBSD$ Index: src/libtomcrypt/src/headers/tomcrypt_cfg.h --- src/libtomcrypt/src/headers/tomcrypt_cfg.h.orig +++ src/libtomcrypt/src/headers/tomcrypt_cfg.h -@@ -101,6 +101,17 @@ LTC_EXPORT int LTC_CALL XSTRCMP(const char *s1, cons - #endif - #endif +@@ -55,6 +55,26 @@ LTC_EXPORT int LTC_CALL XSTRCMP(const char *s1, cons + * use the portable [slower] macros. + */ -+/* detect arm64 and arm */ +#if defined(__OpenBSD__) -+ #if defined(__aarch64__) -+ #define ENDIAN_LITTLE -+ #define ENDIAN_64BITWORD -+ #elif defined(__arm__) -+ #define ENDIAN_LITTLE -+ #define ENDIAN_32BITWORD -+ #endif ++ ++#include <endian.h> ++#if BYTE_ORDER == LITTLE_ENDIAN ++ #define ENDIAN_LITTLE ++#elif BYTE_ORDER == BIG_ENDIAN ++ #define ENDIAN_BIG ++#endif ++#if defined(__LP64__) ++ #define ENDIAN_64BITWORD ++#else ++ #define ENDIAN_32BITWORD ++#endif ++#if !defined(__STRICT_ALIGNMENT) ++ #define LTC_FAST ++ #define LTC_FAST_TYPE unsigned long +#endif + ++#else ++ + /* detect x86-32 machines somewhat */ + #if !defined(__STRICT_ANSI__) && (defined(INTEL_CC) || (defined(_MSC_VER) && defined(WIN32)) || (defined(__GNUC__) && (defined(__DJGPP__) || defined(__CYGWIN__) || defined(__MINGW32__) || defined(__i386__)))) + #if !defined(ENDIAN_LITTLE) // SM +@@ -100,6 +120,8 @@ LTC_EXPORT int LTC_CALL XSTRCMP(const char *s1, cons + #define ENDIAN_32BITWORD + #endif + #endif ++ ++#endif /* __OpenBSD__ */ + #ifdef LTC_NO_FAST - #ifdef LTC_FAST -- Christian "naddy" Weisgerber [email protected]
