From 832e6d22935040fe61504c90838415fa55feb24d Mon Sep 17 00:00:00 2001 From: Jan Holesovsky Date: Wed, 23 Nov 2011 11:27:05 +0100 Subject: Some trivial fixes for MinGW with -std=c++0x enabled; not finished. --- autodoc/source/exes/adc_uni/main.cxx | 2 +- rdbmaker/source/rdbmaker/rdbmaker.cxx | 2 +- registry/tools/regmerge.cxx | 2 +- registry/tools/regview.cxx | 2 +- sal/inc/sal/mathconf.h | 8 +++++++- sal/osl/w32/module.cxx | 2 +- sal/osl/w32/procimpl.cxx | 8 ++++---- solenv/gbuild/platform/WNT_INTEL_GCC.mk | 5 +++++ solenv/inc/wntgcci.mk | 5 +++++ 9 files changed, 26 insertions(+), 10 deletions(-) diff --git a/autodoc/source/exes/adc_uni/main.cxx b/autodoc/source/exes/adc_uni/main.cxx index 6e5a11a6e0b6..c119bb69d3cf 100644 --- a/autodoc/source/exes/adc_uni/main.cxx +++ b/autodoc/source/exes/adc_uni/main.cxx @@ -37,7 +37,7 @@ int #ifdef WNT - _cdecl + __cdecl #endif main( int argc, char * argv[] ) diff --git a/rdbmaker/source/rdbmaker/rdbmaker.cxx b/rdbmaker/source/rdbmaker/rdbmaker.cxx index b20043ea6f2a..fba84693b164 100644 --- a/rdbmaker/source/rdbmaker/rdbmaker.cxx +++ b/rdbmaker/source/rdbmaker/rdbmaker.cxx @@ -300,7 +300,7 @@ sal_Bool produceAllTypes(const OString& typeName, #if (defined UNX) int main( int argc, char * argv[] ) #else -int _cdecl main( int argc, char * argv[] ) +int __cdecl main( int argc, char * argv[] ) #endif { RdbOptions options; diff --git a/registry/tools/regmerge.cxx b/registry/tools/regmerge.cxx index 193209be2733..7b5997d782ad 100644 --- a/registry/tools/regmerge.cxx +++ b/registry/tools/regmerge.cxx @@ -95,7 +95,7 @@ bool Options_Impl::initOptions_Impl (std::vector< std::string > & rArgs) #if (defined UNX) int main( int argc, char * argv[] ) #else -int _cdecl main( int argc, char * argv[] ) +int __cdecl main( int argc, char * argv[] ) #endif { Options_Impl options(argv[0]); diff --git a/registry/tools/regview.cxx b/registry/tools/regview.cxx index 2cb11b815c86..57ebcea1270b 100644 --- a/registry/tools/regview.cxx +++ b/registry/tools/regview.cxx @@ -43,7 +43,7 @@ using namespace registry::tools; #if (defined UNX) int main( int argc, char * argv[] ) #else -int _cdecl main( int argc, char * argv[] ) +int __cdecl main( int argc, char * argv[] ) #endif { RegHandle hReg; diff --git a/sal/inc/sal/mathconf.h b/sal/inc/sal/mathconf.h index d673f34ed473..1e4b11b112b4 100644 --- a/sal/inc/sal/mathconf.h +++ b/sal/inc/sal/mathconf.h @@ -37,6 +37,10 @@ #include #endif /* SOLARIS */ +#if defined(__cplusplus) && ( defined(__GXX_EXPERIMENTAL_CXX0X__) || __cplusplus >= 201103L ) +#include +#endif + #if defined __cplusplus extern "C" { #endif /* __cplusplus */ @@ -59,7 +63,9 @@ extern "C" { /* SAL_MATH_FINITE(d): test double d on INFINITY, NaN et al. */ -#if defined( WNT) +#if defined(__cplusplus) && ( defined(__GXX_EXPERIMENTAL_CXX0X__) || __cplusplus >= 201103L ) +#define SAL_MATH_FINITE(d) std::isfinite(d) +#elif defined( WNT) #define SAL_MATH_FINITE(d) _finite(d) #elif defined IOS /* C++ is so nice. This is the only way I could come up with making diff --git a/sal/osl/w32/module.cxx b/sal/osl/w32/module.cxx index 07f750e49724..026cf514b50f 100644 --- a/sal/osl/w32/module.cxx +++ b/sal/osl/w32/module.cxx @@ -79,7 +79,7 @@ oslModule SAL_CALL osl_loadModule(rtl_uString *strModuleName, sal_Int32 /*nRtldM //on Windows XP and ERROR_INSUFFICIENT_BUFFER on Windows 7 (64bit) if (hInstance == NULL && Module->length > 260) { - std::vector > vec(Module->length + 1); + std::vector vec(Module->length + 1); DWORD len = GetShortPathNameW(reinterpret_cast(Module->buffer), reinterpret_cast(&vec[0]), Module->length + 1); if (len ) diff --git a/sal/osl/w32/procimpl.cxx b/sal/osl/w32/procimpl.cxx index 7ef6fb62ad8c..676c0e8b58cd 100644 --- a/sal/osl/w32/procimpl.cxx +++ b/sal/osl/w32/procimpl.cxx @@ -68,11 +68,11 @@ const rtl::OUString QUOTE(RTL_CONSTASCII_USTRINGPARAM("\"")); namespace /* private */ { //################################################# - typedef std::list > string_container_t; + typedef std::list string_container_t; typedef string_container_t::iterator string_container_iterator_t; typedef string_container_t::const_iterator string_container_const_iterator_t; typedef std::pair iterator_pair_t; - typedef std::vector > environment_container_t; + typedef std::vector environment_container_t; //################################################# /* Function object that compares two strings that are @@ -312,7 +312,7 @@ namespace /* private */ rtl::OUString ret(path); if (path.getLength() > 260) { - std::vector > vec(path.getLength() + 1); + std::vector vec(path.getLength() + 1); //GetShortPathNameW only works if the file can be found! const DWORD len = GetShortPathNameW( reinterpret_cast(path.getStr()), reinterpret_cast(&vec[0]), path.getLength() + 1); @@ -321,7 +321,7 @@ namespace /* private */ && extension.getLength()) { const rtl::OUString extPath(path + extension); - std::vector > vec2( + std::vector vec2( extPath.getLength() + 1); const DWORD len2 = GetShortPathNameW( reinterpret_cast(extPath.getStr()), reinterpret_cast(&vec2[0]), extPath.getLength() + 1); diff --git a/solenv/gbuild/platform/WNT_INTEL_GCC.mk b/solenv/gbuild/platform/WNT_INTEL_GCC.mk index b0b2bdbefcd9..6c50a9cbe18a 100644 --- a/solenv/gbuild/platform/WNT_INTEL_GCC.mk +++ b/solenv/gbuild/platform/WNT_INTEL_GCC.mk @@ -80,6 +80,11 @@ gb_CXXFLAGS += --sysroot=$(SYSBASE) gb_CFLAGS += --sysroot=$(SYSBASE) endif +ifeq ($(HAVE_CXX0X),TRUE) +# We can turn on additional useful checks with c++0x +# FIXME still does not compile fully gb_CXXFLAGS += -std=c++0x +endif + gb_LinkTarget_EXCEPTIONFLAGS += \ -fno-enforce-eh-specs \ diff --git a/solenv/inc/wntgcci.mk b/solenv/inc/wntgcci.mk index 3831c85395c7..d36bee6adb7c 100644 --- a/solenv/inc/wntgcci.mk +++ b/solenv/inc/wntgcci.mk @@ -46,6 +46,11 @@ CFLAGS+=-fmessage-length=0 -c CFLAGSCC=-pipe $(ARCH_FLAGS) CFLAGSCXX=-pipe $(ARCH_FLAGS) + +.IF "$(HAVE_CXX0X)" == "TRUE" +# FIXME still does not compile fully CFLAGSCXX+=-std=c++0x +.ENDIF + CFLAGSEXCEPTIONS=-fexceptions -fno-enforce-eh-specs CFLAGS_NO_EXCEPTIONS=-fno-exceptions PICSWITCH:= -- cgit v1.2.3