From 6f994cac4d45402a5c0ad677e0e535c44126a877 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?T=C3=B6r=C3=B6k=20Edvin?= Date: Fri, 23 Apr 2010 21:39:01 +0300 Subject: [PATCH] Fix Apple-style universal build (bb #1988). We defined WORDS_BIGENDIAN to 0 if it wasn't defined, however that doesn't work with Apple universal builds, since we don't know the endianness at configure time! So add the ifndef WORDS_BIGNENDIAN -> define WORDS_BIGENDIAN 0 logic to platform.h. --- ChangeLog | 4 ++++ configure | 4 ---- configure.in | 3 --- platform.h.in | 4 +++- win32/platform.h | 2 +- 5 files changed, 8 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index 87b8c89d9..7b1a246fb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Fri Apr 23 21:38:19 EEST 2010 (edwin) +------------------------------------- + * configure: fix Apple-style universal build (bb #1988). + Thu Apr 22 22:34:52 CEST 2010 (acab) ------------------------------------ * libclamav/fmap.c: downgrade warning when the kernel doesn't want a map back diff --git a/configure b/configure index 1e0518381..cb2f19484 100755 --- a/configure +++ b/configure @@ -12766,10 +12766,6 @@ $as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;; esac -if test $ac_cv_c_bigendian = no; then - $as_echo "#define WORDS_BIGENDIAN 0" >>confdefs.h - -fi LIBM= case $host in diff --git a/configure.in b/configure.in index 182c02e4f..1b7facfcd 100644 --- a/configure.in +++ b/configure.in @@ -78,9 +78,6 @@ AC_C_CONST AC_C_INLINE AC_C_FPU_BIGENDIAN AC_C_BIGENDIAN -if test $ac_cv_c_bigendian = no; then - m4_default([], [AC_DEFINE([WORDS_BIGENDIAN], 0)]) -fi LT_LIB_M diff --git a/platform.h.in b/platform.h.in index c30f2d5db..2eab3b018 100644 --- a/platform.h.in +++ b/platform.h.in @@ -40,4 +40,6 @@ typedef unsigned int in_addr_t; /* Nothing is safe in windows, not even open */ #define safe_open open - +#ifndef WORDS_BIGENDIAN +#define WORDS_BIGENDIAN 0 +#endif diff --git a/win32/platform.h b/win32/platform.h index 4f10dd1e0..059edee40 100644 --- a/win32/platform.h +++ b/win32/platform.h @@ -108,4 +108,4 @@ int real_main(int, char**); #define main main(int argc, char **argv) { _setmode(_fileno(stdin), _O_BINARY); w32_glob(&argc, &argv); return real_main(argc, argv); }; int real_main #endif /* __PLATFORM_H */ - +#define WORDS_BIGENDIAN 0