summaryrefslogtreecommitdiff
path: root/extensions
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2012-12-20 18:21:35 +0100
committerMichael Stahl <mstahl@redhat.com>2012-12-20 18:27:35 +0100
commit032d5ba4fa3389b968ceb0b6c3de587f979f3c04 (patch)
treee34546b32d3be41422c409519a5da78718ec2897 /extensions
parentf011e84a75651204f72d61773772f6a30841d18b (diff)
extensions: oleautobridge: avoid boatloads of warning C4005
... "macro redefinition" mostly from tools/postsys.h by wrapping all inclusion of namespace polluting native windows headers in a single new winwrap.hxx that is then included by the other headers; also cleans up some inconsistent definitions of _WIN32_WINNT Change-Id: Ibfe82a531615d559db2e61e4cdf399e68d0b3223
Diffstat (limited to 'extensions')
-rw-r--r--extensions/source/ole/jscriptclasses.hxx21
-rw-r--r--extensions/source/ole/ole2uno.hxx23
-rw-r--r--extensions/source/ole/oleobjw.hxx14
-rw-r--r--extensions/source/ole/olethread.cxx7
-rw-r--r--extensions/source/ole/servprov.cxx11
-rw-r--r--extensions/source/ole/unoobjw.cxx11
-rw-r--r--extensions/source/ole/unotypewrapper.hxx18
-rw-r--r--extensions/source/ole/wincrap.hxx66
8 files changed, 78 insertions, 93 deletions
diff --git a/extensions/source/ole/jscriptclasses.hxx b/extensions/source/ole/jscriptclasses.hxx
index cc2a9fa88d5b..606c2385f711 100644
--- a/extensions/source/ole/jscriptclasses.hxx
+++ b/extensions/source/ole/jscriptclasses.hxx
@@ -16,25 +16,12 @@
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#ifndef __JSCRIPTCLASSES_HXX
-#define __JSCRIPTCLASSES_HXX
+#ifndef JSCRIPTCLASSES_HXX
+#define JSCRIPTCLASSES_HXX
-#pragma warning (push,1)
-#pragma warning (disable:4548)
+#include <wincrap.hxx>
-#include <tools/presys.h>
-#define STRICT
-#define _WIN32_WINNT 0x0403
-#define _WIN32_DCOM
-#if OSL_DEBUG_LEVEL > 0
-//#define _ATL_DEBUG_INTERFACES
-#endif
-#include <atlbase.h>
-extern CComModule _Module;
-#include <atlcom.h>
-
-#pragma warning (pop)
#pragma warning (disable:4505)
// disable "unreferenced local function has been removed" globally
@@ -148,8 +135,6 @@ private:
CComVariant m_varValue;
};
-#include <tools/postsys.h>
-
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/extensions/source/ole/ole2uno.hxx b/extensions/source/ole/ole2uno.hxx
index 5b281a57d9cb..659a9cbde3a3 100644
--- a/extensions/source/ole/ole2uno.hxx
+++ b/extensions/source/ole/ole2uno.hxx
@@ -25,29 +25,8 @@
#pragma once
#endif
-#define STRICT
-#ifndef _WIN32_WINNT
-#define _WIN32_WINNT 0x0400
-#endif
-
-#define _WIN32_DCOM
-#if OSL_DEBUG_LEVEL > 0
-//#define _ATL_DEBUG_INTERFACES
-#endif
-
-#pragma warning (push,1)
-#pragma warning (disable:4917)
-#pragma warning (disable:4005)
-#pragma warning (disable:4548)
-
-#include <tchar.h>
-#include <dispex.h>
-
-#include <tools/presys.h>
-#include <list>
-#include <tools/postsys.h>
+#include <wincrap.hxx>
-#pragma warning (pop)
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/lang/XSingleServiceFactory.hpp>
#include <com/sun/star/script/XInvocation.hpp>
diff --git a/extensions/source/ole/oleobjw.hxx b/extensions/source/ole/oleobjw.hxx
index f10a95acdf59..4fd17687e031 100644
--- a/extensions/source/ole/oleobjw.hxx
+++ b/extensions/source/ole/oleobjw.hxx
@@ -17,20 +17,14 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#ifndef __OLEOBJW_HXX
-#define __OLEOBJW_HXX
-#include "ole2uno.hxx"
+#ifndef OLEOBJW_HXX
+#define OLEOBJW_HXX
-#include <tools/presys.h>
-#define _WIN32_WINNT 0x0403
+#include "ole2uno.hxx"
+#include "wincrap.hxx"
-#ifdef _MSC_VER
-#undef _DEBUG // why?
-#endif
-#include <atlbase.h>
#include <vector>
#include <boost/unordered_map.hpp>
-#include <tools/postsys.h>
#include <cppuhelper/implbase3.hxx>
#include <cppuhelper/implbase4.hxx>
diff --git a/extensions/source/ole/olethread.cxx b/extensions/source/ole/olethread.cxx
index a7e5fc88ae9b..80d8c6e0393e 100644
--- a/extensions/source/ole/olethread.cxx
+++ b/extensions/source/ole/olethread.cxx
@@ -17,15 +17,8 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#ifdef _MSC_VER
-#define _WIN32_WINNT 0x0400
-#endif
-
#include "ole2uno.hxx"
-#include <tools/presys.h>
-#include <tools/postsys.h>
-
#include <osl/thread.hxx>
using namespace std;
diff --git a/extensions/source/ole/servprov.cxx b/extensions/source/ole/servprov.cxx
index 10fb507d478a..d85afa820091 100644
--- a/extensions/source/ole/servprov.cxx
+++ b/extensions/source/ole/servprov.cxx
@@ -35,17 +35,6 @@
#include "oleobjw.hxx"
#include <rtl/unload.h>
-#include <tools/presys.h>
-#define _WIN32_WINNT 0x0403
-
-#ifdef _MSC_VER
-#undef _DEBUG
-#endif
-#include <atlbase.h>
-extern CComModule _Module;
-#include <atlcom.h>
-#include <tools/postsys.h>
-
using namespace cppu;
using namespace osl;
diff --git a/extensions/source/ole/unoobjw.cxx b/extensions/source/ole/unoobjw.cxx
index 069da1ed98b7..a391d64a907d 100644
--- a/extensions/source/ole/unoobjw.cxx
+++ b/extensions/source/ole/unoobjw.cxx
@@ -17,19 +17,14 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-
-// http://stackoverflow.com/questions/5839292/error-c1189-after-installing-visual-studio-2010
-#define _WIN32_WINNT 0x403
-
-
#include "ole2uno.hxx"
+#if _WIN32_WINNT != 0x403
+#error wrong _WIN32_WINNT
+#endif
#include <stdio.h>
-#include <tools/presys.h>
-#include <olectl.h>
#include <vector>
#include <list>
#include <boost/unordered_map.hpp>
-#include <tools/postsys.h>
#include <osl/diagnose.h>
diff --git a/extensions/source/ole/unotypewrapper.hxx b/extensions/source/ole/unotypewrapper.hxx
index 338ca6eb3489..5965bdb9a33e 100644
--- a/extensions/source/ole/unotypewrapper.hxx
+++ b/extensions/source/ole/unotypewrapper.hxx
@@ -19,21 +19,8 @@
#ifndef UNO_TYPE_WRAPPER_HXX
#define UNO_TYPE_WRAPPER_HXX
-#pragma warning (push,1)
-#pragma warning (disable:4548)
+#include <wincrap.hxx>
-#include <tools/presys.h>
-#define STRICT
-#define _WIN32_WINNT 0x0403
-#define _WIN32_DCOM
-#if OSL_DEBUG_LEVEL > 1
-#define _ATL_DEBUG_INTERFACES
-#endif
-#include <atlbase.h>
-extern CComModule _Module;
-#include <atlcom.h>
-
-#pragma warning (pop)
#pragma warning (disable:4505)
// disable "unreferenced local function has been removed" globally
@@ -88,9 +75,6 @@ public:
CComBSTR m_sName;
};
-// This here so that WIN_ULONG is used also in the magic macros above
-#include <tools/postsys.h>
-
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/extensions/source/ole/wincrap.hxx b/extensions/source/ole/wincrap.hxx
new file mode 100644
index 000000000000..c77e52ee06b0
--- /dev/null
+++ b/extensions/source/ole/wincrap.hxx
@@ -0,0 +1,66 @@
+/* -*- 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 OLE_WIN_HXX
+#define OLE_WIN_HXX
+
+/* wrap all includes that need to be wrapped by presys.h/postsys.h here */
+
+// from oleobjw.hxx
+// http://stackoverflow.com/questions/5839292/error-c1189-after-installing-visual-studio-2010
+#define _WIN32_WINNT 0x0403
+
+#ifdef _MSC_VER
+#undef _DEBUG // why?
+#endif
+
+#define STRICT
+
+#define _WIN32_DCOM
+#if OSL_DEBUG_LEVEL > 0
+//#define _ATL_DEBUG_INTERFACES
+#endif
+
+#pragma warning (push,1)
+#pragma warning (disable:4917)
+#pragma warning (disable:4005)
+#pragma warning (disable:4548)
+
+#include <tchar.h>
+#include <dispex.h>
+
+#include <tools/presys.h>
+#include <list>
+
+// from oleobjw.hxx
+#include <atlbase.h>
+// from jscriptclasses.hxx
+extern CComModule _Module;
+#include <atlcom.h>
+
+// from unoobjw.cxx
+#include <olectl.h>
+
+#include <tools/postsys.h>
+
+#pragma warning (pop)
+
+#endif // OLE_WIN_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */