166458Sdfr// Specific definitions for Darwin -*- C++ -*- 266458Sdfr 366458Sdfr// Copyright (C) 2004-2020 Free Software Foundation, Inc. 4139790Simp// 566458Sdfr// This file is part of the GNU ISO C++ Library. This library is free 666458Sdfr// software; you can redistribute it and/or modify it under the 766458Sdfr// terms of the GNU General Public License as published by the 866458Sdfr// Free Software Foundation; either version 3, or (at your option) 966458Sdfr// any later version. 1066458Sdfr 1166458Sdfr// This library is distributed in the hope that it will be useful, 1266458Sdfr// but WITHOUT ANY WARRANTY; without even the implied warranty of 1366458Sdfr// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 1466458Sdfr// GNU General Public License for more details. 1566458Sdfr 1666458Sdfr// Under Section 7 of GPL version 3, you are granted additional 1766458Sdfr// permissions described in the GCC Runtime Library Exception, version 1866458Sdfr// 3.1, as published by the Free Software Foundation. 1966458Sdfr 2066458Sdfr// You should have received a copy of the GNU General Public License and 2166458Sdfr// a copy of the GCC Runtime Library Exception along with this program; 2266458Sdfr// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see 2366458Sdfr// <http://www.gnu.org/licenses/>. 2466458Sdfr 2566458Sdfr 2666458Sdfr#ifndef _GLIBCXX_OS_DEFINES 2766458Sdfr#define _GLIBCXX_OS_DEFINES 1 2866458Sdfr 2966458Sdfr// System-specific #define, typedefs, corrections, etc, go here. This 3066458Sdfr// file will come before all others. 3166458Sdfr 3266458Sdfr/* Darwin has the pthread routines in libSystem, which every program 3366458Sdfr links to, so there's no need for weak-ness for that. */ 3466458Sdfr#define _GLIBCXX_GTHREAD_USE_WEAK 0 3566458Sdfr 3666458Sdfr// On Darwin, in order to enable overriding of operator new and delete, 3766458Sdfr// GCC makes the definition of these functions weak, relies on the 3866458Sdfr// loader to implement weak semantics properly, and uses 3966458Sdfr// -flat_namespace to work around the way that it doesn't. 4066458Sdfr#define _GLIBCXX_WEAK_DEFINITION __attribute__ ((weak)) 4166458Sdfr 4266458Sdfr// Static initializer macro is buggy in darwin, see libstdc++/51906 4366458Sdfr#define _GTHREAD_USE_RECURSIVE_MUTEX_INIT_FUNC 4466458Sdfr 4566458Sdfr// Configure checks for nanosleep fail on Darwin, but nanosleep and 4666458Sdfr// sched_yield are always available, so use them. 47115084Smarcel#define _GLIBCXX_USE_NANOSLEEP 1 48115913Smarcel#define _GLIBCXX_USE_SCHED_YIELD 1 49120222Smarcel 5072892Sjhb// No support for referencing weak symbols without a definition. 51253750Savg#define _GLIBCXX_USE_WEAK_REF 0 52253750Savg 53134287Smarcel#endif 54134287Smarcel