From fd1febb2f093fd54e0a9d8457c40594399dbf923 Mon Sep 17 00:00:00 2001 From: anders_k Date: Wed, 15 Jun 2011 22:48:02 +0000 Subject: [PATCH] Fixes for MinGW (substart and system.dll still broken) git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@6154 212acab6-be3b-0410-9dea-997c60f758d6 --- Contrib/ExDLL/SConscript | 3 ++- SCons/Config/gnu | 2 +- Source/Platform.h | 15 +++++++++++++-- Source/SConscript | 1 + 4 files changed, 17 insertions(+), 4 deletions(-) diff --git a/Contrib/ExDLL/SConscript b/Contrib/ExDLL/SConscript index bf578cb6..2ea28f33 100644 --- a/Contrib/ExDLL/SConscript +++ b/Contrib/ExDLL/SConscript @@ -67,4 +67,5 @@ plugin_env.Append(LIBPATH = ['#$BUILD_PREFIX/api/nsis']) plugin_env.Append(LIBS = [lib_target]) plugin_uenv.Append(CPPPATH = ['#$BUILD_PREFIX/api']) plugin_uenv.Append(LIBPATH = ['#$BUILD_PREFIX/api/nsis']) -plugin_uenv.Append(LIBS = [lib_target+'W']) +if env['UNICODE']: # MinGW ANSI build tries to link with pluginapi and pluginapiW, this is a hack to stop that [Anders] + plugin_uenv.Append(LIBS = [lib_target+'W']) diff --git a/SCons/Config/gnu b/SCons/Config/gnu index dc5498b5..eb6953a7 100644 --- a/SCons/Config/gnu +++ b/SCons/Config/gnu @@ -31,7 +31,7 @@ defenv['ALIGN_FLAG'] = '-Wl,--file-alignment,512' defenv['CPP_REQUIRES_STDLIB'] = 1 defenv['SUBSYS_CON'] = '-Wl,--subsystem,console' defenv['MSVCRT_FLAG'] = '' -defenv['STDCALL'] = ' __attribute__((__stdcall__))' +defenv['STDCALL'] = '__attribute__((__stdcall__))' ### defines diff --git a/Source/Platform.h b/Source/Platform.h index bc3a5cbb..ca5aa022 100644 --- a/Source/Platform.h +++ b/Source/Platform.h @@ -28,7 +28,6 @@ #include #include #include -#pragma comment(lib, "shlwapi.lib") #include "tchar.h" #else # ifndef EXEHEAD @@ -110,6 +109,10 @@ typedef DWORDLONG ULONGLONG,*PULONGLONG; #endif +#ifndef INT_MAX +#include +#endif + // mingw32 and w64-mingw32 do not define ULONG_PTR // but rather declare ULONG_PTR via typedef (see basetsd.h) @@ -220,7 +223,7 @@ typedef DWORDLONG ULONGLONG,*PULONGLONG; // functions // Anders: MSVC's swprintf is non standard, use _snwprintf when you really mean swprintf -#if !defined(_MSC_VER) && !defined(_snwprintf) +#if !defined(_MSC_VER) && !defined(__MINGW32__) && !defined(_snwprintf) #define _snwprintf swprintf #endif @@ -236,6 +239,14 @@ typedef DWORDLONG ULONGLONG,*PULONGLONG; // defines +#ifndef WC_NO_BEST_FIT_CHARS +# define MEM_LARGE_PAGES 0x20000000 +#endif + +#ifndef WC_NO_BEST_FIT_CHARS +# define WC_NO_BEST_FIT_CHARS 0x400 +#endif + #ifndef IDC_HAND # define IDC_HAND MAKEINTRESOURCE(32649) #endif diff --git a/Source/SConscript b/Source/SConscript index ae0f02f0..b5ac6df5 100644 --- a/Source/SConscript +++ b/Source/SConscript @@ -53,6 +53,7 @@ libs = Split(""" user32 pthread iconv + shlwapi """) Import('env AddAvailableLibs AddZLib')