Kaydet (Commit) 90d21559 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

Work around latest Boost 1.65.1 still using deprecated std::auto_ptr

...in various places, which is gone by default at least from recent libc++ in
C++17 mode.  So bring it back there for now, until Boost is fixed.

Change-Id: I0b3128d114ab2b5693a84bdc7d2b9b9b9b5c3c76
Reviewed-on: https://gerrit.libreoffice.org/45910Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarStephan Bergmann <sbergman@redhat.com>
üst e754d093
......@@ -69,6 +69,7 @@ void ReservedId::run() {
&& id != "_ATL_STATIC_REGISTRY"
// extensions/source/activex/StdAfx2.h
&& id != "_GLIBCXX_CDTOR_CALLABI"
&& id != "_LIBCPP_ENABLE_CXX17_REMOVED_AUTO_PTR" // unotools/source/i18n/resmgr.cxx
&& id != "_MAX_PATH" // Windows
&& id != "_POSIX_SOURCE"
&& id != "_USE_MATH_DEFINES" // include/sal/config.h, Windows
......
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
#ifndef INCLUDED_CONFIG_HOST_CONFIG_LIBCXX_H
#define INCLUDED_CONFIG_HOST_CONFIG_LIBCXX_H
#define HAVE_LIBCXX 0
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */
......@@ -5947,6 +5947,7 @@ foo bar
]])],
[CPP_LIBRARY=LIBCPP
cpp_library_name="LLVM libc++"
AC_DEFINE([HAVE_LIBCXX])
],
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#include <utility>
......@@ -12487,6 +12488,7 @@ AC_CONFIG_HEADERS([config_host/config_global.h])
AC_CONFIG_HEADERS([config_host/config_gpgme.h])
AC_CONFIG_HEADERS([config_host/config_java.h])
AC_CONFIG_HEADERS([config_host/config_lgpl.h])
AC_CONFIG_HEADERS([config_host/config_libcxx.h])
AC_CONFIG_HEADERS([config_host/config_libepubgen.h])
AC_CONFIG_HEADERS([config_host/config_liblangtag.h])
AC_CONFIG_HEADERS([config_host/config_locales.h])
......
......@@ -18,6 +18,12 @@ $(eval $(call gb_StaticLibrary_add_defs,boost_locale,\
-DBOOST_ALL_NO_LIB -DBOOST_LOCALE_NO_WINAPI_BACKEND -DBOOST_LOCALE_NO_POSIX_BACKEND -DBOOST_USE_WINDOWS_H \
))
# Needed when building against libc++ in C++17 mode, as Boost 1.65.1
# workdir/UnpackedTarball/boost/boost/locale/generator.hpp contains "std::auto_ptr<data> d;":
$(eval $(call gb_StaticLibrary_add_defs,boost_locale, \
-D_LIBCPP_ENABLE_CXX17_REMOVED_AUTO_PTR \
))
$(eval $(call gb_StaticLibrary_use_external,boost_locale,boost_headers))
$(eval $(call gb_StaticLibrary_set_generated_cxx_suffix,boost_locale,cpp))
......
......@@ -22,6 +22,10 @@ $(eval $(call gb_ExternalProject_use_externals,libmspub,\
zlib \
))
# -D_LIBCPP_ENABLE_CXX17_REMOVED_AUTO_PTR is needed when building against libc++ in C++17 mode, as
# libmspub configure checking for boost/ptr_container/ptr_vector.hpp can (indirectly) include
# Boost 1.65.1 workdir/UnpackedTarball/boost/boost/ptr_container/detail/reversible_ptr_container.hpp
# which mentions std::auto_ptr:
$(call gb_ExternalProject_get_state_target,libmspub,build) :
$(call gb_ExternalProject_run,build,\
export PKG_CONFIG="" \
......@@ -37,7 +41,8 @@ $(call gb_ExternalProject_get_state_target,libmspub,build) :
$(if $(verbose),--disable-silent-rules,--enable-silent-rules) \
CXXFLAGS="$(gb_CXXFLAGS) $(if $(ENABLE_OPTIMIZED),$(gb_COMPILEROPTFLAGS),$(gb_COMPILERNOOPTFLAGS))" \
CPPFLAGS="$(CPPFLAGS) $(ICU_UCHAR_TYPE) $(BOOST_CPPFLAGS) \
-DBOOST_ERROR_CODE_HEADER_ONLY -DBOOST_SYSTEM_NO_DEPRECATED" \
-DBOOST_ERROR_CODE_HEADER_ONLY -DBOOST_SYSTEM_NO_DEPRECATED \
-D_LIBCPP_ENABLE_CXX17_REMOVED_AUTO_PTR" \
$(if $(CROSS_COMPILING),--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM)) \
&& $(MAKE) \
)
......
......@@ -17,6 +17,14 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
// Needed when #include <boost/locale.hpp> below includes Boost 1.65.1
// workdir/UnpackedTarball/boost/boost/locale/format.hpp using "std::auto_ptr<data> d;", but must
// come very early here in case <memory> is already (indirectly) included earlier:
#include <config_libcxx.h>
#if HAVE_LIBCXX && __cplusplus >= 201703L
#define _LIBCPP_ENABLE_CXX17_REMOVED_AUTO_PTR
#endif
#include <config_folders.h>
#include <sal/config.h>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment