Kaydet (Commit) a3ce60eb authored tarafından Tor Lillqvist's avatar Tor Lillqvist

We only support MSVC 2008 (_MSC_VER 1500) or later

We can drop or simplify many conditionals.

Change-Id: I37e820e515cc09845c30b62c89ddb3b6ff370f97
üst abfe16ce
......@@ -26,11 +26,7 @@
#include <objbase.h>
#include <strmif.h>
#include <Amvideo.h>
#if defined(_MSC_VER) && (_MSC_VER < 1500)
#include <Qedit.h>
#else
#include "interface.hxx"
#endif
#include <uuids.h>
#if defined _MSC_VER
#pragma warning(pop)
......
......@@ -503,13 +503,9 @@ int msci_filterCppException(
if (pRecord == 0 || pRecord->ExceptionCode != MSVC_ExceptionCode)
return EXCEPTION_CONTINUE_SEARCH;
#if _MSC_VER < 1300 // MSVC -6
bool rethrow = (pRecord->NumberParameters < 3 ||
pRecord->ExceptionInformation[ 2 ] == 0);
#else
bool rethrow = __CxxDetectRethrow( &pRecord );
OSL_ASSERT( pRecord == pPointers->ExceptionRecord );
#endif
if (rethrow && pRecord == pPointers->ExceptionRecord)
{
// hack to get msvcrt internal _curexception field:
......@@ -521,15 +517,7 @@ int msci_filterCppException(
// crt\src\mtdll.h:
// offsetof (_tiddata, _curexception) -
// offsetof (_tiddata, _tpxcptinfoptrs):
#if _MSC_VER < 1300
0x18 // msvcrt,dll
#elif _MSC_VER < 1310
0x20 // msvcr70.dll
#elif _MSC_VER < 1400
0x24 // msvcr71.dll
#else
0x28 // msvcr80.dll
#endif
0x28 // msvcr80.dll (and later?)
);
}
// rethrow: handle only C++ exceptions:
......@@ -576,12 +564,11 @@ int msci_filterCppException(
uno_type_any_constructAndConvert(
pUnoExc, &exc,
::getCppuType( &exc ).getTypeLibType(), pCpp2Uno );
#if _MSC_VER < 1400 // msvcr80.dll cleans up, different from former msvcrs
// msvcr80.dll cleans up, different from former msvcrs
// if (! rethrow):
// though this unknown exception leaks now, no user-defined
// exception is ever thrown thru the binary C-UNO dispatcher
// call stack.
#endif
}
else
{
......@@ -589,14 +576,6 @@ int msci_filterCppException(
uno_any_constructAndConvert(
pUnoExc, (void *) pRecord->ExceptionInformation[1],
pExcTypeDescr, pCpp2Uno );
#if _MSC_VER < 1400 // msvcr80.dll cleans up, different from former msvcrs
if (! rethrow)
{
uno_destructData(
(void *) pRecord->ExceptionInformation[1],
pExcTypeDescr, cpp_release );
}
#endif
typelib_typedescription_release( pExcTypeDescr );
}
......
......@@ -726,9 +726,7 @@ int mscx_filterCppException(
// MSVS9/crt/src/mtdll.h:
// offsetof (_tiddata, _curexception) -
// offsetof (_tiddata, _tpxcptinfoptrs):
#if _MSC_VER < 1500
error, this compiler version is not supported
#elif _MSC_VER < 1600
#if _MSC_VER < 1600
0x48 // msvcr90.dll
#else
error, please find value for this compiler version
......@@ -792,12 +790,6 @@ int mscx_filterCppException(
uno_type_any_constructAndConvert(
pUnoExc, &exc,
::getCppuType( &exc ).getTypeLibType(), pCpp2Uno );
#if _MSC_VER < 1400 // msvcr80.dll cleans up, different from former msvcrs
// if (! rethrow):
// though this unknown exception leaks now, no user-defined
// exception is ever thrown thru the binary C-UNO dispatcher
// call stack.
#endif
}
else
{
......@@ -805,14 +797,6 @@ int mscx_filterCppException(
uno_any_constructAndConvert(
pUnoExc, (void *) pRecord->ExceptionInformation[1],
pExcTD, pCpp2Uno );
#if _MSC_VER < 1400 // msvcr80.dll cleans up, different from former msvcrs
if (! rethrow)
{
uno_destructData(
(void *) pRecord->ExceptionInformation[1],
pExcTD, cpp_release );
}
#endif
typelib_typedescription_release( pExcTD );
}
......
......@@ -31,9 +31,6 @@
#include "cli_bridge.h"
#include "cli_proxy.h"
#if defined(_MSC_VER) && (_MSC_VER < 1400)
#include <_vcclrit.h>
#endif
namespace sri= System::Runtime::InteropServices;
using ::rtl::OUString;
......@@ -268,9 +265,10 @@ SAL_DLLPUBLIC_EXPORT void SAL_CALL uno_initEnvironment( uno_Environment * uno_cl
SAL_THROW_EXTERN_C()
{
//ToDo: remove when compiled with .NET 2
#if defined(_MSC_VER) && (_MSC_VER < 1400)
__crt_dll_initialize();
#endif
// Unclear whether the above comment refers to this whole function
// or a call to __crt_dll_initialize() that used to be here for
// _MSC_VER < 1400
uno_cli_env->environmentDisposing= cli_env_disposing;
uno_cli_env->pExtEnv = 0;
......
......@@ -54,11 +54,6 @@ struct LessString
}
};
#if defined(_MSC_VER) && _MSC_VER < 1200
typedef ::std::new_alloc NewAlloc;
#endif
typedef ::std::list< ::rtl::OString > StringList;
typedef ::std::vector< ::rtl::OString > StringVector;
typedef ::std::set< ::rtl::OString, LessString > StringSet;
......
......@@ -210,22 +210,11 @@ inline bool operator!= (const Allocator<T>&, const Allocator<U>&) SAL_THROW(())
/* REQUIRED BY STLPort (see stlport '_alloc.h'):
Hack for compilers that do not support member
template classes (e.g. MSVC 6) */
#if defined (_MSC_VER)
#if (_MSC_VER < 1400) // MSVC 6
namespace _STL
{
#endif
#endif
template<class T, class U>
inline pq_sdbc_driver::Allocator<U> & __stl_alloc_rebind (
pq_sdbc_driver::Allocator<T> & a, U const *)
{
return (pq_sdbc_driver::Allocator<U>&)(a);
}
#if defined (_MSC_VER)
#if (_MSC_VER < 1400) // MSVC 6
}
#endif
#endif
#endif /* _PQ_ALLOCATOR_ */
......@@ -107,11 +107,7 @@ getTypeFromTypeClass(::typelib_TypeClass tc) {
}
// For _MSC_VER 1310, define cppu_detail_getUnoType in the global namespace, to
// avoid spurious compiler errors in code that calls cppu_detail_getUnoType:
#if !defined _MSC_VER || _MSC_VER > 1310
namespace cppu { namespace detail {
#endif
inline ::com::sun::star::uno::Type const &
cppu_detail_getUnoType(SAL_UNUSED_PARAMETER ::cppu::UnoVoidType const *) {
......@@ -240,9 +236,7 @@ cppu_detail_getUnoType(
return ::cppu::UnoType< T >::get();
}
#if !defined _MSC_VER || _MSC_VER > 1310
} }
#endif
namespace cppu {
......
......@@ -18,15 +18,11 @@
// Header
#include "resource.h"
#if defined(_MSC_VER) && (_MSC_VER < 1500)
#include "winres.h"
#else
#define WINVER 0x0500
#include <winresrc.h>
#define LB_ADDSTRING (WM_USER+1)
#define CB_ADDSTRING (WM_USER+3)
#define IDC_STATIC (-1)
#endif
#include "version.hrc"
......
......@@ -138,13 +138,13 @@ namespace dbaui
protected:
virtual FmGridControl* imp_CreateControl(Window* pParent, WinBits nStyle);
#if defined(_MSC_VER) && (_MSC_VER >= 1310 )
#ifdef _MSC_VER
typedef ::com::sun::star::frame::XStatusListener xstlist_type;
typedef ::com::sun::star::uno::Reference< xstlist_type > xlistener_type;
void NotifyStatusChanged(const ::com::sun::star::util::URL& aUrl, const xlistener_type & xControl = xlistener_type() );
#else
void NotifyStatusChanged(const ::com::sun::star::util::URL& aUrl, const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XStatusListener > & xControl = ::com::sun::star::uno::Reference< ::com::sun::star::frame::XStatusListener > ());
#endif // # _MSC_VER>=1310
#endif // # _MSC_VER
private:
// for asny execution of XDispatch::dispatch
......
......@@ -86,10 +86,6 @@
#include <boost/shared_ptr.hpp>
#include <boost/scoped_ptr.hpp>
#if (defined(_MSC_VER) && (_MSC_VER < 1400))
#define _WIN32_WINNT 0x0400
#endif
#ifdef WNT
#define GradientStyle_RECT BLA_GradientStyle_RECT
#include <windows.h>
......
......@@ -24,9 +24,9 @@
#if !defined(AFX_STDAFX_H__A9DB83DB_A9FD_11D0_BFD1_444553540000__INCLUDED_)
#define AFX_STDAFX_H__A9DB83DB_A9FD_11D0_BFD1_444553540000__INCLUDED_
#if _MSC_VER > 1000
#ifdef _MSC_VER
#pragma once
#endif // _MSC_VER > 1000
#endif
#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
......
......@@ -30,11 +30,6 @@
#include "FmtFilter.hxx"
#include "Fetc.hxx"
#if(_MSC_VER < 1300) && !defined(__MINGW32__)
#include <olestd.h>
#endif
#define STR2(x) #x
#define STR(x) STR2(x)
#define PRAGMA_MSG( msg ) message( __FILE__ "(" STR(__LINE__) "): " #msg )
......
......@@ -33,9 +33,6 @@
#pragma warning(disable:4917)
#endif
#include <windows.h>
#if (_MSC_VER < 1300) && !defined(__MINGW32__)
#include <olestd.h>
#endif
#include <shlobj.h>
#if defined _MSC_VER
#pragma warning(pop)
......
......@@ -1557,7 +1557,7 @@ uno::Reference< uno::XInterface > SvxUnoTextRange_NewInstance()
{
SvxUnoText aText;
uno::Reference< text::XTextRange > xRange( new SvxUnoTextRange( aText ) );
#if (_MSC_VER < 1300)
#ifndef _MSC_VER
return xRange;
#else
return (uno::Reference< uno::XInterface >)xRange;
......
......@@ -16,7 +16,7 @@
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#if defined(_MSC_VER) && (_MSC_VER > 1310)
#ifdef _MSC_VER
#pragma warning(disable : 4917 4555)
#endif
......@@ -1507,7 +1507,7 @@ void SAL_CALL DocumentHolder::modified( const lang::EventObject& /*aEvent*/ )
// Fix strange warnings about some
// ATL::CAxHostWindow::QueryInterface|AddRef|Releae functions.
// warning C4505: 'xxx' : unreferenced local function has been removed
#if defined(_MSC_VER)
#ifdef _MSC_VER
#pragma warning(disable: 4505)
#endif
......
......@@ -16,7 +16,7 @@
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#if defined(_MSC_VER) && (_MSC_VER > 1310)
#ifdef _MSC_VER
#pragma warning(disable : 4917 4555)
#endif
......
......@@ -16,7 +16,7 @@
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#if defined(_MSC_VER) && (_MSC_VER > 1310)
#ifdef _MSC_VER
#pragma warning(disable : 4917 4555)
#endif
......
......@@ -20,7 +20,7 @@
#define STRICT
#define _WIN32_WINNT 0x0403
#define _WIN32_DCOM
#if defined(_MSC_VER) && (_MSC_VER > 1310)
#ifdef _MSC_VER
#pragma warning(disable : 4917 4555)
#endif
......
......@@ -16,7 +16,7 @@
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#if defined(_MSC_VER) && (_MSC_VER > 1310)
#ifdef _MSC_VER
#pragma warning(disable : 4917 4555)
#endif
......
......@@ -16,7 +16,7 @@
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#if defined(_MSC_VER) && (_MSC_VER > 1310)
#ifdef _MSC_VER
#pragma warning(disable : 4917 4555)
#endif
......
......@@ -16,7 +16,7 @@
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#if defined(_MSC_VER) && (_MSC_VER > 1310)
#ifdef _MSC_VER
#pragma warning(disable : 4917 4555)
#endif
......
......@@ -16,7 +16,7 @@
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#if defined(_MSC_VER) && (_MSC_VER > 1310)
#ifdef _MSC_VER
#pragma warning(disable : 4917 4555)
#endif
......
......@@ -16,7 +16,7 @@
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#if defined(_MSC_VER) && (_MSC_VER > 1310)
#ifdef _MSC_VER
#pragma warning(disable : 4917 4555)
#endif
......
......@@ -19,7 +19,7 @@
#ifndef _EMBEDDOC_HXX_
#define _EMBEDDOC_HXX_
#if defined(_MSC_VER) && (_MSC_VER > 1310)
#ifdef _MSC_VER
#pragma warning(disable : 4917 4555)
#endif
......
......@@ -29,7 +29,7 @@
#include <oleidl.h>
#ifndef __MINGW32__
#if defined(_MSC_VER) && (_MSC_VER > 1310)
#ifdef _MSC_VER
#pragma warning(disable : 4265)
#include <atldbcli.h>
#else
......
......@@ -19,7 +19,7 @@
#ifndef _IIPAOBJ_HXX_
#define _IIPAOBJ_HXX_
#if defined(_MSC_VER) && (_MSC_VER > 1310)
#ifdef _MSC_VER
#pragma warning(disable : 4917 4555)
#endif
......
......@@ -2,9 +2,9 @@
#if !defined(AFX_STDAFX_H_)
#define AFX_STDAFX_H_
#if _MSC_VER > 1000
#ifdef _MSC_VER
#pragma once
#endif // _MSC_VER > 1000
#endif
#define STRICT
#ifndef _WIN32_WINNT
......
......@@ -37,7 +37,7 @@ STDMETHODIMP SOActionsApproval::InterfaceSupportsErrorInfo(REFIID riid)
for (int i=0;i<SAL_N_ELEMENTS(arr);i++)
{
#if defined(_MSC_VER) && (_MSC_VER >= 1300)
#ifdef _MSC_VER
if (InlineIsEqualGUID(*arr[i],riid))
#else
if (::ATL::InlineIsEqualGUID(*arr[i],riid))
......
......@@ -22,16 +22,16 @@
#ifndef __SODOCUMENTEVENTLISTENER_H_
#define __SODOCUMENTEVENTLISTENER_H_
#if _MSC_VER > 1000
#ifdef _MSC_VER
#pragma once
#endif // _MSC_VER > 1000
#endif
#include "resource.h" // main symbols
#include <ExDispID.h>
#include <ExDisp.h>
#include <shlguid.h>
#if defined(_MSC_VER) && (_MSC_VER >= 1300)
#ifdef _MSC_VER
#undef _DEBUG
#endif
......
......@@ -34,7 +34,7 @@
#include <ExDisp.h>
#include <shlguid.h>
#if defined(_MSC_VER) && (_MSC_VER >= 1300)
#ifdef _MSC_VER
#undef _DEBUG
#endif
#include <atlctl.h>
......
......@@ -36,7 +36,7 @@ STDMETHODIMP SOComWindowPeer::InterfaceSupportsErrorInfo(REFIID riid)
for (int i=0;i<SAL_N_ELEMENTS(arr);i++)
{
#if defined(_MSC_VER) && (_MSC_VER >= 1300)
#ifdef _MSC_VER
if (InlineIsEqualGUID(*arr[i],riid))
#else
if (::ATL::InlineIsEqualGUID(*arr[i],riid))
......
......@@ -22,16 +22,16 @@
#ifndef __SOCOMWINDOWPEER_H_
#define __SOCOMWINDOWPEER_H_
#if _MSC_VER > 1000
#ifdef _MSC_VER
#pragma once
#endif // _MSC_VER > 1000
#endif
#include "resource.h" // main symbols
#include <ExDispID.h>
#include <ExDisp.h>
#include <shlguid.h>
#if defined(_MSC_VER) && (_MSC_VER >= 1300)
#ifdef _MSC_VER
#undef _DEBUG
#endif
#include <atlctl.h>
......
......@@ -39,7 +39,7 @@ STDMETHODIMP SODispatchInterceptor::InterfaceSupportsErrorInfo(REFIID riid)
for (int i=0;i<SAL_N_ELEMENTS(arr);i++)
{
#if defined(_MSC_VER) && (_MSC_VER >= 1300)
#ifdef _MSC_VER
if (InlineIsEqualGUID(*arr[i],riid))
#else
if (::ATL::InlineIsEqualGUID(*arr[i],riid))
......
......@@ -22,16 +22,16 @@
#ifndef __SODISPATCHINTERCEPTOR_H_
#define __SODISPATCHINTERCEPTOR_H_
#if _MSC_VER > 1000
#ifdef _MSC_VER
#pragma once
#endif // _MSC_VER > 1000
#endif
#include "resource.h" // main symbols
#include <ExDispID.h>
#include <ExDisp.h>
#include <shlguid.h>
#if defined(_MSC_VER) && (_MSC_VER >= 1300)
#ifdef _MSC_VER
#undef _DEBUG
#endif
#include <atlctl.h>
......
......@@ -30,7 +30,7 @@
#include <statreg.h>
#endif
#if defined(_MSC_VER) && (_MSC_VER >= 1300)
#ifdef _MSC_VER
#undef _DEBUG
#endif
......
......@@ -24,9 +24,9 @@
#if !defined(AFX_STDAFX_H__C1799EA0_62CC_44DE_A2DD_C9F0410FF7F1__INCLUDED_)
#define AFX_STDAFX_H__C1799EA0_62CC_44DE_A2DD_C9F0410FF7F1__INCLUDED_
#if _MSC_VER > 1000
#ifdef _MSC_VER
#pragma once
#endif // _MSC_VER > 1000
#endif
#define STRICT
#ifndef _WIN32_WINNT
......
......@@ -25,15 +25,11 @@
//
// Generated from the TEXTINCLUDE 2 resource.
//
#if defined(_MSC_VER) && (_MSC_VER < 1500)
#include "winres.h"
#else
#define WINVER 0x0500
#include <winresrc.h>
#define LB_ADDSTRING (WM_USER+1)
#define CB_ADDSTRING (WM_USER+3)
#define IDC_STATIC (-1)
#endif
/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS
......
......@@ -21,9 +21,9 @@
#define _OLE2UNO_HXX
#if _MSC_VER > 1000
#ifdef _MSC_VER
#pragma once
#endif // _MSC_VER > 1000
#endif
#define STRICT
#ifndef _WIN32_WINNT
......@@ -41,9 +41,7 @@
#pragma warning (disable:4548)
#include <tchar.h>
#if (_MSC_VER >= 1200) || defined(__MINGW32__)
#include <dispex.h>
#endif
#include <tools/presys.h>
#include <list>
......
......@@ -25,7 +25,7 @@
#pragma warning (push,1)
#pragma warning (disable:4548)
#if defined(_MSC_VER) && (_MSC_VER >= 1300) && !defined(_DEBUG_RUNTIME)
#if defined(_MSC_VER) && !defined(_DEBUG_RUNTIME)
#undef _DEBUG
#endif
#ifdef __MINGW32__
......
......@@ -24,7 +24,7 @@
#include <tools/presys.h>
#define _WIN32_WINNT 0x0403
#if defined(_MSC_VER) && (_MSC_VER >= 1300)
#ifdef _MSC_VER
#undef _DEBUG // why?
#endif
#include <atlbase.h>
......
......@@ -17,7 +17,7 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#if defined _MSC_VER && ( _MSC_VER >= 1200 )
#ifdef _MSC_VER
#define _WIN32_WINNT 0x0400
#endif
......
......@@ -38,7 +38,7 @@
#include <tools/presys.h>
#define _WIN32_WINNT 0x0403
#if defined(_MSC_VER) && (_MSC_VER >= 1300)
#ifdef _MSC_VER
#undef _DEBUG
#endif
#include <atlbase.h>
......
......@@ -72,7 +72,7 @@ using namespace com::sun::star::reflection;
using ::rtl::OUString;
#if _MSC_VER < 1200
#ifndef _MSC_VER
extern "C" const GUID IID_IDispatchEx;
#endif
......
......@@ -23,9 +23,9 @@
#if !defined(AFX_STDAFX_H__BFE10EB4_8584_11D4_8335_005004526AB4__INCLUDED_)
#define AFX_STDAFX_H__BFE10EB4_8584_11D4_8335_005004526AB4__INCLUDED_
#if _MSC_VER > 1000
#ifdef _MSC_VER
#pragma once
#endif // _MSC_VER > 1000
#endif
#define STRICT
#ifndef _WIN32_WINNT
......
......@@ -23,9 +23,9 @@
#if !defined(AFX_STDAFX_H__E275407A_804A_477E_9A28_F5CA84E711C3__INCLUDED_)
#define AFX_STDAFX_H__E275407A_804A_477E_9A28_F5CA84E711C3__INCLUDED_
#if _MSC_VER > 1000
#ifdef _MSC_VER
#pragma once
#endif // _MSC_VER > 1000
#endif
#define STRICT
#ifndef _WIN32_WINNT
......
......@@ -19,9 +19,9 @@
#if !defined(AFX_MFCCONTROL_H__AC221FBC_A0D8_11D4_833B_005004526AB4__INCLUDED_)
#define AFX_MFCCONTROL_H__AC221FBC_A0D8_11D4_833B_005004526AB4__INCLUDED_
#if _MSC_VER > 1000
#ifdef _MSC_VER
#pragma once
#endif // _MSC_VER > 1000
#endif
// MfcControl.h : main header file for MFCCONTROL.DLL
......
......@@ -19,9 +19,9 @@
#if !defined(AFX_MFCCONTROLCTL_H__AC221FC3_A0D8_11D4_833B_005004526AB4__INCLUDED_)
#define AFX_MFCCONTROLCTL_H__AC221FC3_A0D8_11D4_833B_005004526AB4__INCLUDED_
#if _MSC_VER > 1000
#ifdef _MSC_VER
#pragma once
#endif // _MSC_VER > 1000
#endif
// MfcControlCtl.h : Declaration of the CMfcControlCtrl ActiveX Control class.
......
......@@ -19,9 +19,9 @@
#if !defined(AFX_MFCCONTROLPPG_H__AC221FC5_A0D8_11D4_833B_005004526AB4__INCLUDED_)
#define AFX_MFCCONTROLPPG_H__AC221FC5_A0D8_11D4_833B_005004526AB4__INCLUDED_
#if _MSC_VER > 1000
#ifdef _MSC_VER
#pragma once
#endif // _MSC_VER > 1000
#endif
// MfcControlPpg.h : Declaration of the CMfcControlPropPage property page class.
......
......@@ -19,9 +19,9 @@
#if !defined(AFX_STDAFX_H__AC221FBA_A0D8_11D4_833B_005004526AB4__INCLUDED_)
#define AFX_STDAFX_H__AC221FBA_A0D8_11D4_833B_005004526AB4__INCLUDED_
#if _MSC_VER > 1000
#ifdef _MSC_VER
#pragma once
#endif // _MSC_VER > 1000