Kaydet (Commit) 032d5ba4 authored tarafından Michael Stahl's avatar Michael Stahl

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
üst f011e84a
......@@ -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: */
......@@ -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>
......
......@@ -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>
......
......@@ -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;
......
......@@ -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;
......
......@@ -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>
......
......@@ -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: */
/* -*- 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: */
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