// Compatibility symbols for alternate 128-bit long-double format -*- C++ -*- // Copyright (C) 2018-2022 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the // Free Software Foundation; either version 3, or (at your option) // any later version. // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // Under Section 7 of GPL version 3, you are granted additional // permissions described in the GCC Runtime Library Exception, version // 3.1, as published by the Free Software Foundation. // You should have received a copy of the GNU General Public License and // a copy of the GCC Runtime Library Exception along with this program; // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // . #define _GLIBCXX_USE_CXX11_ABI 1 #include #ifdef _GLIBCXX_LONG_DOUBLE_ALT128_COMPAT #if !defined(_GLIBCXX_USE_DUAL_ABI) #error "compatibility-ldbl-alt128-cxx11.cc must only be compiled when dual ABI is enabled" #endif #if ! defined __LONG_DOUBLE_IBM128__ && ! defined __LONG_DOUBLE_IEEE128__ #error "compatibility-ldbl-alt128.cc must only be compiled for 128-bit long double" #endif #define C char #define C_is_char #include "locale-inst-monetary.h" #ifdef _GLIBCXX_USE_WCHAR_T # undef C # undef C_is_char # define C wchar_t # include "locale-inst-monetary.h" #endif #include namespace std _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_VERSION namespace { alignas(money_get) char money_get_c[sizeof(money_get)]; alignas(money_put) char money_put_c[sizeof(money_put)]; #ifdef _GLIBCXX_USE_WCHAR_T alignas(money_get) char money_get_w[sizeof(money_get)]; alignas(money_put) char money_put_w[sizeof(money_put)]; #endif template void init_facet(function& func, Facet* facet) { func(&Facet::id, facet); } } // namespace template class function; void __locale_Impl_init_extra_ldbl128( function f, bool classic) { if (classic) { init_facet(f, new (&money_get_c) money_get(1)); init_facet(f, new (&money_put_c) money_put(1)); #ifdef _GLIBCXX_USE_WCHAR_T init_facet(f, new (&money_get_w) money_get(1)); init_facet(f, new (&money_put_w) money_put(1)); #endif } else { init_facet(f, new money_get); init_facet(f, new money_put); #ifdef _GLIBCXX_USE_WCHAR_T init_facet(f, new money_get); init_facet(f, new money_put); #endif } } _GLIBCXX_END_NAMESPACE_VERSION } // namespace #endif