[Libreoffice-commits] .: 4 commits - sal/osl sal/prj sal/rtl sal/systools sal/typesconfig
Tor Lillqvist
tml at kemper.freedesktop.org
Sat May 21 15:15:52 PDT 2011
sal/osl/w32/MAKEFILE.MK | 114 ------------------------
sal/osl/w32/makefile.mk | 114 ++++++++++++++++++++++++
sal/osl/w32/module.cxx | 12 +-
sal/osl/w32/procimpl.cxx | 4
sal/osl/w32/signal.cxx | 2
sal/prj/build.lst | 2
sal/rtl/source/makefile.mk | 10 ++
sal/systools/win32/onlineupdate/onlinecheck.cxx | 17 ---
sal/systools/win32/uwinapi/macros.h | 2
sal/systools/win32/uwinapi/makefile.mk | 4
sal/systools/win32/uwinapi/sntprintf.c | 4
sal/typesconfig/makefile.mk | 6 +
12 files changed, 152 insertions(+), 139 deletions(-)
New commits:
commit d4de9877eb2ed821857a9ffae91eac7163b2f32a
Author: Tor Lillqvist <tlillqvist at novell.com>
Date: Sun May 22 01:15:35 2011 +0300
MinGW cross-compilation fixes
diff --git a/sal/systools/win32/onlineupdate/onlinecheck.cxx b/sal/systools/win32/onlineupdate/onlinecheck.cxx
index 67289ba..dd09b7d 100644
--- a/sal/systools/win32/onlineupdate/onlinecheck.cxx
+++ b/sal/systools/win32/onlineupdate/onlinecheck.cxx
@@ -43,9 +43,6 @@
#define _UNICODE
#endif
#include <tchar.h>
-#ifdef __MINGW32__
-#include <excpt.h>
-#endif
// #i71984
extern "C" sal_Bool SAL_CALL hasInternetConnection()
@@ -53,13 +50,7 @@ extern "C" sal_Bool SAL_CALL hasInternetConnection()
DWORD dwFlags;
TCHAR szConnectionName[1024];
-#ifdef __MINGW32__
- jmp_buf jmpbuf;
- __SEHandler han;
- if (__builtin_setjmp(jmpbuf) == 0)
- {
- han.Set(jmpbuf, NULL, (__SEHandler::PF)EXCEPTION_EXECUTE_HANDLER);
-#else
+#ifndef __MINGW32__
__try {
#endif
BOOL fIsConnected = InternetGetConnectedStateEx(
@@ -70,11 +61,7 @@ extern "C" sal_Bool SAL_CALL hasInternetConnection()
return fIsConnected ? sal_True : sal_False;
-#ifdef __MINGW32__
- }
- else return sal_False;
- han.Reset();
-#else
+#ifndef __MINGW32__
} __except( EXCEPTION_EXECUTE_HANDLER ) {
return sal_False;
}
diff --git a/sal/systools/win32/uwinapi/macros.h b/sal/systools/win32/uwinapi/macros.h
index 2d253c4..c550c24 100644
--- a/sal/systools/win32/uwinapi/macros.h
+++ b/sal/systools/win32/uwinapi/macros.h
@@ -41,7 +41,7 @@
# ifdef UNICODE
# define _UNICODE
# endif
-# include <TCHAR.H>
+# include <tchar.h>
#endif
// Globally disable "warning C4100: unreferenced formal parameter" caused by
diff --git a/sal/systools/win32/uwinapi/makefile.mk b/sal/systools/win32/uwinapi/makefile.mk
index 1d7e758..9a09411 100644
--- a/sal/systools/win32/uwinapi/makefile.mk
+++ b/sal/systools/win32/uwinapi/makefile.mk
@@ -49,7 +49,7 @@ CFLAGSCXX+=-Wno-unused-parameter -Wno-return-type
SLOFILES=
-.IF "$(CPU)"=="I"
+.IF "$(CPU)"=="I" && "$(CROSS_COMPILING)"==""
SLOFILES+=\
$(SLO)$/CheckTokenMembership.obj\
@@ -149,7 +149,7 @@ SHL1STDLIBS+=\
ALL: ALLTAR $(LB)$/libuwinapi.a
$(LB)$/libuwinapi.a: $(MISC)$/uwinapi.def
- dlltool --dllname uwinapi.dll --input-def=$(MISC)$/uwinapi.def --kill-at --output-lib=$(LB)$/libuwinapi.a
+ $(DLLTOOL) --dllname uwinapi.dll --input-def=$(MISC)$/uwinapi.def --kill-at --output-lib=$(LB)$/libuwinapi.a
.ENDIF
.INCLUDE : target.mk
diff --git a/sal/systools/win32/uwinapi/sntprintf.c b/sal/systools/win32/uwinapi/sntprintf.c
index 534f763..b5316f0 100644
--- a/sal/systools/win32/uwinapi/sntprintf.c
+++ b/sal/systools/win32/uwinapi/sntprintf.c
@@ -4,6 +4,10 @@
#include <stdarg.h>
#include <stdio.h>
+#ifdef __MINGW32__
+/* MinGW-w64 doesn't have a _tcsinc() inline or library function */
+#define _MB_MAP_DIRECT
+#endif
#include <tchar.h>
#include <systools/win32/snprintf.h>
commit dfb99d910f4d1f5a4cfdf5e128b4e6caa08cdc74
Author: Tor Lillqvist <tlillqvist at novell.com>
Date: Sun May 22 01:13:50 2011 +0300
Generate rtlbootstrap.mk in a more clever fashion when cross-compiling
diff --git a/sal/rtl/source/makefile.mk b/sal/rtl/source/makefile.mk
index a378b10..cc8f6ab 100644
--- a/sal/rtl/source/makefile.mk
+++ b/sal/rtl/source/makefile.mk
@@ -128,10 +128,12 @@ OBJFILES= \
$(OBJ)$/alloc_fini.obj
+.IF "$(CROSS_COMPILING)"==""
APP1TARGET=gen_makefile
APP1OBJS=$(SLO)$/gen_makefile.obj
APP1LIBSALCPPRT=
APP1RPATH=NONE
+.ENDIF
.ENDIF
@@ -169,6 +171,14 @@ $(ALWAYSDBGFILES):
ALLTAR : $(BOOTSTRAPMK)
+.IF "$(CROSS_COMPILING)"==""
+
$(BOOTSTRAPMK) : $(APP1TARGETN)
$(AUGMENT_LIBRARY_PATH) $< > $@
+.ELSE
+
+$(BOOTSTRAPMK) :
+ (echo '#include "macro.hxx"'; echo RTL_OS:=THIS_OS; echo RTL_ARCH:=THIS_ARCH) | $(CC) -E $(CFLAGS) $(INCLUDE_C) $(CFLAGSCC) $(CDEFS) $(CFLAGSAPPEND) - | grep '^RTL_' >$@
+
+.ENDIF
commit 83b19b78deea61a1e685a483e3eb6bf13e789d22
Author: Tor Lillqvist <tlillqvist at novell.com>
Date: Sun May 22 01:10:24 2011 +0300
Do build typesconfig also for Windows, but don't do anything there when using MSVC
diff --git a/sal/prj/build.lst b/sal/prj/build.lst
index 105cb19..4de7572 100644
--- a/sal/prj/build.lst
+++ b/sal/prj/build.lst
@@ -1,7 +1,7 @@
sa sal : xml2cmp external BOOST:boost CPPUNIT:cppunit NULL
sa sal usr1 - all sa_mkout NULL
sa sal\inc nmake - all sa_inc NULL
-sa sal\typesconfig nmake - u sa_tc sa_inc NULL
+sa sal\typesconfig nmake - all sa_tc sa_inc NULL
sa sal\cpprt nmake - u sa_cpprt sa_util sa_inc NULL
sa sal\rtl\source nmake - all sa_rtl sa_tc.u sa_inc NULL
sa sal\textenc nmake - all sa_textenc sa_tc.u sa_inc NULL
diff --git a/sal/typesconfig/makefile.mk b/sal/typesconfig/makefile.mk
index 084dc89..ac106ab 100644
--- a/sal/typesconfig/makefile.mk
+++ b/sal/typesconfig/makefile.mk
@@ -42,17 +42,23 @@ CXXFLAGS+= $(LFS_CFLAGS)
# --- Files --------------------------------------------------------
+.IF "$(CROSS_COMPILING)"=="" && "$(COM)"!="MSC"
+
APP1TARGET= $(TARGET)
APP1OBJS= $(OBJ)$/typesconfig.obj
APP1STDLIBS=
APP1DEF=
+.ENDIF
+
# --- Targets ------------------------------------------------------
.INCLUDE : target.mk
.IF "$(L10N-framework)"==""
+.IF "$(COM)"!="MSC"
ALLTAR : $(INCCOM)$/sal$/typesizes.h
+.ENDIF
.ENDIF # "$(L10N-framework)"==""
.IF "$(CROSS_COMPILING)"==""
commit 5ad295133d0acf71ece0fcf419020aca2e662aa1
Author: Tor Lillqvist <tlillqvist at novell.com>
Date: Sun May 22 01:08:38 2011 +0300
Fix compilation errors with recet mingw-w64
diff --git a/sal/osl/w32/MAKEFILE.MK b/sal/osl/w32/MAKEFILE.MK
deleted file mode 100644
index 08e8745..0000000
--- a/sal/osl/w32/MAKEFILE.MK
+++ /dev/null
@@ -1,114 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-PRJ=..$/..
-
-PRJNAME=sal
-TARGET=cpposl
-ENABLE_EXCEPTIONS=TRUE
-USE_LDUMP2=TRUE
-
-PROJECTPCH4DLL=TRUE
-PROJECTPCH=cont_pch
-PROJECTPCHSOURCE=cont_pch
-
-MULTITHREAD_OBJ=TRUE
-
-# --- Settings -----------------------------------------------------
-
-.INCLUDE : settings.mk
-
-# Uncomment the following line if you want to compile with -Wall
-# it disables lots of unnecessary warnings comming from the Win32
-# header files (disabling warnings via command line only works with
-# MSVC >= 7.x)
-#
-# CFLAGS+=/wd4668 /wd4711 /wd4201 /wd4710 /wd4619 /wd4514 /wd4820
-
-# --- Files --------------------------------------------------------
-.IF "$(CCNUMVER)" >= "001400000000"
-CDEFS+=-D_CRT_NON_CONFORMING_SWPRINTFS
-.ENDIF
-
-.IF "$(header)" == ""
-
-SLOFILES= $(SLO)$/conditn.obj \
- $(SLO)$/diagnose.obj \
- $(SLO)$/dllentry.obj \
- $(SLO)$/semaphor.obj \
- $(SLO)$/socket.obj \
- $(SLO)$/interlck.obj \
- $(SLO)$/nlsupport.obj\
- $(SLO)$/mutex.obj \
- $(SLO)$/thread.obj \
- $(SLO)$/module.obj \
- $(SLO)$/process.obj \
- $(SLO)$/security.obj \
- $(SLO)$/profile.obj \
- $(SLO)$/time.obj \
- $(SLO)$/signal.obj \
- $(SLO)$/pipe.obj \
- $(SLO)$/util.obj \
- $(SLO)$/file.obj\
- $(SLO)$/file_dirvol.obj\
- $(SLO)$/file_error.obj\
- $(SLO)$/file_url.obj\
- $(SLO)$/tempfile.obj\
- $(SLO)$/path_helper.obj\
- $(SLO)$/procimpl.obj \
- $(SLO)$/salinit.obj
-
-OBJFILES= $(OBJ)$/conditn.obj \
- $(OBJ)$/diagnose.obj \
- $(OBJ)$/semaphor.obj \
- $(OBJ)$/socket.obj \
- $(OBJ)$/interlck.obj \
- $(OBJ)$/nlsupport.obj\
- $(OBJ)$/mutex.obj \
- $(OBJ)$/thread.obj \
- $(OBJ)$/module.obj \
- $(OBJ)$/process.obj \
- $(OBJ)$/security.obj \
- $(OBJ)$/profile.obj \
- $(OBJ)$/time.obj \
- $(OBJ)$/signal.obj \
- $(OBJ)$/pipe.obj \
- $(OBJ)$/util.obj \
- $(OBJ)$/file.obj\
- $(OBJ)$/file_dirvol.obj\
- $(OBJ)$/file_error.obj\
- $(OBJ)$/file_url.obj\
- $(OBJ)$/tempfile.obj\
- $(OBJ)$/path_helper.obj\
- $(OBJ)$/procimpl.obj \
- $(OBJ)$/salinit.obj
-
-.ENDIF
-
-# --- Targets ------------------------------------------------------
-
-.INCLUDE : target.mk
diff --git a/sal/osl/w32/makefile.mk b/sal/osl/w32/makefile.mk
new file mode 100644
index 0000000..08e8745
--- /dev/null
+++ b/sal/osl/w32/makefile.mk
@@ -0,0 +1,114 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+PRJ=..$/..
+
+PRJNAME=sal
+TARGET=cpposl
+ENABLE_EXCEPTIONS=TRUE
+USE_LDUMP2=TRUE
+
+PROJECTPCH4DLL=TRUE
+PROJECTPCH=cont_pch
+PROJECTPCHSOURCE=cont_pch
+
+MULTITHREAD_OBJ=TRUE
+
+# --- Settings -----------------------------------------------------
+
+.INCLUDE : settings.mk
+
+# Uncomment the following line if you want to compile with -Wall
+# it disables lots of unnecessary warnings comming from the Win32
+# header files (disabling warnings via command line only works with
+# MSVC >= 7.x)
+#
+# CFLAGS+=/wd4668 /wd4711 /wd4201 /wd4710 /wd4619 /wd4514 /wd4820
+
+# --- Files --------------------------------------------------------
+.IF "$(CCNUMVER)" >= "001400000000"
+CDEFS+=-D_CRT_NON_CONFORMING_SWPRINTFS
+.ENDIF
+
+.IF "$(header)" == ""
+
+SLOFILES= $(SLO)$/conditn.obj \
+ $(SLO)$/diagnose.obj \
+ $(SLO)$/dllentry.obj \
+ $(SLO)$/semaphor.obj \
+ $(SLO)$/socket.obj \
+ $(SLO)$/interlck.obj \
+ $(SLO)$/nlsupport.obj\
+ $(SLO)$/mutex.obj \
+ $(SLO)$/thread.obj \
+ $(SLO)$/module.obj \
+ $(SLO)$/process.obj \
+ $(SLO)$/security.obj \
+ $(SLO)$/profile.obj \
+ $(SLO)$/time.obj \
+ $(SLO)$/signal.obj \
+ $(SLO)$/pipe.obj \
+ $(SLO)$/util.obj \
+ $(SLO)$/file.obj\
+ $(SLO)$/file_dirvol.obj\
+ $(SLO)$/file_error.obj\
+ $(SLO)$/file_url.obj\
+ $(SLO)$/tempfile.obj\
+ $(SLO)$/path_helper.obj\
+ $(SLO)$/procimpl.obj \
+ $(SLO)$/salinit.obj
+
+OBJFILES= $(OBJ)$/conditn.obj \
+ $(OBJ)$/diagnose.obj \
+ $(OBJ)$/semaphor.obj \
+ $(OBJ)$/socket.obj \
+ $(OBJ)$/interlck.obj \
+ $(OBJ)$/nlsupport.obj\
+ $(OBJ)$/mutex.obj \
+ $(OBJ)$/thread.obj \
+ $(OBJ)$/module.obj \
+ $(OBJ)$/process.obj \
+ $(OBJ)$/security.obj \
+ $(OBJ)$/profile.obj \
+ $(OBJ)$/time.obj \
+ $(OBJ)$/signal.obj \
+ $(OBJ)$/pipe.obj \
+ $(OBJ)$/util.obj \
+ $(OBJ)$/file.obj\
+ $(OBJ)$/file_dirvol.obj\
+ $(OBJ)$/file_error.obj\
+ $(OBJ)$/file_url.obj\
+ $(OBJ)$/tempfile.obj\
+ $(OBJ)$/path_helper.obj\
+ $(OBJ)$/procimpl.obj \
+ $(OBJ)$/salinit.obj
+
+.ENDIF
+
+# --- Targets ------------------------------------------------------
+
+.INCLUDE : target.mk
diff --git a/sal/osl/w32/module.cxx b/sal/osl/w32/module.cxx
index 4b7cd20..a332d3a 100644
--- a/sal/osl/w32/module.cxx
+++ b/sal/osl/w32/module.cxx
@@ -26,7 +26,13 @@
*
************************************************************************/
+#ifdef __MINGW32__
+extern "C" {
+#endif
#include "system.h"
+#ifdef __MINGW32__
+}
+#endif
#include <tlhelp32.h>
#include "file_url.h"
@@ -81,13 +87,13 @@ oslModule SAL_CALL osl_loadModule(rtl_uString *strModuleName, sal_Int32 /*nRtldM
{
std::vector<sal_Unicode, rtl::Allocator<sal_Unicode> > vec(Module->length + 1);
DWORD len = GetShortPathNameW(reinterpret_cast<LPCWSTR>(Module->buffer),
- &vec[0], Module->length + 1);
+ reinterpret_cast<LPWSTR>(&vec[0]), Module->length + 1);
if (len )
{
- hInstance = LoadLibraryW(&vec[0]);
+ hInstance = LoadLibraryW(reinterpret_cast<LPWSTR>(&vec[0]));
if (hInstance == NULL)
- hInstance = LoadLibraryExW(&vec[0], NULL,
+ hInstance = LoadLibraryExW(reinterpret_cast<LPWSTR>(&vec[0]), NULL,
LOAD_WITH_ALTERED_SEARCH_PATH);
}
}
diff --git a/sal/osl/w32/procimpl.cxx b/sal/osl/w32/procimpl.cxx
index 7cb2110..3ac82dc 100644
--- a/sal/osl/w32/procimpl.cxx
+++ b/sal/osl/w32/procimpl.cxx
@@ -315,7 +315,7 @@ namespace /* private */
std::vector<sal_Unicode, rtl::Allocator<sal_Unicode> > vec(path.getLength() + 1);
//GetShortPathNameW only works if the file can be found!
const DWORD len = GetShortPathNameW(
- path.getStr(), &vec[0], path.getLength() + 1);
+ reinterpret_cast<LPCWSTR>(path.getStr()), reinterpret_cast<LPWSTR>(&vec[0]), path.getLength() + 1);
if (!len && GetLastError() == ERROR_FILE_NOT_FOUND
&& extension.getLength())
@@ -324,7 +324,7 @@ namespace /* private */
std::vector<sal_Unicode, rtl::Allocator<sal_Unicode> > vec2(
extPath.getLength() + 1);
const DWORD len2 = GetShortPathNameW(
- extPath.getStr(), &vec2[0], extPath.getLength() + 1);
+ reinterpret_cast<LPCWSTR>(extPath.getStr()), reinterpret_cast<LPWSTR>(&vec2[0]), extPath.getLength() + 1);
ret = rtl::OUString(&vec2[0], len2);
}
else
diff --git a/sal/osl/w32/signal.cxx b/sal/osl/w32/signal.cxx
index 5f97f72..4520cbe 100644
--- a/sal/osl/w32/signal.cxx
+++ b/sal/osl/w32/signal.cxx
@@ -39,7 +39,7 @@
#ifndef __MINGW32__
#include <DbgHelp.h>
#endif
-#include <ErrorRep.h>
+#include <errorrep.h>
#include <systools/win32/uwinapi.h>
#include <sal/macros.h>
More information about the Libreoffice-commits
mailing list