1// Specific definitions for VxWorks -*- C++ -*- 2 3// Copyright (C) 2000-2020 Free Software Foundation, Inc. 4// 5// This file is part of the GNU ISO C++ Library. This library is free 6// software; you can redistribute it and/or modify it under the 7// terms of the GNU General Public License as published by the 8// Free Software Foundation; either version 3, or (at your option) 9// any later version. 10 11// This library is distributed in the hope that it will be useful, 12// but WITHOUT ANY WARRANTY; without even the implied warranty of 13// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14// GNU General Public License for more details. 15 16// Under Section 7 of GPL version 3, you are granted additional 17// permissions described in the GCC Runtime Library Exception, version 18// 3.1, as published by the Free Software Foundation. 19 20// You should have received a copy of the GNU General Public License and 21// a copy of the GCC Runtime Library Exception along with this program; 22// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see 23// <http://www.gnu.org/licenses/>. 24 25/** @file bits/os_defines.h 26 * This is an internal header file, included by other library headers. 27 * Do not attempt to use it directly. @headername{iosfwd} 28 */ 29 30#ifndef _GLIBCXX_OS_DEFINES 31#define _GLIBCXX_OS_DEFINES 1 32 33// System-specific #define, typedefs, corrections, etc, go here. This 34// file will come before all others. 35 36// The system environment we can rely on varies across VxWorks 37// versions. 38#include <_vxworks-versions.h> 39 40// Weak refs are supported starting with VxWorks 7, in RTP mode only 41 42#if _VXWORKS_MAJOR_GE(7) && defined(__RTP__) 43#define _GLIBCXX_USE_WEAK_REF 1 44#else 45#define _GLIBCXX_USE_WEAK_REF 0 46#endif 47 48// We support TLS on VxWorks (either directly or with emutls) 49#define _GLIBCXX_HAVE_TLS 1 50 51// VxWorks7 comes with a DinkumWare library and the system headers which we 52// are going to include for libstdc++ have a few related intrinsic 53// assumptions. We control our own configuration here to best integrate with 54// this environment: use C99 math headers, do not use the FP macros for 55// dynamic cast by default (overriden for RTPs below) and arrange to disable 56// the system TR1 declarations as we'll provide ours. 57 58#if _VXWORKS_MAJOR_GE(7) 59 60#define _GLIBCXX_USE_C99_MATH 1 61#define _GLIBCXX_USE_C99_FP_MACROS_DYNAMIC 0 62 63#undef _HAS_TR1_DECLARATIONS 64#define _HAS_TR1_DECLARATIONS 0 65 66#else // VXWORKS_MAJOR < 7 67 68// For RTPs, use the VxWorks headers as a basis, from which we can use 69// C99 dynamic FP macros and expect (after fixincludes) accurate c++11 70// prototypes for FP. 71 72#ifdef __RTP__ 73 74#define _GLIBCXX_INCLUDE_NEXT_C_HEADERS 1 75 76#undef _GLIBCXX_USE_C99_FP_MACROS_DYNAMIC 77#define _GLIBCXX_USE_C99_FP_MACROS_DYNAMIC 1 78 79#define __CORRECT_ISO_CPP11_MATH_H_PROTO_FP 80 81#else // !__RTP__ 82 83// libstdc++ will include system headers and vxWorks.h ought to have 84// been included ahead for VxWorks kernel modules prior to VxWorks 7 85#include <vxWorks.h> 86 87#endif // __RTP__ 88 89#endif // _VXWORKS_MAJOR >= 7 90 91// The min/max "functions" may be refered to with a namespace prefix. 92// Prevent possible redefinitions as macros from VxWorks headers. 93#undef NOMINMAX 94#define NOMINMAX 1 95 96// Do not include the inline definitions from VxWorks headers, as we'll 97// want to use the ones from libstdc++ instead. 98#undef _NO_CPP_INLINES 99#define _NO_CPP_INLINES 1 100 101#endif // _GLIBCXX_OS_DEFINES 102