In common.h, define func_lib for function objects. In configure.ac, define HAVE_STD_FUNCTION and HAVE_BOOST_FUNCTION. Include function headers in ndnboost.
diff --git a/ndnboost/config/compiler/borland.hpp b/ndnboost/config/compiler/borland.hpp
index bcb6156..99965c4 100644
--- a/ndnboost/config/compiler/borland.hpp
+++ b/ndnboost/config/compiler/borland.hpp
@@ -190,6 +190,7 @@
#define BOOST_NO_CXX11_VARIADIC_TEMPLATES
#define BOOST_NO_CXX11_NOEXCEPT
#define BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX
+#define BOOST_NO_CXX11_USER_DEFINED_LITERALS
#if __BORLANDC__ >= 0x590
# define BOOST_HAS_TR1_HASH
diff --git a/ndnboost/config/compiler/clang.hpp b/ndnboost/config/compiler/clang.hpp
index 18d6e54..8e38821 100644
--- a/ndnboost/config/compiler/clang.hpp
+++ b/ndnboost/config/compiler/clang.hpp
@@ -20,7 +20,7 @@
# define BOOST_NO_TYPEID
#endif
-#if defined(__int64)
+#if defined(__int64) && !defined(__GNUC__)
# define BOOST_HAS_MS_INT64
#endif
@@ -38,6 +38,16 @@
# define BOOST_SYMBOL_VISIBLE __attribute__((__visibility__("default")))
#endif
+//
+// The BOOST_FALLTHROUGH macro can be used to annotate implicit fall-through
+// between switch labels.
+//
+#if __cplusplus >= 201103L && defined(__has_warning)
+# if __has_feature(cxx_attributes) && __has_warning("-Wimplicit-fallthrough")
+# define BOOST_FALLTHROUGH [[clang::fallthrough]]
+# endif
+#endif
+
#if !__has_feature(cxx_auto_type)
# define BOOST_NO_CXX11_AUTO_DECLARATIONS
# define BOOST_NO_CXX11_AUTO_MULTIDECLARATIONS
@@ -132,6 +142,10 @@
# define BOOST_NO_CXX11_VARIADIC_TEMPLATES
#endif
+#if !__has_feature(cxx_user_literals)
+# define BOOST_NO_CXX11_USER_DEFINED_LITERALS
+#endif
+
// Clang always supports variadic macros
// Clang always supports extern templates
diff --git a/ndnboost/config/compiler/codegear.hpp b/ndnboost/config/compiler/codegear.hpp
index 90790de..7108663 100644
--- a/ndnboost/config/compiler/codegear.hpp
+++ b/ndnboost/config/compiler/codegear.hpp
@@ -110,6 +110,7 @@
#define BOOST_NO_CXX11_UNICODE_LITERALS
#define BOOST_NO_CXX11_VARIADIC_TEMPLATES
#define BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX
+#define BOOST_NO_CXX11_USER_DEFINED_LITERALS
//
// TR1 macros:
diff --git a/ndnboost/config/compiler/common_edg.hpp b/ndnboost/config/compiler/common_edg.hpp
index 441a055..4b5d2d2 100644
--- a/ndnboost/config/compiler/common_edg.hpp
+++ b/ndnboost/config/compiler/common_edg.hpp
@@ -95,6 +95,7 @@
#define BOOST_NO_CXX11_UNICODE_LITERALS
#define BOOST_NO_CXX11_VARIADIC_TEMPLATES
#define BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX
+#define BOOST_NO_CXX11_USER_DEFINED_LITERALS
#ifdef c_plusplus
// EDG has "long long" in non-strict mode
diff --git a/ndnboost/config/compiler/cray.hpp b/ndnboost/config/compiler/cray.hpp
index cabb98a..43a5db9 100644
--- a/ndnboost/config/compiler/cray.hpp
+++ b/ndnboost/config/compiler/cray.hpp
@@ -51,6 +51,7 @@
#define BOOST_NO_CXX11_DECLTYPE_N3276
#define BOOST_NO_CXX11_DECLTYPE
#define BOOST_NO_CXX11_CONSTEXPR
+#define BOOST_NO_CXX11_USER_DEFINED_LITERALS
#define BOOST_NO_COMPLETE_VALUE_INITIALIZATION
#define BOOST_NO_CXX11_CHAR32_T
#define BOOST_NO_CXX11_CHAR16_T
diff --git a/ndnboost/config/compiler/digitalmars.hpp b/ndnboost/config/compiler/digitalmars.hpp
index 15cc209..0206dc3 100644
--- a/ndnboost/config/compiler/digitalmars.hpp
+++ b/ndnboost/config/compiler/digitalmars.hpp
@@ -86,6 +86,7 @@
#define BOOST_NO_CXX11_UNICODE_LITERALS
#define BOOST_NO_CXX11_VARIADIC_TEMPLATES
#define BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX
+#define BOOST_NO_CXX11_USER_DEFINED_LITERALS
#if (__DMC__ < 0x812)
#define BOOST_NO_CXX11_VARIADIC_MACROS
diff --git a/ndnboost/config/compiler/gcc.hpp b/ndnboost/config/compiler/gcc.hpp
index c0ac30a..b3d12ec 100644
--- a/ndnboost/config/compiler/gcc.hpp
+++ b/ndnboost/config/compiler/gcc.hpp
@@ -11,7 +11,14 @@
// See http://www.boost.org for most recent version.
-// GNU C++ compiler setup:
+// GNU C++ compiler setup.
+
+//
+// Define BOOST_GCC so we know this is "real" GCC and not some pretender:
+//
+#if !defined(__CUDACC__)
+#define BOOST_GCC (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__)
+#endif
#if __GNUC__ < 3
# if __GNUC_MINOR__ == 91
@@ -147,9 +154,16 @@
#endif
//
-// Recent GCC versions have __int128 when in 64-bit mode:
+// Recent GCC versions have __int128 when in 64-bit mode.
//
-#if defined(__SIZEOF_INT128__)
+// We disable this if the compiler is really nvcc as it
+// doesn't actually support __int128 as of CUDA_VERSION=5000
+// even though it defines __SIZEOF_INT128__.
+// See https://svn.boost.org/trac/boost/ticket/8048
+// Only re-enable this for nvcc if you're absolutely sure
+// of the circumstances under which it's supported:
+//
+#if defined(__SIZEOF_INT128__) && !defined(__CUDACC__)
# define BOOST_HAS_INT128
#endif
@@ -222,12 +236,18 @@
#define BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX
#endif
+// C++0x features in 4.7.n and later
+//
#if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 7) || !defined(__GXX_EXPERIMENTAL_CXX0X__)
# define BOOST_NO_CXX11_TEMPLATE_ALIASES
+# define BOOST_NO_CXX11_USER_DEFINED_LITERALS
#endif
-// C++0x features not supported at all yet
+
+// C++0x features in 4.8.1 and later
//
-#define BOOST_NO_CXX11_DECLTYPE_N3276
+#if (__GNUC__*10000 + __GNUC_MINOR__*100 + __GNUC_PATCHLEVEL__ < 40801) || !defined(__GXX_EXPERIMENTAL_CXX0X__)
+# define BOOST_NO_CXX11_DECLTYPE_N3276
+#endif
#ifndef BOOST_COMPILER
# define BOOST_COMPILER "GNU C++ version " __VERSION__
diff --git a/ndnboost/config/compiler/gcc_xml.hpp b/ndnboost/config/compiler/gcc_xml.hpp
index eaed4b5..1af2fc1 100644
--- a/ndnboost/config/compiler/gcc_xml.hpp
+++ b/ndnboost/config/compiler/gcc_xml.hpp
@@ -53,7 +53,8 @@
# define BOOST_NO_CXX11_RAW_LITERALS
# define BOOST_NO_CXX11_UNICODE_LITERALS
# define BOOST_NO_CXX11_NOEXCEPT
-#define BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX
+# define BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX
+# define BOOST_NO_CXX11_USER_DEFINED_LITERALS
#define BOOST_COMPILER "GCC-XML C++ version " __GCCXML__
diff --git a/ndnboost/config/compiler/hp_acc.hpp b/ndnboost/config/compiler/hp_acc.hpp
index bad1a45..f2c917a 100644
--- a/ndnboost/config/compiler/hp_acc.hpp
+++ b/ndnboost/config/compiler/hp_acc.hpp
@@ -118,6 +118,7 @@
#define BOOST_NO_CXX11_TEMPLATE_ALIASES
#define BOOST_NO_CXX11_UNICODE_LITERALS
#define BOOST_NO_CXX11_VARIADIC_TEMPLATES
+#define BOOST_NO_CXX11_USER_DEFINED_LITERALS
/*
See https://forums13.itrc.hp.com/service/forums/questionanswer.do?threadId=1443331 and
diff --git a/ndnboost/config/compiler/intel.hpp b/ndnboost/config/compiler/intel.hpp
index e79e3cf..ea27b8d 100644
--- a/ndnboost/config/compiler/intel.hpp
+++ b/ndnboost/config/compiler/intel.hpp
@@ -181,7 +181,7 @@
// (Niels Dekker, LKEB, May 2010)
// Apparently Intel 12.1 (compiler version number 9999 !!) has the same issue (compiler regression).
#if defined(__INTEL_COMPILER)
-# if (__INTEL_COMPILER <= 1110) || (__INTEL_COMPILER == 9999)
+# if (__INTEL_COMPILER <= 1110) || (__INTEL_COMPILER == 9999) || (defined(_WIN32) && (__INTEL_COMPILER < 1500))
# define BOOST_NO_COMPLETE_VALUE_INITIALIZATION
# endif
#endif
diff --git a/ndnboost/config/compiler/metrowerks.hpp b/ndnboost/config/compiler/metrowerks.hpp
index 184cb71..4ca8af8 100644
--- a/ndnboost/config/compiler/metrowerks.hpp
+++ b/ndnboost/config/compiler/metrowerks.hpp
@@ -119,6 +119,7 @@
#define BOOST_NO_CXX11_VARIADIC_TEMPLATES
#define BOOST_NO_CXX11_VARIADIC_MACROS
#define BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX
+#define BOOST_NO_CXX11_USER_DEFINED_LITERALS
#define BOOST_COMPILER "Metrowerks CodeWarrior C++ version " BOOST_STRINGIZE(BOOST_COMPILER_VERSION)
diff --git a/ndnboost/config/compiler/mpw.hpp b/ndnboost/config/compiler/mpw.hpp
index 14adee0..7ef38ef 100644
--- a/ndnboost/config/compiler/mpw.hpp
+++ b/ndnboost/config/compiler/mpw.hpp
@@ -68,6 +68,7 @@
#define BOOST_NO_CXX11_VARIADIC_TEMPLATES
#define BOOST_NO_CXX11_VARIADIC_MACROS
#define BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX
+#define BOOST_NO_CXX11_USER_DEFINED_LITERALS
//
// versions check:
diff --git a/ndnboost/config/compiler/pathscale.hpp b/ndnboost/config/compiler/pathscale.hpp
index 3041126..07d1460 100644
--- a/ndnboost/config/compiler/pathscale.hpp
+++ b/ndnboost/config/compiler/pathscale.hpp
@@ -76,5 +76,6 @@
# define BOOST_NO_CXX11_HDR_CONDITION_VARIABLE
# define BOOST_NO_CXX11_HDR_CODECVT
# define BOOST_NO_CXX11_HDR_CHRONO
+# define BOOST_NO_CXX11_USER_DEFINED_LITERALS
#endif
diff --git a/ndnboost/config/compiler/pgi.hpp b/ndnboost/config/compiler/pgi.hpp
index fa32fef..64c0d75 100644
--- a/ndnboost/config/compiler/pgi.hpp
+++ b/ndnboost/config/compiler/pgi.hpp
@@ -111,6 +111,7 @@
#define BOOST_NO_CXX11_HDR_CODECVT
#define BOOST_NO_CXX11_HDR_CHRONO
#define BOOST_NO_CXX11_HDR_ARRAY
+#define BOOST_NO_CXX11_USER_DEFINED_LITERALS
//
// version check:
diff --git a/ndnboost/config/compiler/sunpro_cc.hpp b/ndnboost/config/compiler/sunpro_cc.hpp
index 65beb50..88421ee 100644
--- a/ndnboost/config/compiler/sunpro_cc.hpp
+++ b/ndnboost/config/compiler/sunpro_cc.hpp
@@ -127,6 +127,7 @@
#define BOOST_NO_CXX11_VARIADIC_TEMPLATES
#define BOOST_NO_CXX11_VARIADIC_MACROS
#define BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX
+#define BOOST_NO_CXX11_USER_DEFINED_LITERALS
//
// Version
diff --git a/ndnboost/config/compiler/vacpp.hpp b/ndnboost/config/compiler/vacpp.hpp
index 2410d5a..47b9903 100644
--- a/ndnboost/config/compiler/vacpp.hpp
+++ b/ndnboost/config/compiler/vacpp.hpp
@@ -53,8 +53,8 @@
#error "Compiler not supported or configured - please reconfigure"
#endif
//
-// last known and checked version is 1110:
-#if (__IBMCPP__ > 1110)
+// last known and checked version is 1210:
+#if (__IBMCPP__ > 1210)
# if defined(BOOST_ASSERT_CONFIG)
# error "Unknown compiler version - please run the configure tests and report the results"
# endif
@@ -106,6 +106,7 @@
#define BOOST_NO_CXX11_NULLPTR
#define BOOST_NO_CXX11_RANGE_BASED_FOR
#define BOOST_NO_CXX11_RAW_LITERALS
+#define BOOST_NO_CXX11_USER_DEFINED_LITERALS
#if ! __IBMCPP_RVALUE_REFERENCES
# define BOOST_NO_CXX11_RVALUE_REFERENCES
#endif
diff --git a/ndnboost/config/compiler/visualc.hpp b/ndnboost/config/compiler/visualc.hpp
index 22c5708..a7d3025 100644
--- a/ndnboost/config/compiler/visualc.hpp
+++ b/ndnboost/config/compiler/visualc.hpp
@@ -134,10 +134,6 @@
// (Niels Dekker, LKEB, May 2010)
# define BOOST_NO_COMPLETE_VALUE_INITIALIZATION
-#if _MSC_VER < 1600 || !defined(BOOST_STRICT_CONFIG) // 150X == VC++ 9.0
-# define BOOST_NO_CXX11_HDR_INITIALIZER_LIST
-#endif
-
#ifndef _NATIVE_WCHAR_T_DEFINED
# define BOOST_NO_INTRINSIC_WCHAR_T
#endif
@@ -221,24 +217,32 @@
# define BOOST_NO_CXX11_SCOPED_ENUMS
#endif // _MSC_VER < 1700
-// C++0x features not supported by any versions
+// C++11 features supported by VC++ 11 (aka 2012) November 2012 CTP
+// Because the CTP is unsupported, unrelease, and only alpha quality,
+// it is only supported if BOOST_MSVC_ENABLE_2012_NOV_CTP is defined.
+//
+#if _MSC_FULL_VER < 170051025 || !defined(BOOST_MSVC_ENABLE_2012_NOV_CTP)
+# define BOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS
+# define BOOST_NO_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGS
+# define BOOST_NO_CXX11_RAW_LITERALS
+# define BOOST_NO_CXX11_VARIADIC_TEMPLATES
+# define BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX
+#endif
+
+// C++11 features not supported by any versions
#define BOOST_NO_CXX11_CHAR16_T
#define BOOST_NO_CXX11_CHAR32_T
#define BOOST_NO_CXX11_CONSTEXPR
#define BOOST_NO_CXX11_DECLTYPE_N3276
#define BOOST_NO_CXX11_DEFAULTED_FUNCTIONS
#define BOOST_NO_CXX11_DELETED_FUNCTIONS
-#define BOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS
-#define BOOST_NO_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGS
-#define BOOST_NO_CXX11_HDR_INITIALIZER_LIST
#define BOOST_NO_CXX11_NOEXCEPT
-#define BOOST_NO_CXX11_RAW_LITERALS
#define BOOST_NO_CXX11_TEMPLATE_ALIASES
#define BOOST_NO_CXX11_UNICODE_LITERALS
-#define BOOST_NO_CXX11_VARIADIC_TEMPLATES
#define BOOST_NO_SFINAE_EXPR
#define BOOST_NO_TWO_PHASE_NAME_LOOKUP
-#define BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX
+#define BOOST_NO_CXX11_USER_DEFINED_LITERALS
+
//
// prefix and suffix headers:
//
diff --git a/ndnboost/config/platform/vxworks.hpp b/ndnboost/config/platform/vxworks.hpp
index 92aeade..b94c329 100644
--- a/ndnboost/config/platform/vxworks.hpp
+++ b/ndnboost/config/platform/vxworks.hpp
@@ -1,31 +1,369 @@
-// (C) Copyright Dustin Spicuzza 2009.
-// Use, modification and distribution are subject to the
-// Boost Software License, Version 1.0. (See accompanying file
+// (C) Copyright Dustin Spicuzza 2009.
+// Adapted to vxWorks 6.9 by Peter Brockamp 2012.
+// 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.
-// vxWorks specific config options:
+// Since WRS does not yet properly support boost under vxWorks
+// and this file was badly outdated, but I was keen on using it,
+// I patched boost myself to make things work. This has been tested
+// and adapted by me for vxWorks 6.9 *only*, as I'm lacking access
+// to earlier 6.X versions! The only thing I know for sure is that
+// very old versions of vxWorks (namely everything below 6.x) are
+// absolutely unable to use boost. This is mainly due to the completely
+// outdated libraries and ancient compiler (GCC 2.96 or worse). Do
+// not even think of getting this to work, a miserable failure will
+// be guaranteed!
+// Equally, this file has been tested for RTPs (Real Time Processes)
+// only, not for DKMs (Downloadable Kernel Modules). These two types
+// of executables differ largely in the available functionality of
+// the C-library, STL, and so on. A DKM uses a library similar to those
+// of vxWorks 5.X - with all its limitations and incompatibilities
+// with respect to ANSI C++ and STL. So probably there might be problems
+// with the usage of boost from DKMs. WRS or any voluteers are free to
+// prove the opposite!
-#define BOOST_PLATFORM "vxWorks"
+// ====================================================================
+//
+// Some important information regarding the usage of POSIX semaphores:
+// -------------------------------------------------------------------
+//
+// VxWorks as a real time operating system handles threads somewhat
+// different from what "normal" OSes do, regarding their scheduling!
+// This could lead to a scenario called "priority inversion" when using
+// semaphores, see http://en.wikipedia.org/wiki/Priority_inversion.
+//
+// Now, VxWorks POSIX-semaphores for DKM's default to the usage of
+// priority inverting semaphores, which is fine. On the other hand,
+// for RTP's it defaults to using non priority inverting semaphores,
+// which could easily pose a serious problem for a real time process,
+// i.e. deadlocks! To overcome this two possibilities do exist:
+//
+// a) Patch every piece of boost that uses semaphores to instanciate
+// the proper type of semaphores. This is non-intrusive with respect
+// to the OS and could relatively easy been done by giving all
+// semaphores attributes deviating from the default (for in-depth
+// information see the POSIX functions pthread_mutexattr_init()
+// and pthread_mutexattr_setprotocol()). However this breaks all
+// too easily, as with every new version some boost library could
+// all in a sudden start using semaphores, resurrecting the very
+// same, hard to locate problem over and over again!
+//
+// b) We could change the default properties for POSIX-semaphores
+// that VxWorks uses for RTP's and this is being suggested here,
+// as it will more or less seamlessly integrate with boost. I got
+// the following information from WRS how to do this, compare
+// Wind River TSR# 1209768:
+//
+// Instructions for changing the default properties of POSIX-
+// semaphores for RTP's in VxWorks 6.9:
+// - Edit the file /vxworks-6.9/target/usr/src/posix/pthreadLib.c
+// in the root of your Workbench-installation.
+// - Around line 917 there should be the definition of the default
+// mutex attributes:
+//
+// LOCAL pthread_mutexattr_t defaultMutexAttr =
+// {
+// PTHREAD_INITIALIZED_OBJ, PTHREAD_PRIO_NONE, 0,
+// PTHREAD_MUTEX_DEFAULT
+// };
+//
+// Here, replace PTHREAD_PRIO_NONE by PTHREAD_PRIO_INHERIT.
+// - Around line 1236 there should be a definition for the function
+// pthread_mutexattr_init(). A couple of lines below you should
+// find a block of code like this:
+//
+// pAttr->mutexAttrStatus = PTHREAD_INITIALIZED_OBJ;
+// pAttr->mutexAttrProtocol = PTHREAD_PRIO_NONE;
+// pAttr->mutexAttrPrioceiling = 0;
+// pAttr->mutexAttrType = PTHREAD_MUTEX_DEFAULT;
+//
+// Here again, replace PTHREAD_PRIO_NONE by PTHREAD_PRIO_INHERIT.
+// - Finally, rebuild your VSB. This will create a new VxWorks kernel
+// with the changed properties. That's it! Now, using boost should
+// no longer cause any problems with task deadlocks!
+//
+// And here's another useful piece of information concerning VxWorks'
+// POSIX-functionality in general:
+// VxWorks is not a genuine POSIX-OS in itself, rather it is using a
+// kind of compatibility layer (sort of a wrapper) to emulate the
+// POSIX-functionality by using its own resources and functions.
+// At the time a task (thread) calls it's first POSIX-function during
+// runtime it is being transformed by the OS into a POSIX-thread.
+// This transformation does include a call to malloc() to allocate the
+// memory required for the housekeeping of POSIX-threads. In a high
+// priority RTP this malloc() call may be highly undesirable, as its
+// timing is more or less unpredictable (depending on what your actual
+// heap looks like). You can circumvent this problem by calling the
+// function thread_self() at a well defined point in the code of the
+// task, e.g. shortly after the task spawns up. Thereby you are able
+// to define the time when the task-transformation will take place and
+// you could shift it to an uncritical point where a malloc() call is
+// tolerable. So, if this could pose a problem for your code, remember
+// to call thread_self() from the affected task at an early stage.
+//
+// ====================================================================
-#define BOOST_NO_CWCHAR
-#define BOOST_NO_INTRINSIC_WCHAR_T
-
-#if defined(__GNUC__) && defined(__STRICT_ANSI__)
-#define BOOST_NO_INT64_T
+// Block out all versions before vxWorks 6.x, as these don't work:
+// Include header with the vxWorks version information and query them
+#include <version.h>
+#if !defined(_WRS_VXWORKS_MAJOR) || (_WRS_VXWORKS_MAJOR < 6)
+# error "The vxWorks version you're using is so badly outdated,\
+ it doesn't work at all with boost, sorry, no chance!"
#endif
+// Handle versions above 5.X but below 6.9
+#if (_WRS_VXWORKS_MAJOR == 6) && (_WRS_VXWORKS_MINOR < 9)
+// TODO: Starting from what version does vxWorks work with boost?
+// We can't reasonably insert a #warning "" as a user hint here,
+// as this will show up with every file including some boost header,
+// badly bugging the user... So for the time being we just leave it.
+#endif
+
+// vxWorks specific config options:
+// --------------------------------
+#define BOOST_PLATFORM "vxWorks"
+
+// Special behaviour for DKMs:
+#ifdef _WRS_KERNEL
+ // DKMs do not have the <cwchar>-header,
+ // but apparently they do have an intrinsic wchar_t meanwhile!
+# define BOOST_NO_CWCHAR
+
+ // Lots of wide-functions and -headers are unavailable for DKMs as well:
+# define BOOST_NO_CWCTYPE
+# define BOOST_NO_SWPRINTF
+# define BOOST_NO_STD_WSTRING
+# define BOOST_NO_STD_WSTREAMBUF
+#endif
+
+// Generally available headers:
#define BOOST_HAS_UNISTD_H
+#define BOOST_HAS_STDINT_H
+#define BOOST_HAS_DIRENT_H
+#define BOOST_HAS_SLIST
-// these allow posix_features to work, since vxWorks doesn't
-// define them itself
-#define _POSIX_TIMERS 1
-#define _POSIX_THREADS 1
+// vxWorks does not have installed an iconv-library by default,
+// so unfortunately no Unicode support from scratch is available!
+// Thus, instead it is suggested to switch to ICU, as this seems
+// to be the most complete and portable option...
+#define BOOST_LOCALE_WITH_ICU
-// vxworks doesn't work with asio serial ports
+// Generally available functionality:
+#define BOOST_HAS_THREADS
+#define BOOST_HAS_NANOSLEEP
+#define BOOST_HAS_GETTIMEOFDAY
+#define BOOST_HAS_CLOCK_GETTIME
+#define BOOST_HAS_MACRO_USE_FACET
+
+// Generally unavailable functionality, delivered by boost's test function:
+//#define BOOST_NO_DEDUCED_TYPENAME // Commented this out, boost's test gives an errorneous result!
+#define BOOST_NO_CXX11_EXTERN_TEMPLATE
+#define BOOST_NO_CXX11_VARIADIC_MACROS
+
+// Generally available threading API's:
+#define BOOST_HAS_PTHREADS
+#define BOOST_HAS_SCHED_YIELD
+#define BOOST_HAS_SIGACTION
+
+// Functionality available for RTPs only:
+#ifdef __RTP__
+# define BOOST_HAS_PTHREAD_MUTEXATTR_SETTYPE
+# define BOOST_HAS_LOG1P
+# define BOOST_HAS_EXPM1
+#endif
+
+// Functionality available for DKMs only:
+#ifdef _WRS_KERNEL
+ // Luckily, at the moment there seems to be none!
+#endif
+
+// These #defines allow posix_features to work, since vxWorks doesn't
+// #define them itself for DKMs (for RTPs on the contrary it does):
+#ifdef _WRS_KERNEL
+# ifndef _POSIX_TIMERS
+# define _POSIX_TIMERS 1
+# endif
+# ifndef _POSIX_THREADS
+# define _POSIX_THREADS 1
+# endif
+#endif
+
+// vxWorks doesn't work with asio serial ports:
#define BOOST_ASIO_DISABLE_SERIAL_PORT
+// TODO: The problem here seems to bee that vxWorks uses its own, very specific
+// ways to handle serial ports, incompatible with POSIX or anything...
+// Maybe a specific implementation would be possible, but until the
+// straight need arises... This implementation would presumably consist
+// of some vxWorks specific ioctl-calls, etc. Any voluteers?
-// boilerplate code:
+// vxWorks-around: <time.h> #defines CLOCKS_PER_SEC as sysClkRateGet() but
+// miserably fails to #include the required <sysLib.h> to make
+// sysClkRateGet() available! So we manually include it here.
+#ifdef __RTP__
+# include <time.h>
+# include <sysLib.h>
+#endif
+
+// vxWorks-around: In <stdint.h> the macros INT32_C(), UINT32_C(), INT64_C() and
+// UINT64_C() are defined errorneously, yielding not a signed/
+// unsigned long/long long type, but a signed/unsigned int/long
+// type. Eventually this leads to compile errors in ratio_fwd.hpp,
+// when trying to define several constants which do not fit into a
+// long type! We correct them here by redefining.
+#include <cstdint>
+
+// Some macro-magic to do the job
+#define VX_JOIN(X, Y) VX_DO_JOIN(X, Y)
+#define VX_DO_JOIN(X, Y) VX_DO_JOIN2(X, Y)
+#define VX_DO_JOIN2(X, Y) X##Y
+
+// Correctly setup the macros
+#undef INT32_C
+#undef UINT32_C
+#undef INT64_C
+#undef UINT64_C
+#define INT32_C(x) VX_JOIN(x, L)
+#define UINT32_C(x) VX_JOIN(x, UL)
+#define INT64_C(x) VX_JOIN(x, LL)
+#define UINT64_C(x) VX_JOIN(x, ULL)
+
+// #include Libraries required for the following function adaption
+#include <ioLib.h>
+#include <tickLib.h>
+#include <sys/time.h>
+
+// Use C-linkage for the following helper functions
+extern "C" {
+
+// vxWorks-around: The required functions getrlimit() and getrlimit() are missing.
+// But we have the similar functions getprlimit() and setprlimit(),
+// which may serve the purpose.
+// Problem: The vxWorks-documentation regarding these functions
+// doesn't deserve its name! It isn't documented what the first two
+// parameters idtype and id mean, so we must fall back to an educated
+// guess - null, argh... :-/
+
+// TODO: getprlimit() and setprlimit() do exist for RTPs only, for whatever reason.
+// Thus for DKMs there would have to be another implementation.
+#ifdef __RTP__
+ inline int getrlimit(int resource, struct rlimit *rlp){
+ return getprlimit(0, 0, resource, rlp);
+ }
+
+ inline int setrlimit(int resource, const struct rlimit *rlp){
+ return setprlimit(0, 0, resource, const_cast<struct rlimit*>(rlp));
+ }
+#endif
+
+// vxWorks has ftruncate() only, so we do simulate truncate():
+inline int truncate(const char *p, off_t l){
+ int fd = open(p, O_WRONLY);
+ if (fd == -1){
+ errno = EACCES;
+ return -1;
+ }
+ if (ftruncate(fd, l) == -1){
+ close(fd);
+ errno = EACCES;
+ return -1;
+ }
+ return close(fd);
+}
+
+// Fake symlink handling by dummy functions:
+inline int symlink(const char*, const char*){
+ // vxWorks has no symlinks -> always return an error!
+ errno = EACCES;
+ return -1;
+}
+
+inline ssize_t readlink(const char*, char*, size_t){
+ // vxWorks has no symlinks -> always return an error!
+ errno = EACCES;
+ return -1;
+}
+
+// vxWorks claims to implement gettimeofday in sys/time.h
+// but nevertheless does not provide it! See
+// https://support.windriver.com/olsPortal/faces/maintenance/techtipDetail_noHeader.jspx?docId=16442&contentId=WR_TECHTIP_006256
+// We implement a surrogate version here via clock_gettime:
+inline int gettimeofday(struct timeval *tv, void * /*tzv*/) {
+ struct timespec ts;
+ clock_gettime(CLOCK_MONOTONIC, &ts);
+ tv->tv_sec = ts.tv_sec;
+ tv->tv_usec = ts.tv_nsec / 1000;
+ return 0;
+}
+
+// vxWorks does provide neither struct tms nor function times()!
+// We implement an empty dummy-function, simply setting the user
+// and system time to the half of thew actual system ticks-value
+// and the child user and system time to 0.
+// Rather ugly but at least it suppresses compiler errors...
+// Unfortunately, this of course *does* have an severe impact on
+// dependant libraries, actually this is chrono only! Here it will
+// not be possible to correctly use user and system times! But
+// as vxWorks is lacking the ability to calculate user and system
+// process times there seems to be no other possible solution.
+struct tms{
+ clock_t tms_utime; // User CPU time
+ clock_t tms_stime; // System CPU time
+ clock_t tms_cutime; // User CPU time of terminated child processes
+ clock_t tms_cstime; // System CPU time of terminated child processes
+};
+
+inline clock_t times(struct tms *t){
+ struct timespec ts;
+ clock_gettime(CLOCK_THREAD_CPUTIME_ID, &ts);
+ clock_t ticks(static_cast<clock_t>(static_cast<double>(ts.tv_sec) * CLOCKS_PER_SEC +
+ static_cast<double>(ts.tv_nsec) * CLOCKS_PER_SEC / 1000000.0));
+ t->tms_utime = ticks/2U;
+ t->tms_stime = ticks/2U;
+ t->tms_cutime = 0; // vxWorks is lacking the concept of a child process!
+ t->tms_cstime = 0; // -> Set the wait times for childs to 0
+ return ticks;
+}
+
+} // extern "C"
+
+// Put the selfmade functions into the std-namespace, just in case
+namespace std {
+# ifdef __RTP__
+ using ::getrlimit;
+ using ::setrlimit;
+# endif
+ using ::truncate;
+ using ::symlink;
+ using ::readlink;
+ using ::times;
+ using ::gettimeofday;
+}
+
+// Some more macro-magic:
+// vxWorks-around: Some functions are not present or broken in vxWorks
+// but may be patched to life via helper macros...
+
+// Include signal.h which might contain a typo to be corrected here
+#include <signal.h>
+
+#define getpagesize() sysconf(_SC_PAGESIZE) // getpagesize is deprecated anyway!
+#ifndef S_ISSOCK
+# define S_ISSOCK(mode) ((mode & S_IFMT) == S_IFSOCK) // Is file a socket?
+#endif
+#define lstat(p, b) stat(p, b) // lstat() == stat(), as vxWorks has no symlinks!
+#ifndef FPE_FLTINV
+# define FPE_FLTINV (FPE_FLTSUB+1) // vxWorks has no FPE_FLTINV, so define one as a dummy
+#endif
+#if !defined(BUS_ADRALN) && defined(BUS_ADRALNR)
+# define BUS_ADRALN BUS_ADRALNR // Correct a supposed typo in vxWorks' <signal.h>
+#endif
+//typedef int locale_t; // locale_t is a POSIX-extension, currently unpresent in vxWorks!
+
+// #include boilerplate code:
#include <ndnboost/config/posix_features.hpp>
-
+
+// vxWorks lies about XSI conformance, there is no nl_types.h:
+#undef BOOST_HAS_NL_TYPES_H
diff --git a/ndnboost/config/platform/win32.hpp b/ndnboost/config/platform/win32.hpp
index 3922012..6ab59f4 100644
--- a/ndnboost/config/platform/win32.hpp
+++ b/ndnboost/config/platform/win32.hpp
@@ -33,7 +33,9 @@
#if defined(__MINGW32__) && ((__MINGW32_MAJOR_VERSION > 2) || ((__MINGW32_MAJOR_VERSION == 2) && (__MINGW32_MINOR_VERSION >= 0)))
# define BOOST_HAS_STDINT_H
-# define __STDC_LIMIT_MACROS
+# ifndef __STDC_LIMIT_MACROS
+# define __STDC_LIMIT_MACROS
+# endif
# define BOOST_HAS_DIRENT_H
# define BOOST_HAS_UNISTD_H
#endif
diff --git a/ndnboost/config/select_compiler_config.hpp b/ndnboost/config/select_compiler_config.hpp
index ea47d40..2d3cde3 100644
--- a/ndnboost/config/select_compiler_config.hpp
+++ b/ndnboost/config/select_compiler_config.hpp
@@ -33,6 +33,10 @@
// PathScale EKOPath compiler (has to come before clang and gcc)
# define BOOST_COMPILER_CONFIG "ndnboost/config/compiler/pathscale.hpp"
+#elif defined(__INTEL_COMPILER) || defined(__ICL) || defined(__ICC) || defined(__ECC)
+// Intel
+# define BOOST_COMPILER_CONFIG "ndnboost/config/compiler/intel.hpp"
+
#elif defined __clang__
// Clang C++ emulates GCC, so it has to appear early.
# define BOOST_COMPILER_CONFIG "ndnboost/config/compiler/clang.hpp"
@@ -41,10 +45,6 @@
// Digital Mars C++
# define BOOST_COMPILER_CONFIG "ndnboost/config/compiler/digitalmars.hpp"
-#elif defined(__INTEL_COMPILER) || defined(__ICL) || defined(__ICC) || defined(__ECC)
-// Intel
-# define BOOST_COMPILER_CONFIG "ndnboost/config/compiler/intel.hpp"
-
# elif defined __GNUC__
// GNU C++:
# define BOOST_COMPILER_CONFIG "ndnboost/config/compiler/gcc.hpp"
diff --git a/ndnboost/config/stdlib/dinkumware.hpp b/ndnboost/config/stdlib/dinkumware.hpp
index 8ee6bcf..ec7b985 100644
--- a/ndnboost/config/stdlib/dinkumware.hpp
+++ b/ndnboost/config/stdlib/dinkumware.hpp
@@ -87,7 +87,7 @@
#endif
#include <typeinfo>
-#if ( (!_HAS_EXCEPTIONS && !defined(__ghs__)) || (!_HAS_NAMESPACE && defined(__ghs__)) )
+#if ( (!_HAS_EXCEPTIONS && !defined(__ghs__)) || (!_HAS_NAMESPACE && defined(__ghs__)) ) && !defined(__TI_COMPILER_VERSION__)
# define BOOST_NO_STD_TYPEINFO
#endif
diff --git a/ndnboost/config/stdlib/libstdcpp3.hpp b/ndnboost/config/stdlib/libstdcpp3.hpp
index c56dff2..976ab76 100644
--- a/ndnboost/config/stdlib/libstdcpp3.hpp
+++ b/ndnboost/config/stdlib/libstdcpp3.hpp
@@ -35,7 +35,8 @@
# if defined(_GLIBCXX_HAVE_GTHR_DEFAULT) \
|| defined(_GLIBCXX__PTHREADS) \
|| defined(_GLIBCXX_HAS_GTHREADS) \
- || defined(_WIN32)
+ || defined(_WIN32) \
+ || defined(_AIX)
//
// If the std lib has thread support turned on, then turn it on in Boost
// as well. We do this because some gcc-3.4 std lib headers define _REENTANT
diff --git a/ndnboost/config/suffix.hpp b/ndnboost/config/suffix.hpp
index fc1eeeb..9f89029 100644
--- a/ndnboost/config/suffix.hpp
+++ b/ndnboost/config/suffix.hpp
@@ -641,7 +641,8 @@
# if defined(_MSC_VER)
# define BOOST_FORCEINLINE __forceinline
# elif defined(__GNUC__) && __GNUC__ > 3
-# define BOOST_FORCEINLINE inline __attribute__ ((always_inline))
+ // Clang also defines __GNUC__ (as 4)
+# define BOOST_FORCEINLINE inline __attribute__ ((__always_inline__))
# else
# define BOOST_FORCEINLINE inline
# endif
@@ -671,7 +672,7 @@
#endif
// Use BOOST_NO_CXX11_HDR_ARRAY instead of BOOST_NO_0X_HDR_ARRAY
-#if defined(BOOST_NO_CXX11_HDR_ARRAY) && !defined(BOOST_NO_BOOST_NO_0X_HDR_ARRAY)
+#if defined(BOOST_NO_CXX11_HDR_ARRAY) && !defined(BOOST_NO_0X_HDR_ARRAY)
# define BOOST_NO_0X_HDR_ARRAY
#endif
// Use BOOST_NO_CXX11_HDR_CHRONO instead of BOOST_NO_0X_HDR_CHRONO
@@ -874,13 +875,25 @@
//
#ifdef BOOST_NO_CXX11_NOEXCEPT
# define BOOST_NOEXCEPT
+# define BOOST_NOEXCEPT_OR_NOTHROW throw()
# define BOOST_NOEXCEPT_IF(Predicate)
# define BOOST_NOEXCEPT_EXPR(Expression) false
#else
# define BOOST_NOEXCEPT noexcept
+# define BOOST_NOEXCEPT_OR_NOTHROW noexcept
# define BOOST_NOEXCEPT_IF(Predicate) noexcept((Predicate))
# define BOOST_NOEXCEPT_EXPR(Expression) noexcept((Expression))
#endif
+//
+// Helper macro BOOST_FALLTHROUGH
+// Fallback definition of BOOST_FALLTHROUGH macro used to mark intended
+// fall-through between case labels in a switch statement. We use a definition
+// that requires a semicolon after it to avoid at least one type of misuse even
+// on unsupported compilers.
+//
+#ifndef BOOST_FALLTHROUGH
+# define BOOST_FALLTHROUGH ((void)0)
+#endif
//
// constexpr workarounds