On BSD use <sys/endian.h> to derive endianess, instead of defaulting

to little endian always.
This commit is contained in:
martin 2012-04-26 18:12:37 +00:00
parent 084c5b5ed8
commit 0af361b075
3 changed files with 32 additions and 2 deletions

View file

@ -1,7 +1,8 @@
# $NetBSD: Makefile,v 1.69 2012/04/25 18:53:43 adam Exp $
# $NetBSD: Makefile,v 1.70 2012/04/26 18:12:37 martin Exp $
DISTNAME= icu4c-49_1_1-src
PKGNAME= ${DISTNAME:S/4c//:S/-src//:S/_/./g}
PKGREVISION= 1
CATEGORIES= textproc
MASTER_SITES= http://download.icu-project.org/files/icu4c/${PKGVERSION_NOREV}/
EXTRACT_SUFX= .tgz

View file

@ -1,4 +1,4 @@
$NetBSD: distinfo,v 1.25 2012/04/25 18:53:43 adam Exp $
$NetBSD: distinfo,v 1.26 2012/04/26 18:12:37 martin Exp $
SHA1 (icu4c-49_1_1-src.tgz) = f407d7e2808b76e3a6ca316aab896aef74bf6722
RMD160 (icu4c-49_1_1-src.tgz) = ad47b292be561398b25d198a35c025670432c3f1
@ -8,4 +8,5 @@ SHA1 (patch-ab) = e6f4a08d0efabd8e6ae763289d975c1bc70e89c4
SHA1 (patch-ac) = e7cee161315321d2580074054d87714b55319886
SHA1 (patch-ad) = f7f20248608e1326359d4464ace32e4ee3031fcb
SHA1 (patch-af) = c81168246649f191ebb19a61fb216e172aac3cc2
SHA1 (patch-common_unicode_platform.h) = 96a516acf790d3fac9fa9be8f9752e94b86b167f
SHA1 (patch-config_icu-config-bottom) = 4a167249d58cb6c729bc164e6abae869dd5e6b1a

View file

@ -0,0 +1,28 @@
$NetBSD: patch-common_unicode_platform.h,v 1.1 2012/04/26 18:12:37 martin Exp $
--- common/unicode/platform.h.orig 2012-04-26 19:49:36.000000000 +0200
+++ common/unicode/platform.h 2012-04-26 19:53:33.000000000 +0200
@@ -131,7 +131,8 @@
# include <android/api-level.h>
#elif defined(linux) || defined(__linux__) || defined(__linux)
# define U_PLATFORM U_PF_LINUX
-#elif defined(BSD) || defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
+#elif defined(BSD) || defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || \
+ defined(__NetBSD__) || defined(__DragonFly__)
# define U_PLATFORM U_PF_BSD
#elif defined(sun) || defined(__sun)
/* Check defined(__SVR4) || defined(__svr4__) to distinguish Solaris from SunOS? */
@@ -346,6 +347,13 @@
# define U_IS_BIG_ENDIAN 1
#elif defined(__LITTLE_ENDIAN__) || defined(_LITTLE_ENDIAN)
# define U_IS_BIG_ENDIAN 0
+#elif U_PLATFORM == U_PF_BSD
+#include <sys/endian.h>
+#if _BYTE_ORDER == _LITTLE_ENDIAN
+# define U_IS_BIG_ENDIAN 0
+#else
+# define U_IS_BIG_ENDIAN 1
+#endif
#elif U_PLATFORM == U_PF_OS390 || U_PLATFORM == U_PF_OS400
/* These platforms do not appear to predefine any endianness macros. */
# define U_IS_BIG_ENDIAN 1