|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r86167 - in trunk: boost/predef/detail boost/predef/os boost/predef/os/bsd boost/predef/other libs/predef/test
From: grafikrobot_at_[hidden]
Date: 2013-10-05 17:50:45
Author: grafik
Date: 2013-10-05 17:50:45 EDT (Sat, 05 Oct 2013)
New Revision: 86167
URL: http://svn.boost.org/trac/boost/changeset/86167
Log:
Address endian compile errors for OSX in the cases where sys/param.h was include ahead of the predef headers. The solution was to: use the OSX machine/endian.h header, and only allow a single OS to be detected at once. Test cases added for both conditions on OSX.
Added:
trunk/boost/predef/detail/os_detected.h (contents, props changed)
trunk/libs/predef/test/macos_endian.c (contents, props changed)
trunk/libs/predef/test/macos_vs_bsd.c (contents, props changed)
Text files modified:
trunk/boost/predef/detail/os_detected.h | 10 ++++++++++
trunk/boost/predef/os/aix.h | 5 ++++-
trunk/boost/predef/os/amigaos.h | 5 ++++-
trunk/boost/predef/os/android.h | 5 ++++-
trunk/boost/predef/os/beos.h | 5 ++++-
trunk/boost/predef/os/bsd.h | 27 +++++++++++++++------------
trunk/boost/predef/os/bsd/bsdi.h | 5 ++++-
trunk/boost/predef/os/bsd/dragonfly.h | 5 ++++-
trunk/boost/predef/os/bsd/free.h | 5 ++++-
trunk/boost/predef/os/bsd/net.h | 5 ++++-
trunk/boost/predef/os/bsd/open.h | 5 ++++-
trunk/boost/predef/os/cygwin.h | 5 ++++-
trunk/boost/predef/os/hpux.h | 5 ++++-
trunk/boost/predef/os/irix.h | 5 ++++-
trunk/boost/predef/os/linux.h | 5 ++++-
trunk/boost/predef/os/macos.h | 7 +++++--
trunk/boost/predef/os/os400.h | 5 ++++-
trunk/boost/predef/os/qnxnto.h | 5 ++++-
trunk/boost/predef/os/solaris.h | 5 ++++-
trunk/boost/predef/os/unix.h | 7 +++++--
trunk/boost/predef/os/vms.h | 5 ++++-
trunk/boost/predef/os/windows.h | 7 +++++--
trunk/boost/predef/other/endian.h | 16 +++++++++++-----
trunk/libs/predef/test/build.jam | 2 ++
trunk/libs/predef/test/macos_endian.c | 20 ++++++++++++++++++++
trunk/libs/predef/test/macos_vs_bsd.c | 20 ++++++++++++++++++++
26 files changed, 161 insertions(+), 40 deletions(-)
Added: trunk/boost/predef/detail/os_detected.h
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ trunk/boost/predef/detail/os_detected.h 2013-10-05 17:50:45 EDT (Sat, 05 Oct 2013) (r86167)
@@ -0,0 +1,10 @@
+/*
+Copyright Redshift Software, Inc. 2013
+Distributed under the Boost Software License, Version 1.0.
+(See accompanying file LICENSE_1_0.txt or copy at
+http://www.boost.org/LICENSE_1_0.txt)
+*/
+
+#ifndef BOOST_PREDEF_DETAIL_OS_DETECTED
+#define BOOST_PREDEF_DETAIL_OS_DETECTED 1
+#endif
Modified: trunk/boost/predef/os/aix.h
==============================================================================
--- trunk/boost/predef/os/aix.h Sat Oct 5 15:02:18 2013 (r86166)
+++ trunk/boost/predef/os/aix.h 2013-10-05 17:50:45 EDT (Sat, 05 Oct 2013) (r86167)
@@ -32,7 +32,9 @@
#define BOOST_OS_AIX BOOST_VERSION_NUMBER_NOT_AVAILABLE
-#if defined(_AIX) || defined(__TOS_AIX__)
+#if !BOOST_PREDEF_DETAIL_OS_DETECTED && ( \
+ defined(_AIX) || defined(__TOS_AIX__) \
+ )
# undef BOOST_OS_AIX
# if !defined(BOOST_OS_AIX) && defined(_AIX43)
# define BOOST_OS_AIX BOOST_VERSION_NUMBER(4,3,0)
@@ -53,6 +55,7 @@
#if BOOST_OS_AIX
# define BOOST_OS_AIX_AVAILABLE
+# include <boost/predef/detail/os_detected.h>
#endif
#define BOOST_OS_AIX_NAME "IBM AIX"
Modified: trunk/boost/predef/os/amigaos.h
==============================================================================
--- trunk/boost/predef/os/amigaos.h Sat Oct 5 15:02:18 2013 (r86166)
+++ trunk/boost/predef/os/amigaos.h 2013-10-05 17:50:45 EDT (Sat, 05 Oct 2013) (r86167)
@@ -26,13 +26,16 @@
#define BOOST_OS_AMIGAOS BOOST_VERSION_NUMBER_NOT_AVAILABLE
-#if defined(AMIGA) || defined(__amigaos__)
+#if !BOOST_PREDEF_DETAIL_OS_DETECTED && ( \
+ defined(AMIGA) || defined(__amigaos__) \
+ )
# undef BOOST_OS_AMIGAOS
# define BOOST_OS_AMIGAOS BOOST_VERSION_NUMBER_AVAILABLE
#endif
#if BOOST_OS_AMIGAOS
# define BOOST_OS_AMIGAOS_AVAILABLE
+# include <boost/predef/detail/os_detected.h>
#endif
#define BOOST_OS_AMIGAOS_NAME "AmigaOS"
Modified: trunk/boost/predef/os/android.h
==============================================================================
--- trunk/boost/predef/os/android.h Sat Oct 5 15:02:18 2013 (r86166)
+++ trunk/boost/predef/os/android.h 2013-10-05 17:50:45 EDT (Sat, 05 Oct 2013) (r86167)
@@ -25,13 +25,16 @@
#define BOOST_OS_ANDROID BOOST_VERSION_NUMBER_NOT_AVAILABLE
-#if defined(__ANDROID__)
+#if !BOOST_PREDEF_DETAIL_OS_DETECTED && ( \
+ defined(__ANDROID__) \
+ )
# undef BOOST_OS_ANDROID
# define BOOST_OS_ANDROID BOOST_VERSION_NUMBER_AVAILABLE
#endif
#if BOOST_OS_ANDROID
# define BOOST_OS_ANDROID_AVAILABLE
+# include <boost/predef/detail/os_detected.h>
#endif
#define BOOST_OS_ANDROID_NAME "Android"
Modified: trunk/boost/predef/os/beos.h
==============================================================================
--- trunk/boost/predef/os/beos.h Sat Oct 5 15:02:18 2013 (r86166)
+++ trunk/boost/predef/os/beos.h 2013-10-05 17:50:45 EDT (Sat, 05 Oct 2013) (r86167)
@@ -25,13 +25,16 @@
#define BOOST_OS_BEOS BOOST_VERSION_NUMBER_NOT_AVAILABLE
-#if defined(__BEOS__)
+#if !BOOST_PREDEF_DETAIL_OS_DETECTED && ( \
+ defined(__BEOS__) \
+ )
# undef BOOST_OS_BEOS
# define BOOST_OS_BEOS BOOST_VERSION_NUMBER_AVAILABLE
#endif
#if BOOST_OS_BEOS
# define BOOST_OS_BEOS_AVAILABLE
+# include <boost/predef/detail/os_detected.h>
#endif
#define BOOST_OS_BEOS_NAME "BeOS"
Modified: trunk/boost/predef/os/bsd.h
==============================================================================
--- trunk/boost/predef/os/bsd.h Sat Oct 5 15:02:18 2013 (r86166)
+++ trunk/boost/predef/os/bsd.h 2013-10-05 17:50:45 EDT (Sat, 05 Oct 2013) (r86167)
@@ -42,20 +42,28 @@
]
*/
+#include <boost/predef/os/bsd/bsdi.h>
+#include <boost/predef/os/bsd/dragonfly.h>
+#include <boost/predef/os/bsd/free.h>
+#include <boost/predef/os/bsd/open.h>
+#include <boost/predef/os/bsd/net.h>
+
#define BOOST_OS_BSD BOOST_VERSION_NUMBER_NOT_AVAILABLE
-#if defined(BSD) || \
- defined(_SYSTYPE_BSD)
+#if !BOOST_PREDEF_DETAIL_OS_DETECTED && ( \
+ defined(BSD) || \
+ defined(_SYSTYPE_BSD) \
+ )
# undef BOOST_OS_BSD
# include <sys/param.h>
-# if !defined(BOOST_OS_BSD) && defined(BSD4_2)
-# define BOOST_OS_BSD BOOST_VERSION_NUMBER(4,2,0)
+# if !defined(BOOST_OS_BSD) && defined(BSD4_4)
+# define BOOST_OS_BSD BOOST_VERSION_NUMBER(4,4,0)
# endif
# if !defined(BOOST_OS_BSD) && defined(BSD4_3)
# define BOOST_OS_BSD BOOST_VERSION_NUMBER(4,3,0)
# endif
-# if !defined(BOOST_OS_BSD) && defined(BSD4_4)
-# define BOOST_OS_BSD BOOST_VERSION_NUMBER(4,4,0)
+# if !defined(BOOST_OS_BSD) && defined(BSD4_2)
+# define BOOST_OS_BSD BOOST_VERSION_NUMBER(4,2,0)
# endif
# if !defined(BOOST_OS_BSD) && defined(BSD)
# define BOOST_OS_BSD BOOST_PREDEF_MAKE_10_VVRR(BSD)
@@ -67,6 +75,7 @@
#if BOOST_OS_BSD
# define BOOST_OS_BSD_AVAILABLE
+# include <boost/predef/detail/os_detected.h>
#endif
#define BOOST_OS_BSD_NAME "BSD"
@@ -74,10 +83,4 @@
#include <boost/predef/detail/test.h>
BOOST_PREDEF_DECLARE_TEST(BOOST_OS_BSD,BOOST_OS_BSD_NAME)
-#include <boost/predef/os/bsd/bsdi.h>
-#include <boost/predef/os/bsd/dragonfly.h>
-#include <boost/predef/os/bsd/free.h>
-#include <boost/predef/os/bsd/open.h>
-#include <boost/predef/os/bsd/net.h>
-
#endif
Modified: trunk/boost/predef/os/bsd/bsdi.h
==============================================================================
--- trunk/boost/predef/os/bsd/bsdi.h Sat Oct 5 15:02:18 2013 (r86166)
+++ trunk/boost/predef/os/bsd/bsdi.h 2013-10-05 17:50:45 EDT (Sat, 05 Oct 2013) (r86167)
@@ -24,7 +24,9 @@
#define BOOST_OS_BSD_BSDI BOOST_VERSION_NUMBER_NOT_AVAILABLE
-#if defined(__bsdi__)
+#if !BOOST_PREDEF_DETAIL_OS_DETECTED && ( \
+ defined(__bsdi__) \
+ )
# ifndef BOOST_OS_BSD_AVAILABLE
# define BOOST_OS_BSD BOOST_VERSION_NUMBER_AVAILABLE
# define BOOST_OS_BSD_AVAILABLE
@@ -35,6 +37,7 @@
#if BOOST_OS_BSD_BSDI
# define BOOST_OS_BSD_BSDI_AVAILABLE
+# include <boost/predef/detail/os_detected.h>
#endif
#define BOOST_OS_BSD_BSDI_NAME "BSDi BSD/OS"
Modified: trunk/boost/predef/os/bsd/dragonfly.h
==============================================================================
--- trunk/boost/predef/os/bsd/dragonfly.h Sat Oct 5 15:02:18 2013 (r86166)
+++ trunk/boost/predef/os/bsd/dragonfly.h 2013-10-05 17:50:45 EDT (Sat, 05 Oct 2013) (r86167)
@@ -24,7 +24,9 @@
#define BOOST_OS_BSD_DRAGONFLY BOOST_VERSION_NUMBER_NOT_AVAILABLE
-#if defined(__DragonFly__)
+#if !BOOST_PREDEF_DETAIL_OS_DETECTED && ( \
+ defined(__DragonFly__) \
+ )
# ifndef BOOST_OS_BSD_AVAILABLE
# define BOOST_OS_BSD BOOST_VERSION_NUMBER_AVAILABLE
# define BOOST_OS_BSD_AVAILABLE
@@ -37,6 +39,7 @@
#if BOOST_OS_BSD_DRAGONFLY
# define BOOST_OS_BSD_DRAGONFLY_AVAILABLE
+# include <boost/predef/detail/os_detected.h>
#endif
#define BOOST_OS_BSD_DRAGONFLY_NAME "DragonFly BSD"
Modified: trunk/boost/predef/os/bsd/free.h
==============================================================================
--- trunk/boost/predef/os/bsd/free.h Sat Oct 5 15:02:18 2013 (r86166)
+++ trunk/boost/predef/os/bsd/free.h 2013-10-05 17:50:45 EDT (Sat, 05 Oct 2013) (r86167)
@@ -26,7 +26,9 @@
#define BOOST_OS_BSD_FREE BOOST_VERSION_NUMBER_NOT_AVAILABLE
-#if defined(__FreeBSD__)
+#if !BOOST_PREDEF_DETAIL_OS_DETECTED && ( \
+ defined(__FreeBSD__) \
+ )
# ifndef BOOST_OS_BSD_AVAILABLE
# define BOOST_OS_BSD BOOST_VERSION_NUMBER_AVAILABLE
# define BOOST_OS_BSD_AVAILABLE
@@ -47,6 +49,7 @@
#if BOOST_OS_BSD_FREE
# define BOOST_OS_BSD_FREE_AVAILABLE
+# include <boost/predef/detail/os_detected.h>
#endif
#define BOOST_OS_BSD_FREE_NAME "Free BSD"
Modified: trunk/boost/predef/os/bsd/net.h
==============================================================================
--- trunk/boost/predef/os/bsd/net.h Sat Oct 5 15:02:18 2013 (r86166)
+++ trunk/boost/predef/os/bsd/net.h 2013-10-05 17:50:45 EDT (Sat, 05 Oct 2013) (r86167)
@@ -31,7 +31,9 @@
#define BOOST_OS_BSD_NET BOOST_VERSION_NUMBER_NOT_AVAILABLE
-#if defined(__NETBSD__) || defined(__NetBSD__)
+#if !BOOST_PREDEF_DETAIL_OS_DETECTED && ( \
+ defined(__NETBSD__) || defined(__NetBSD__) \
+ )
# ifndef BOOST_OS_BSD_AVAILABLE
# define BOOST_OS_BSD BOOST_VERSION_NUMBER_AVAILABLE
# define BOOST_OS_BSD_AVAILABLE
@@ -71,6 +73,7 @@
#if BOOST_OS_BSD_NET
# define BOOST_OS_BSD_NET_AVAILABLE
+# include <boost/predef/detail/os_detected.h>
#endif
#define BOOST_OS_BSD_NET_NAME "DragonFly BSD"
Modified: trunk/boost/predef/os/bsd/open.h
==============================================================================
--- trunk/boost/predef/os/bsd/open.h Sat Oct 5 15:02:18 2013 (r86166)
+++ trunk/boost/predef/os/bsd/open.h 2013-10-05 17:50:45 EDT (Sat, 05 Oct 2013) (r86167)
@@ -55,7 +55,9 @@
#define BOOST_OS_BSD_OPEN BOOST_VERSION_NUMBER_NOT_AVAILABLE
-#if defined(__OpenBSD__)
+#if !BOOST_PREDEF_DETAIL_OS_DETECTED && ( \
+ defined(__OpenBSD__) \
+ )
# ifndef BOOST_OS_BSD_AVAILABLE
# define BOOST_OS_BSD BOOST_VERSION_NUMBER_AVAILABLE
# define BOOST_OS_BSD_AVAILABLE
@@ -158,6 +160,7 @@
#if BOOST_OS_BSD_OPEN
# define BOOST_OS_BSD_OPEN_AVAILABLE
+# include <boost/predef/detail/os_detected.h>
#endif
#define BOOST_OS_BSD_OPEN_NAME "OpenBSD"
Modified: trunk/boost/predef/os/cygwin.h
==============================================================================
--- trunk/boost/predef/os/cygwin.h Sat Oct 5 15:02:18 2013 (r86166)
+++ trunk/boost/predef/os/cygwin.h 2013-10-05 17:50:45 EDT (Sat, 05 Oct 2013) (r86167)
@@ -25,13 +25,16 @@
#define BOOST_OS_CYGWIN BOOST_VERSION_NUMBER_NOT_AVAILABLE
-#if defined(__CYGWIN__)
+#if !BOOST_PREDEF_DETAIL_OS_DETECTED && ( \
+ defined(__CYGWIN__) \
+ )
# undef BOOST_OS_CYGWIN
# define BOOST_OS_CGYWIN BOOST_VERSION_NUMBER_AVAILABLE
#endif
#if BOOST_OS_CYGWIN
# define BOOST_OS_CYGWIN_AVAILABLE
+# include <boost/predef/detail/os_detected.h>
#endif
#define BOOST_OS_CYGWIN_NAME "Cygwin"
Modified: trunk/boost/predef/os/hpux.h
==============================================================================
--- trunk/boost/predef/os/hpux.h Sat Oct 5 15:02:18 2013 (r86166)
+++ trunk/boost/predef/os/hpux.h 2013-10-05 17:50:45 EDT (Sat, 05 Oct 2013) (r86167)
@@ -27,13 +27,16 @@
#define BOOST_OS_HPUX BOOST_VERSION_NUMBER_NOT_AVAILABLE
-#if defined(hpux) || defined(_hpux) || defined(__hpux)
+#if !BOOST_PREDEF_DETAIL_OS_DETECTED && ( \
+ defined(hpux) || defined(_hpux) || defined(__hpux) \
+ )
# undef BOOST_OS_HPUX
# define BOOST_OS_HPUX BOOST_VERSION_NUMBER_AVAILABLE
#endif
#if BOOST_OS_HPUX
# define BOOST_OS_HPUX_AVAILABLE
+# include <boost/predef/detail/os_detected.h>
#endif
#define BOOST_OS_HPUX_NAME "HP-UX"
Modified: trunk/boost/predef/os/irix.h
==============================================================================
--- trunk/boost/predef/os/irix.h Sat Oct 5 15:02:18 2013 (r86166)
+++ trunk/boost/predef/os/irix.h 2013-10-05 17:50:45 EDT (Sat, 05 Oct 2013) (r86167)
@@ -26,13 +26,16 @@
#define BOOST_OS_IRIX BOOST_VERSION_NUMBER_NOT_AVAILABLE
-#if defined(sgi) || defined(__sgi)
+#if !BOOST_PREDEF_DETAIL_OS_DETECTED && ( \
+ defined(sgi) || defined(__sgi) \
+ )
# undef BOOST_OS_IRIX
# define BOOST_OS_IRIX BOOST_VERSION_NUMBER_AVAILABLE
#endif
#if BOOST_OS_IRIX
# define BOOST_OS_IRIX_AVAILABLE
+# include <boost/predef/detail/os_detected.h>
#endif
#define BOOST_OS_IRIX_NAME "IRIX"
Modified: trunk/boost/predef/os/linux.h
==============================================================================
--- trunk/boost/predef/os/linux.h Sat Oct 5 15:02:18 2013 (r86166)
+++ trunk/boost/predef/os/linux.h 2013-10-05 17:50:45 EDT (Sat, 05 Oct 2013) (r86167)
@@ -26,13 +26,16 @@
#define BOOST_OS_LINUX BOOST_VERSION_NUMBER_NOT_AVAILABLE
-#if defined(linux) || defined(__linux)
+#if !BOOST_PREDEF_DETAIL_OS_DETECTED && ( \
+ defined(linux) || defined(__linux) \
+ )
# undef BOOST_OS_LINUX
# define BOOST_OS_LINUX BOOST_VERSION_NUMBER_AVAILABLE
#endif
#if BOOST_OS_LINUX
# define BOOST_OS_LINUX_AVAILABLE
+# include <boost/predef/detail/os_detected.h>
#endif
#define BOOST_OS_LINUX_NAME "Linux"
Modified: trunk/boost/predef/os/macos.h
==============================================================================
--- trunk/boost/predef/os/macos.h Sat Oct 5 15:02:18 2013 (r86166)
+++ trunk/boost/predef/os/macos.h 2013-10-05 17:50:45 EDT (Sat, 05 Oct 2013) (r86167)
@@ -31,8 +31,10 @@
#define BOOST_OS_MACOS BOOST_VERSION_NUMBER_NOT_AVAILABLE
-#if defined(macintosh) || defined(Macintosh) || \
- (defined(__APPLE__) && defined(__MACH__))
+#if !BOOST_PREDEF_DETAIL_OS_DETECTED && ( \
+ defined(macintosh) || defined(Macintosh) || \
+ (defined(__APPLE__) && defined(__MACH__)) \
+ )
# undef BOOST_OS_MACOS
# if !defined(BOOST_OS_MACOS) && defined(__APPLE__) && defined(__MACH__)
# define BOOST_OS_MACOS BOOST_VERSION_NUMBER(10,0,0)
@@ -44,6 +46,7 @@
#if BOOST_OS_MACOS
# define BOOST_OS_MACOS_AVAILABLE
+# include <boost/predef/detail/os_detected.h>
#endif
#define BOOST_OS_MACOS_NAME "Mac OS"
Modified: trunk/boost/predef/os/os400.h
==============================================================================
--- trunk/boost/predef/os/os400.h Sat Oct 5 15:02:18 2013 (r86166)
+++ trunk/boost/predef/os/os400.h 2013-10-05 17:50:45 EDT (Sat, 05 Oct 2013) (r86167)
@@ -25,13 +25,16 @@
#define BOOST_OS_OS400 BOOST_VERSION_NUMBER_NOT_AVAILABLE
-#if defined(__OS400__)
+#if !BOOST_PREDEF_DETAIL_OS_DETECTED && ( \
+ defined(__OS400__) \
+ )
# undef BOOST_OS_OS400
# define BOOST_OS_OS400 BOOST_VERSION_NUMBER_AVAILABLE
#endif
#if BOOST_OS_OS400
# define BOOST_OS_OS400_AVAILABLE
+# include <boost/predef/detail/os_detected.h>
#endif
#define BOOST_OS_OS400_NAME "IBM OS/400"
Modified: trunk/boost/predef/os/qnxnto.h
==============================================================================
--- trunk/boost/predef/os/qnxnto.h Sat Oct 5 15:02:18 2013 (r86166)
+++ trunk/boost/predef/os/qnxnto.h 2013-10-05 17:50:45 EDT (Sat, 05 Oct 2013) (r86167)
@@ -31,7 +31,9 @@
#define BOOST_OS_QNX BOOST_VERSION_NUMBER_NOT_AVAILABLE
-#if defined(__QNX__) || defined(__QNXNTO__)
+#if !BOOST_PREDEF_DETAIL_OS_DETECTED && ( \
+ defined(__QNX__) || defined(__QNXNTO__) \
+ )
# undef BOOST_OS_QNX
# if !defined(BOOST_OS_QNX) && defined(_NTO_VERSION)
# define BOOST_OS_QNX BOOST_PREDEF_MAKE_10_VVRR(_NTO_VERSION)
@@ -46,6 +48,7 @@
#if BOOST_OS_QNX
# define BOOST_OS_QNX_AVAILABLE
+# include <boost/predef/detail/os_detected.h>
#endif
#define BOOST_OS_QNX_NAME "QNX"
Modified: trunk/boost/predef/os/solaris.h
==============================================================================
--- trunk/boost/predef/os/solaris.h Sat Oct 5 15:02:18 2013 (r86166)
+++ trunk/boost/predef/os/solaris.h 2013-10-05 17:50:45 EDT (Sat, 05 Oct 2013) (r86167)
@@ -26,13 +26,16 @@
#define BOOST_OS_SOLARIS BOOST_VERSION_NUMBER_NOT_AVAILABLE
-#if defined(sun) || defined(__sun)
+#if !BOOST_PREDEF_DETAIL_OS_DETECTED && ( \
+ defined(sun) || defined(__sun) \
+ )
# undef BOOST_OS_SOLARIS
# define BOOST_OS_SOLARIS BOOST_VERSION_NUMBER_AVAILABLE
#endif
#if BOOST_OS_SOLARIS
# define BOOST_OS_SOLARIS_AVAILABLE
+# include <boost/predef/detail/os_detected.h>
#endif
#define BOOST_OS_SOLARIS_NAME "Solaris"
Modified: trunk/boost/predef/os/unix.h
==============================================================================
--- trunk/boost/predef/os/unix.h Sat Oct 5 15:02:18 2013 (r86166)
+++ trunk/boost/predef/os/unix.h 2013-10-05 17:50:45 EDT (Sat, 05 Oct 2013) (r86167)
@@ -28,14 +28,17 @@
#define BOOST_OS_UNIX BOOST_VERSION_NUMBER_NOT_AVAILABLE
-#if defined(unix) || defined(__unix) || \
- defined(_XOPEN_SOURCE) || defined(_POSIX_SOURCE)
+#if !BOOST_PREDEF_DETAIL_OS_DETECTED && ( \
+ defined(unix) || defined(__unix) || \
+ defined(_XOPEN_SOURCE) || defined(_POSIX_SOURCE) \
+ )
# undef BOOST_OS_UNIX
# define BOOST_OS_UNIX BOOST_VERSION_NUMBER_AVAILABLE
#endif
#if BOOST_OS_UNIX
# define BOOST_OS_UNIX_AVAILABLE
+# include <boost/predef/detail/os_detected.h>
#endif
#define BOOST_OS_UNIX_NAME "Unix Environment"
Modified: trunk/boost/predef/os/vms.h
==============================================================================
--- trunk/boost/predef/os/vms.h Sat Oct 5 15:02:18 2013 (r86166)
+++ trunk/boost/predef/os/vms.h 2013-10-05 17:50:45 EDT (Sat, 05 Oct 2013) (r86167)
@@ -28,7 +28,9 @@
#define BOOST_OS_VMS BOOST_VERSION_NUMBER_NOT_AVAILABLE
-#if defined(VMS) || defined(__VMS)
+#if !BOOST_PREDEF_DETAIL_OS_DETECTED && ( \
+ defined(VMS) || defined(__VMS) \
+ )
# undef BOOST_OS_VMS
# if defined(__VMS_VER)
# define BOOST_OS_VMS BOOST_PREDEF_MAKE_10_VVRR00PP00(__VMS_VER)
@@ -39,6 +41,7 @@
#if BOOST_OS_VMS
# define BOOST_OS_VMS_AVAILABLE
+# include <boost/predef/detail/os_detected.h>
#endif
#define BOOST_OS_VMS_NAME "VMS"
Modified: trunk/boost/predef/os/windows.h
==============================================================================
--- trunk/boost/predef/os/windows.h Sat Oct 5 15:02:18 2013 (r86166)
+++ trunk/boost/predef/os/windows.h 2013-10-05 17:50:45 EDT (Sat, 05 Oct 2013) (r86167)
@@ -29,15 +29,18 @@
#define BOOST_OS_WINDOWS BOOST_VERSION_NUMBER_NOT_AVAILABLE
-#if defined(_WIN32) || defined(_WIN64) || \
+#if !BOOST_PREDEF_DETAIL_OS_DETECTED && ( \
+ defined(_WIN32) || defined(_WIN64) || \
defined(__WIN32__) || defined(__TOS_WIN__) || \
- defined(__WINDOWS__)
+ defined(__WINDOWS__) \
+ )
# undef BOOST_OS_WINDOWS
# define BOOST_OS_WINDOWS BOOST_VERSION_NUMBER_AVAILABLE
#endif
#if BOOST_OS_WINDOWS
# define BOOST_OS_WINDOWS_AVAILABLE
+# include <boost/predef/detail/os_detected.h>
#endif
#define BOOST_OS_WINDOWS_NAME "Microsoft Windows"
Modified: trunk/boost/predef/other/endian.h
==============================================================================
--- trunk/boost/predef/other/endian.h Sat Oct 5 15:02:18 2013 (r86166)
+++ trunk/boost/predef/other/endian.h 2013-10-05 17:50:45 EDT (Sat, 05 Oct 2013) (r86167)
@@ -11,6 +11,7 @@
#include <boost/predef/version_number.h>
#include <boost/predef/make.h>
#include <boost/predef/library/c/gnu.h>
+#include <boost/predef/os/macos.h>
#include <boost/predef/os/bsd.h>
/*`
@@ -48,17 +49,22 @@
#define BOOST_ENDIAN_LITTLE_WORD BOOST_VERSION_NUMBER_NOT_AVAILABLE
/* GNU libc provides a header defining __BYTE_ORDER, or _BYTE_ORDER.
+ * And some OSs provide some for of endian header also.
*/
#if !BOOST_ENDIAN_BIG_BYTE && !BOOST_ENDIAN_BIG_WORD && \
!BOOST_ENDIAN_LITTLE_BYTE && !BOOST_ENDIAN_LITTLE_WORD
# if BOOST_LIB_C_GNU
# include <endian.h>
# else
-# if BOOST_OS_BSD
-# if BOOST_OS_BSD_OPEN
-# include <machine/endian.h>
-# else
-# include <sys/endian.h>
+# if BOOST_OS_MACOS
+# include <machine/endian.h>
+# else
+# if BOOST_OS_BSD
+# if BOOST_OS_BSD_OPEN
+# include <machine/endian.h>
+# else
+# include <sys/endian.h>
+# endif
# endif
# endif
# endif
Modified: trunk/libs/predef/test/build.jam
==============================================================================
--- trunk/libs/predef/test/build.jam Sat Oct 5 15:02:18 2013 (r86166)
+++ trunk/libs/predef/test/build.jam 2013-10-05 17:50:45 EDT (Sat, 05 Oct 2013) (r86167)
@@ -43,4 +43,6 @@
[ run info_as_objc.m : : : <test-info>always_show_run_output ]
[ run version.cpp ]
[ run make.cpp ]
+ [ compile macos_endian.c ]
+ [ compile macos_vs_bsd.c ]
;
Added: trunk/libs/predef/test/macos_endian.c
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ trunk/libs/predef/test/macos_endian.c 2013-10-05 17:50:45 EDT (Sat, 05 Oct 2013) (r86167)
@@ -0,0 +1,20 @@
+/*
+Copyright Redshift Software Inc. 2013
+Distributed under the Boost Software License, Version 1.0.
+(See accompanying file LICENSE_1_0.txt or copy at
+http://www.boost.org/LICENSE_1_0.txt)
+*/
+
+/*
+ * OSX can define the BSD symbols if sys/param.h is included
+ * before detection. This causes the endian detection to misfire
+ * as both MACOS and BSD are "detected" (currently). This just
+ * tests that the sys/param.h include can be included before
+ * endian detection and still have it work correctly.
+ */
+#include <boost/predef/os/macos.h>
+
+#if BOOST_OS_MACOS
+# include <sys/param.h>
+# include <boost/predef/other/endian.h>
+#endif
Added: trunk/libs/predef/test/macos_vs_bsd.c
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ trunk/libs/predef/test/macos_vs_bsd.c 2013-10-05 17:50:45 EDT (Sat, 05 Oct 2013) (r86167)
@@ -0,0 +1,20 @@
+/*
+Copyright Redshift Software Inc. 2013
+Distributed under the Boost Software License, Version 1.0.
+(See accompanying file LICENSE_1_0.txt or copy at
+http://www.boost.org/LICENSE_1_0.txt)
+*/
+
+/*
+ * OSX can masquerade as BSD when sys/param.h is previously included.
+ * So we test that we only detect OSX in this combination.
+ */
+#include <boost/predef/os/macos.h>
+
+#if BOOST_OS_MACOS
+# include <sys/param.h>
+# include <boost/predef/os/bsd.h>
+# if BOOST_OS_BSD
+# error "Both BOOST_OS_MACOS and BOOST_OS_BSD defined."
+# endif
+#endif
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk