summaryrefslogtreecommitdiff
path: root/sal/systools
diff options
context:
space:
mode:
authorTor Lillqvist <tlillqvist@novell.com>2011-05-22 01:15:35 +0300
committerTor Lillqvist <tlillqvist@novell.com>2011-05-22 01:15:35 +0300
commitd4de9877eb2ed821857a9ffae91eac7163b2f32a (patch)
tree9c45a2af0cd61a9e62ba14a6cc0e918c69ff55ab /sal/systools
parentdfb99d910f4d1f5a4cfdf5e128b4e6caa08cdc74 (diff)
MinGW cross-compilation fixes
Diffstat (limited to 'sal/systools')
-rw-r--r--sal/systools/win32/onlineupdate/onlinecheck.cxx17
-rw-r--r--sal/systools/win32/uwinapi/macros.h2
-rw-r--r--sal/systools/win32/uwinapi/makefile.mk4
-rw-r--r--sal/systools/win32/uwinapi/sntprintf.c4
4 files changed, 9 insertions, 18 deletions
diff --git a/sal/systools/win32/onlineupdate/onlinecheck.cxx b/sal/systools/win32/onlineupdate/onlinecheck.cxx
index 67289ba8a..dd09b7d83 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 2d253c413..c550c2439 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 1d7e7580c..9a09411d6 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 534f76336..b5316f022 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>