summaryrefslogtreecommitdiff
path: root/sal
diff options
context:
space:
mode:
Diffstat (limited to 'sal')
-rw-r--r--sal/osl/w32/dllentry.c91
-rw-r--r--sal/osl/w32/file.cxx5
-rw-r--r--sal/osl/w32/file_dirvol.cxx3
-rw-r--r--sal/osl/w32/interlck.c4
-rw-r--r--sal/osl/w32/signal.cxx2
-rw-r--r--sal/osl/w32/system.h51
-rw-r--r--sal/osl/w32/tempfile.cxx4
-rw-r--r--sal/qa/rtl/oustringbuffer/test_oustringbuffer_assign.cxx3
-rw-r--r--sal/qa/rtl/strings/test_oustring_stringliterals.cxx3
-rw-r--r--sal/systools/win32/uwinapi/sntprintf.c31
10 files changed, 13 insertions, 184 deletions
diff --git a/sal/osl/w32/dllentry.c b/sal/osl/w32/dllentry.c
index d336e70810c1..670592b3a600 100644
--- a/sal/osl/w32/dllentry.c
+++ b/sal/osl/w32/dllentry.c
@@ -47,17 +47,6 @@
extern CRITICAL_SECTION g_ThreadKeyListCS;
extern oslMutex g_Mutex;
-#ifdef __MINGW32__
-
-typedef void (*func_ptr) (void);
-extern func_ptr __CTOR_LIST__[];
-extern func_ptr __DTOR_LIST__[];
-
-static void do_startup(void);
-static void do_cleanup(void);
-
-#else
-
/*
This is needed because DllMain is called after static constructors. A DLL's
startup and shutdown sequence looks like this:
@@ -75,73 +64,6 @@ _pRawDllMain()
static BOOL WINAPI RawDllMain( HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved );
BOOL (WINAPI *_pRawDllMain)(HINSTANCE, DWORD, LPVOID) = RawDllMain;
-#endif
-
-#ifdef __MINGW32__
-
-void
-__do_global_dtors (void)
-{
- static func_ptr *p = __DTOR_LIST__ + 1;
-
- /*
- * Call each destructor in the destructor list until a null pointer
- * is encountered.
- */
- while (*p)
- {
- (*(p)) ();
- p++;
- }
-}
-
-void
-__do_global_ctors (void)
-{
- sal_uIntPtr nptrs = (sal_uIntPtr) __CTOR_LIST__[0];
- unsigned i;
-
- /*
- * If the first entry in the constructor list is -1 then the list
- * is terminated with a null entry. Otherwise the first entry was
- * the number of pointers in the list.
- */
- if (nptrs == (sal_uIntPtr)-1)
- {
- for (nptrs = 0; __CTOR_LIST__[nptrs + 1] != 0; nptrs++)
- ;
- }
-
- /*
- * Go through the list backwards calling constructors.
- */
- for (i = nptrs; i >= 1; i--)
- {
- __CTOR_LIST__[i] ();
- }
-
- /*
- * Register the destructors for processing on exit.
- */
- atexit (__do_global_dtors);
-}
-
-static int initialized = 0;
-
-void
-__main (void)
-{
- if (!initialized)
- {
- initialized = 1;
- do_startup();
- __do_global_ctors ();
- }
-}
-
-static void do_startup( void )
-{
-#else
static BOOL WINAPI RawDllMain( HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved )
{
(void)hinstDLL; /* avoid warnings */
@@ -166,7 +88,6 @@ static BOOL WINAPI RawDllMain( HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvRe
_set_error_mode(_OUT_TO_STDERR);
}
#endif
-#endif
#if OSL_DEBUG_LEVEL < 2
/* Suppress file error messages from system like "Floppy A: not inserted" */
@@ -185,19 +106,10 @@ static BOOL WINAPI RawDllMain( HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvRe
//We disable floating point exceptions. This is the usual state at program startup
//but on Windows 98 and ME this is not always the case.
_control87(_MCW_EM, _MCW_EM);
-#ifdef __MINGW32__
- atexit(do_cleanup);
-}
-
-void do_cleanup( void )
-{
-#else
break;
}
case DLL_PROCESS_DETACH:
-#endif
-
WSACleanup( );
TlsFree( g_dwTLSTextEncodingIndex );
@@ -207,8 +119,6 @@ void do_cleanup( void )
osl_destroyMutex( g_CurrentDirectoryMutex );
-#ifndef __MINGW32__
-
/*
On a product build memory management finalization might
@@ -243,7 +153,6 @@ void do_cleanup( void )
}
return TRUE;
-#endif
}
static DWORD GetParentProcessId()
diff --git a/sal/osl/w32/file.cxx b/sal/osl/w32/file.cxx
index 73cb2f8409ed..bb5df9940206 100644
--- a/sal/osl/w32/file.cxx
+++ b/sal/osl/w32/file.cxx
@@ -35,11 +35,6 @@
#include <stdio.h>
#include <tchar.h>
-#ifdef __MINGW32__
-#include <wchar.h>
-#include <ctype.h>
-#endif
-
#include <algorithm>
#include <limits>
diff --git a/sal/osl/w32/file_dirvol.cxx b/sal/osl/w32/file_dirvol.cxx
index a2fbfc15a21f..1f50617abab0 100644
--- a/sal/osl/w32/file_dirvol.cxx
+++ b/sal/osl/w32/file_dirvol.cxx
@@ -37,9 +37,6 @@
#include <rtl/character.hxx>
#include <tchar.h>
-#ifdef __MINGW32__
-#include <ctype.h>
-#endif
static const wchar_t UNC_PREFIX[] = L"\\\\";
static const wchar_t BACKSLASH = '\\';
diff --git a/sal/osl/w32/interlck.c b/sal/osl/w32/interlck.c
index 32ce6f694bb3..68c9504763a1 100644
--- a/sal/osl/w32/interlck.c
+++ b/sal/osl/w32/interlck.c
@@ -22,10 +22,6 @@
#include <osl/interlck.h>
#include <osl/diagnose.h>
-#if defined __MINGW32__
-#pragma GCC diagnostic warning "-Wreturn-type"
-#endif
-
oslInterlockedCount SAL_CALL osl_incrementInterlockedCount(oslInterlockedCount* pCount)
{
return (InterlockedIncrement(pCount));
diff --git a/sal/osl/w32/signal.cxx b/sal/osl/w32/signal.cxx
index a9fa84f7c86b..c74dde485441 100644
--- a/sal/osl/w32/signal.cxx
+++ b/sal/osl/w32/signal.cxx
@@ -31,9 +31,7 @@
#include <osl/diagnose.h>
#include <osl/signal.h>
-#ifndef __MINGW32__
#include <DbgHelp.h>
-#endif
#include <errorrep.h>
#include <systools/win32/uwinapi.h>
#include <sal/macros.h>
diff --git a/sal/osl/w32/system.h b/sal/osl/w32/system.h
index 4cb8b4e76539..700d9aa578f8 100644
--- a/sal/osl/w32/system.h
+++ b/sal/osl/w32/system.h
@@ -43,47 +43,16 @@
*/
#define WIN32_LEAN_AND_MEAN
-#ifdef __GNUC__
- // windows.h includes winsock2.h
- // if _WIN32_WINNT > 0x0400
- // so someone cannot include winsock.h
- // at the same time without patching
- // windows.h
- #include <windows.h>
- #include <winsock2.h>
- #ifdef __cplusplus
- extern "C" {
- #endif
- #include <ws2tcpip.h>
- #ifdef __cplusplus
- }
- #endif
- #include <shlobj.h>
- #ifndef NO_DEBUG_CRT
- #include <crtdbg.h>
- #endif
-#else
- // winsock2.h includes windows.h
- #pragma warning(push,1) /* disable warnings within system headers */
- #pragma warning(disable:4917)
- #include <winsock2.h>
- #include <wsipx.h>
- #include <ws2tcpip.h>
- #include <shlobj.h>
- #ifndef NO_DEBUG_CRT
- #include <crtdbg.h>
- #endif
- #pragma warning(pop)
+// winsock2.h includes windows.h
+#pragma warning(push,1) /* disable warnings within system headers */
+#pragma warning(disable:4917)
+#include <winsock2.h>
+#include <wsipx.h>
+#include <ws2tcpip.h>
+#include <shlobj.h>
+#ifndef NO_DEBUG_CRT
+ #include <crtdbg.h>
#endif
-
-#ifdef __GNUC__
- # ifndef SA_FAMILY_DECL
- # define SA_FAMILY_DECL short sa_family
- # endif
-
- # define NSPROTO_IPX 1000
- # define NSPROTO_SPX 1256
- # define NSPROTO_SPXII 1257
-#endif // #ifdef __GNUC__
+#pragma warning(pop)
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sal/osl/w32/tempfile.cxx b/sal/osl/w32/tempfile.cxx
index 14478e694a60..3128fb3f65d1 100644
--- a/sal/osl/w32/tempfile.cxx
+++ b/sal/osl/w32/tempfile.cxx
@@ -34,12 +34,8 @@
#include <tchar.h>
// Allocate n number of t's on the stack return a pointer to it in p
-#ifdef __MINGW32__
-#define STACK_ALLOC(p, t, n) (p) = reinterpret_cast<t*>(_alloca((n)*sizeof(t)));
-#else
#define STACK_ALLOC(p, t, n) __try {(p) = static_cast<t*>(_alloca((n)*sizeof(t)));} \
__except(EXCEPTION_EXECUTE_HANDLER) {(p) = nullptr;}
-#endif
// Temp file functions
diff --git a/sal/qa/rtl/oustringbuffer/test_oustringbuffer_assign.cxx b/sal/qa/rtl/oustringbuffer/test_oustringbuffer_assign.cxx
index 1e894129c649..aa14225bc455 100644
--- a/sal/qa/rtl/oustringbuffer/test_oustringbuffer_assign.cxx
+++ b/sal/qa/rtl/oustringbuffer/test_oustringbuffer_assign.cxx
@@ -44,8 +44,7 @@ private:
b2 = "1234567890123456";
CPPUNIT_ASSERT_EQUAL(s3, b2.toString());
CPPUNIT_ASSERT_EQUAL(sal_Int32(32), b2.getCapacity());
-#if HAVE_CXX11_UTF16_STRING_LITERAL \
- && (!defined SAL_W32 || defined __MINGW32__)
+#if HAVE_CXX11_UTF16_STRING_LITERAL && !defined SAL_W32
// sal_Unicode is still wchar_t not char16_t even for MSVC 2015
OUStringBuffer b3;
b3 = u"123456789012345";
diff --git a/sal/qa/rtl/strings/test_oustring_stringliterals.cxx b/sal/qa/rtl/strings/test_oustring_stringliterals.cxx
index 094a779fc2f1..b221306f8ba4 100644
--- a/sal/qa/rtl/strings/test_oustring_stringliterals.cxx
+++ b/sal/qa/rtl/strings/test_oustring_stringliterals.cxx
@@ -353,8 +353,7 @@ void test::oustring::StringLiterals::checkOUStringLiteral1()
}
void test::oustring::StringLiterals::checkUtf16() {
-#if HAVE_CXX11_UTF16_STRING_LITERAL \
- && (!defined SAL_W32 || defined __MINGW32__)
+#if HAVE_CXX11_UTF16_STRING_LITERAL && !defined SAL_W32
// sal_Unicode is still wchar_t not char16_t even for MSVC 2015
rtl::OUString s1(u"abc");
CPPUNIT_ASSERT_EQUAL(rtl::OUString("abc"), s1);
diff --git a/sal/systools/win32/uwinapi/sntprintf.c b/sal/systools/win32/uwinapi/sntprintf.c
index a46ed2e7c478..22ce4f7d3050 100644
--- a/sal/systools/win32/uwinapi/sntprintf.c
+++ b/sal/systools/win32/uwinapi/sntprintf.c
@@ -22,10 +22,6 @@
#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>
@@ -33,33 +29,8 @@
#pragma warning(disable:4273) // inconsistent dll linkage
#endif
-#if defined(__MINGW32_VERSION) && ((__MINGW32_MAJOR_VERSION < 3)||((__MINGW32_MAJOR_VERSION == 3)&&(__MINGW32_MINOR_VERSION < 18)))
-
-/* The non-debug versions of _vscprintf/_scprintf are just calls
- to _vsprintf/_sprintf with string buffer pointer set to NULL,
- requires MSVCRT version 7.0 */
-#ifdef __MINGW32__
-static int __cdecl _vsctprintf( const TCHAR *format, va_list ap )
-#else
-static int __cdecl _vsctprintf( const _TXCHAR *format, va_list ap )
-#endif
-{
- FILE *fp = _tfopen( _T("NUL"), _T("wb") );
-
- if ( fp )
- {
- int retval = _vftprintf( fp, format, ap );
- fclose( fp );
-
- return retval;
- }
-
- return -1;
-}
-#endif
-
/* VS 2015 and above support ISO C snprintf */
-#if (defined(__MINGW32__) && !defined (__NO_ISOCEXT)) || (defined(_MSC_VER) && (_MSC_VER < 1900))
+#if _MSC_VER < 1900
/* This function retrieves the pointer to the last character of a buffer.
That is the pointer to the last character of the buffer that fits