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
commitbcf840df2bc1d04bfadc1351793f9bdbeb9f137b (patch)
tree8cbb5400d8766ec7392eefd7379d17f91dc03278 /sal/systools
parent838d6d86c83fc319ceffe7152611436c2c21200f (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 b88cfcb361d2..650db4a6fabe 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 69b2d66609c1..91f83af1fc70 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 1d7e7580cb45..9a09411d6f92 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 144882bddc63..424e5bd3a3a3 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>