summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2012-07-11 20:03:35 +0200
committerMatúš Kukan <matus.kukan@gmail.com>2012-07-17 16:40:21 +0200
commit6b2da137e595002eb2d8d76d24960be8aa07f07c (patch)
tree36d6b7aa52808e1dde760ab481f6819a9b894f8f
parent1c15d509daff7835b02f8c5c47efca31b2788d61 (diff)
tubes: warning guard for boost/signals2.hpp [-Werror=shadow]
boost 1.44 boost/signals2.hpp with gcc 4.6.3 causes solver/unxlngx6/inc/boost/signals2/detail/slot_template.hpp:122:7: error: declaration of ‘slot’ shadows a member of 'this' [-Werror=shadow] Change-Id: I276e008aaebaca9c115bedc58d29c93c6dc526b8
-rw-r--r--tubes/Package_inc.mk1
-rw-r--r--tubes/inc/tubes/manager.hxx2
-rw-r--r--tubes/inc/tubes/warnings_guard_boost_signals2.hpp44
3 files changed, 46 insertions, 1 deletions
diff --git a/tubes/Package_inc.mk b/tubes/Package_inc.mk
index 3ac88764187e..2573c05a7eec 100644
--- a/tubes/Package_inc.mk
+++ b/tubes/Package_inc.mk
@@ -33,6 +33,7 @@ $(eval $(call gb_Package_add_file,tubes_inc,inc/tubes/file-transfer-helper.h,tub
$(eval $(call gb_Package_add_file,tubes_inc,inc/tubes/manager.hxx,tubes/manager.hxx))
$(eval $(call gb_Package_add_file,tubes_inc,inc/tubes/packet.hxx,tubes/packet.hxx))
$(eval $(call gb_Package_add_file,tubes_inc,inc/tubes/tubesdllapi.h,tubes/tubesdllapi.h))
+$(eval $(call gb_Package_add_file,tubes_inc,inc/tubes/warnings_guard_boost_signals2.hpp,tubes/warnings_guard_boost_signals2.hpp))
#$(eval $(call gb_Package_add_file,tubes_inc,inc/tubes/,tubes/))
diff --git a/tubes/inc/tubes/manager.hxx b/tubes/inc/tubes/manager.hxx
index 326cc5191d22..ee743432f46c 100644
--- a/tubes/inc/tubes/manager.hxx
+++ b/tubes/inc/tubes/manager.hxx
@@ -40,7 +40,7 @@
#include <tools/link.hxx>
#include <telepathy-glib/telepathy-glib.h>
#include <vector>
-#include <boost/signals2.hpp>
+#include <tubes/warnings_guard_boost_signals2.hpp>
// For testing purposes, we might need more in future.
#define LIBO_TUBES_DBUS_INTERFACE "org.libreoffice.calc"
diff --git a/tubes/inc/tubes/warnings_guard_boost_signals2.hpp b/tubes/inc/tubes/warnings_guard_boost_signals2.hpp
new file mode 100644
index 000000000000..90a4c08214a5
--- /dev/null
+++ b/tubes/inc/tubes/warnings_guard_boost_signals2.hpp
@@ -0,0 +1,44 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * 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/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef INCLUDED_WARNINGS_GUARD_BOOST_SIGNALS2_HPP
+#define INCLUDED_WARNINGS_GUARD_BOOST_SIGNALS2_HPP
+
+// Because the GCC system_header mechanism doesn't work in .c/.cxx compilation
+// units and more important affects the rest of the current include file, the
+// warnings guard is separated into this header file on its own.
+
+// boost 1.44 boost/signals2.hpp with gcc 4.6.3 causes
+// solver/unxlngx6/inc/boost/signals2/detail/slot_template.hpp:122:7: error:
+// declaration of ‘slot’ shadows a member of 'this' [-Werror=shadow]
+// We want to minimize the patches to external headers, so the warnings are
+// disabled here instead of in the header file itself.
+#ifdef _MSC_VER
+#pragma warning(push, 1)
+#elif defined __GNUC__
+#pragma GCC system_header
+#endif
+#include <boost/signals2.hpp>
+#ifdef _MSC_VER
+#pragma warning(pop)
+#endif
+
+#endif // INCLUDED_WARNINGS_GUARD_BOOST_SIGNALS2_HPP
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */