blob: 1f659b6128e0ce5a863b53e9fa3909edb2cc0c44 [file] [log] [blame]
diff --git a/boost/config/platform/nacl.hpp b/boost/config/platform/nacl.hpp
new file mode 100644
--- /dev/null
+++ b/boost/config/platform/nacl.hpp
@@ -0,0 +1,82 @@
+// Copyright (c) 2013 The Native Client Authors.
+// Use, modification and distribution are subject to 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)
+
+// See http://www.boost.org for most recent version.
+
+// Native Client specific config options:
+
+#define BOOST_PLATFORM "nacl"
+
+// make sure we have __GLIBC_PREREQ if available at all
+#ifdef __cplusplus
+#include <cstdlib>
+#else
+#include <stdlib.h>
+#endif
+
+#define BOOST_HAS_STDINT_H
+#define BOOST_HAS_GETTIMEOFDAY
+#define BOOST_HAS_NANOSLEEP
+
+#if defined(__LIBCOMO__)
+ //
+ // como on linux doesn't have std:: c functions:
+ // NOTE: versions of libcomo prior to beta28 have octal version numbering,
+ // e.g. version 25 is 21 (dec)
+ //
+# if __LIBCOMO_VERSION__ <= 20
+# define BOOST_NO_STDC_NAMESPACE
+# endif
+
+# if __LIBCOMO_VERSION__ <= 21
+# define BOOST_NO_SWPRINTF
+# endif
+
+#endif
+
+#if defined(__GLIBC__) && defined(__GLIBC_PREREQ)
+// __GLIBC_PREREQ is available since 2.1.2
+
+ // swprintf is available since glibc 2.2.0
+# if !__GLIBC_PREREQ(2,2) || (!defined(__USE_ISOC99) && !defined(__USE_UNIX98))
+# define BOOST_NO_SWPRINTF
+# endif
+#else
+# define BOOST_NO_SWPRINTF
+#endif
+
+// boilerplate code:
+#define BOOST_HAS_UNISTD_H
+#include <boost/config/posix_features.hpp>
+#ifdef _NEWLIB_VERSION
+ #define BOOST_HAS_SCHED_YIELD
+ #define BOOST_HAS_PTHREADS
+#endif
+
+#ifndef __GNUC__
+//
+// if the compiler is not gcc we still need to be able to parse
+// the GNU system headers, some of which (mainly <stdint.h>)
+// use GNU specific extensions:
+//
+# ifndef __extension__
+# define __extension__
+# endif
+# ifndef __const__
+# define __const__ const
+# endif
+# ifndef __volatile__
+# define __volatile__ volatile
+# endif
+# ifndef __signed__
+# define __signed__ signed
+# endif
+# ifndef __typeof__
+# define __typeof__ typeof
+# endif
+# ifndef __inline__
+# define __inline__ inline
+# endif
+#endif
diff --git a/boost/config/select_platform_config.hpp b/boost/config/select_platform_config.hpp
--- a/boost/config/select_platform_config.hpp
+++ b/boost/config/select_platform_config.hpp
@@ -76,6 +76,10 @@
#elif defined(__VMS)
// VMS:
# define BOOST_PLATFORM_CONFIG "boost/config/platform/vms.hpp"
+
+#elif defined(__native_client__)
+// Native Client:
+# define BOOST_PLATFORM_CONFIG "boost/config/platform/nacl.hpp"
#else
# if defined(unix) \
diff --git a/boost/log/detail/light_rw_mutex.hpp b/boost/log/detail/light_rw_mutex.hpp
--- a/boost/log/detail/light_rw_mutex.hpp
+++ b/boost/log/detail/light_rw_mutex.hpp
@@ -26,6 +26,7 @@
#include <boost/log/detail/header.hpp>
+#ifndef _NEWLIB_VERSION
#if defined(BOOST_THREAD_POSIX) // This one can be defined by users, so it should go first
#define BOOST_LOG_LWRWMUTEX_USE_PTHREAD
#elif defined(BOOST_WINDOWS) && defined(BOOST_LOG_USE_WINNT6_API)
@@ -33,6 +34,7 @@
#elif defined(BOOST_HAS_PTHREADS)
#define BOOST_LOG_LWRWMUTEX_USE_PTHREAD
#endif
+#endif
#if defined(BOOST_LOG_LWRWMUTEX_USE_SRWLOCK)
diff --git a/libs/system/src/error_code.cpp b/libs/system/src/error_code.cpp
--- a/libs/system/src/error_code.cpp
+++ b/libs/system/src/error_code.cpp
@@ -101,7 +101,7 @@ namespace
char buf[64];
char * bp = buf;
std::size_t sz = sizeof(buf);
- # if defined(__CYGWIN__) || defined(__USE_GNU)
+ # if defined(__CYGWIN__) || defined(__USE_GNU) || defined _NEWLIB_VERSION
// Oddball version of strerror_r
const char * c_str = strerror_r( ev, bp, sz );
return c_str
@@ -251,7 +251,9 @@ namespace
case ENOTEMPTY: return make_error_condition( directory_not_empty );
# endif // ENOTEMPTY != EEXIST
# if ENOTRECOVERABLE != ECONNRESET // the same on some Broadcom chips
+ # ifndef __pnacl__
case ENOTRECOVERABLE: return make_error_condition( state_not_recoverable );
+ # endif
# endif // ENOTRECOVERABLE != ECONNRESET
case ENOTSOCK: return make_error_condition( not_a_socket );
case ENOTSUP: return make_error_condition( not_supported );
@@ -262,7 +264,9 @@ namespace
# endif // EOPNOTSUPP != ENOTSUP
case EOVERFLOW: return make_error_condition( value_too_large );
# if EOWNERDEAD != ECONNABORTED // the same on some Broadcom chips
+ # ifndef __pnacl__
case EOWNERDEAD: return make_error_condition( owner_dead );
+ # endif
# endif // EOWNERDEAD != ECONNABORTED
case EPERM: return make_error_condition( operation_not_permitted );
case EPIPE: return make_error_condition( broken_pipe );
diff --git a/tools/build/v2/tools/gcc.jam b/tools/build/v2/tools/gcc.jam
--- a/tools/build/v2/tools/gcc.jam
+++ b/tools/build/v2/tools/gcc.jam
@@ -1032,7 +1032,7 @@ rule setup-threading ( targets * : sources * : properties * )
case *bsd : option = -pthread ; # There is no -lrt on BSD.
case sgi : # gcc on IRIX does not support multi-threading.
case darwin : # No threading options.
- case * : option = -pthread ; libs = rt ;
+ case * : option = -pthread ;
}
if $(option)