Ticket #11653: boost_config_vxworks.patch

File boost_config_vxworks.patch, 2.5 KB (added by Brian Kuhl <brian.kuhl@…>, 7 years ago)
  • boost_1_59_0/boost/config/platform/vxworks.hpp

    diff -uNdr VSBsim\usr\h\public\boost\config/platform/vxworks.hpp BB_boost\usr\h\public\boost\config/platform/vxworks.hpp
     
    286286  return -1;
    287287}
    288288
    289 // vxWorks claims to implement gettimeofday in sys/time.h
    290 // but nevertheless does not provide it! See
    291 // https://support.windriver.com/olsPortal/faces/maintenance/techtipDetail_noHeader.jspx?docId=16442&contentId=WR_TECHTIP_006256
    292 // We implement a surrogate version here via clock_gettime:
     289#if (_WRS_VXWORKS_MAJOR < 7)
     290
    293291inline int gettimeofday(struct timeval *tv, void * /*tzv*/) {
    294292  struct timespec ts;
    295293  clock_gettime(CLOCK_MONOTONIC, &ts);
     
    297295  tv->tv_usec = ts.tv_nsec / 1000;
    298296  return 0;
    299297}
     298#endif
     299
    300300
    301301// vxWorks does provide neither struct tms nor function times()!
    302302// We implement an empty dummy-function, simply setting the user
     
    327327  return ticks;
    328328}
    329329
     330extern void     bzero       (void *, size_t);    // FD_ZERO uses bzero() but doesn't include strings.h
    330331} // extern "C"
    331332
    332333// Put the selfmade functions into the std-namespace, just in case
     
    360361#if !defined(BUS_ADRALN) && defined(BUS_ADRALNR)
    361362#  define BUS_ADRALN     BUS_ADRALNR                   // Correct a supposed typo in vxWorks' <signal.h>
    362363#endif
    363 //typedef int              locale_t;                     // locale_t is a POSIX-extension, currently unpresent in vxWorks!
     364typedef int              locale_t;                     // locale_t is a POSIX-extension, currently not present in vxWorks!
    364365
    365366// #include boilerplate code:
    366367#include <boost/config/posix_features.hpp>
    367368
    368369// vxWorks lies about XSI conformance, there is no nl_types.h:
    369370#undef BOOST_HAS_NL_TYPES_H
     371
     372// vxWorks 7 adds C++11 support
     373// however it is optional, and does not match exactly the support determined
     374// by examining Dinkum STL version and GCC version (or ICC and DCC)
     375
     376#ifndef _WRS_CONFIG_LANG_LIB_CPLUS_CPLUS_USER_2011
     377#  define BOOST_NO_CXX11_HDR_ARRAY
     378#  define BOOST_NO_CXX11_HDR_TYPEINDEX
     379#  define BOOST_NO_CXX11_HDR_TYPE_TRAITS
     380#  define BOOST_NO_CXX11_HDR_TUPLE
     381#  define BOOST_NO_CXX11_ALLOCATOR
     382#  define BOOST_NO_CXX11_SMART_PTR
     383#  define BOOST_NO_CXX11_STD_ALIGN
     384#  define BOOST_NO_CXX11_HDR_UNORDERED_SET
     385#  define BOOST_NO_CXX11_HDR_TYPE_TRAITS
     386#  define BOOST_NO_CXX11_HDR_UNORDERED_MAP
     387#  define BOOST_NO_CXX11_HDR_FUNCTIONAL
     388#  define BOOST_NO_CXX11_HDR_ATOMIC
     389#else
     390#  define BOOST_NO_CXX11_NULLPTR
     391#endif
     392