Kaydet (Commit) 832e6d22 authored tarafından Jan Holesovsky's avatar Jan Holesovsky

Some trivial fixes for MinGW with -std=c++0x enabled; not finished.

üst 6cdbf1cc
......@@ -37,7 +37,7 @@
int
#ifdef WNT
_cdecl
__cdecl
#endif
main( int argc,
char * argv[] )
......
......@@ -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;
......
......@@ -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]);
......
......@@ -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;
......
......@@ -37,6 +37,10 @@
#include <ieeefp.h>
#endif /* SOLARIS */
#if defined(__cplusplus) && ( defined(__GXX_EXPERIMENTAL_CXX0X__) || __cplusplus >= 201103L )
#include <cmath>
#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
......
......@@ -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<sal_Unicode, rtl::Allocator<sal_Unicode> > vec(Module->length + 1);
std::vector<sal_Unicode> vec(Module->length + 1);
DWORD len = GetShortPathNameW(reinterpret_cast<LPCWSTR>(Module->buffer),
reinterpret_cast<LPWSTR>(&vec[0]), Module->length + 1);
if (len )
......
......@@ -68,11 +68,11 @@ const rtl::OUString QUOTE(RTL_CONSTASCII_USTRINGPARAM("\""));
namespace /* private */
{
//#################################################
typedef std::list<rtl::OUString, rtl::Allocator<rtl::OUString> > string_container_t;
typedef std::list<rtl::OUString> 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<string_container_iterator_t, string_container_iterator_t> iterator_pair_t;
typedef std::vector<sal_Unicode, rtl::Allocator<sal_Unicode> > environment_container_t;
typedef std::vector<sal_Unicode> 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<sal_Unicode, rtl::Allocator<sal_Unicode> > vec(path.getLength() + 1);
std::vector<sal_Unicode> vec(path.getLength() + 1);
//GetShortPathNameW only works if the file can be found!
const DWORD len = GetShortPathNameW(
reinterpret_cast<LPCWSTR>(path.getStr()), reinterpret_cast<LPWSTR>(&vec[0]), path.getLength() + 1);
......@@ -321,7 +321,7 @@ namespace /* private */
&& extension.getLength())
{
const rtl::OUString extPath(path + extension);
std::vector<sal_Unicode, rtl::Allocator<sal_Unicode> > vec2(
std::vector<sal_Unicode> vec2(
extPath.getLength() + 1);
const DWORD len2 = GetShortPathNameW(
reinterpret_cast<LPCWSTR>(extPath.getStr()), reinterpret_cast<LPWSTR>(&vec2[0]), extPath.getLength() + 1);
......
......@@ -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 \
......
......@@ -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:=
......
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