annotate src/nsis-1-fixes.patch @ 3526:60cd6f076a3d

allow nsis to compile with 32-bit mingw-w64
author John W. Eaton <jwe@octave.org>
date Sun, 16 Feb 2014 18:02:22 -0500
parents a1d474da2036
children d76aee4b2c2b
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2687
de129d8bdb4b package nsis: fixed build failure
Mark Brand <mabrand@mabrand.nl>
parents:
diff changeset
1 This file is part of MXE.
de129d8bdb4b package nsis: fixed build failure
Mark Brand <mabrand@mabrand.nl>
parents:
diff changeset
2 See index.html for further information.
de129d8bdb4b package nsis: fixed build failure
Mark Brand <mabrand@mabrand.nl>
parents:
diff changeset
3
2994
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
4 Contains ad hoc patches for cross building.
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
5
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
6 From a2aff1c5e0febc993545ecd8379135ec7b53358b Mon Sep 17 00:00:00 2001
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
7 From: MXE
2687
de129d8bdb4b package nsis: fixed build failure
Mark Brand <mabrand@mabrand.nl>
parents:
diff changeset
8 Date: Sun, 12 Aug 2012 12:33:26 +0200
2994
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
9 Subject: [PATCH 1/3] explicit mingw cross prefix
2687
de129d8bdb4b package nsis: fixed build failure
Mark Brand <mabrand@mabrand.nl>
parents:
diff changeset
10
de129d8bdb4b package nsis: fixed build failure
Mark Brand <mabrand@mabrand.nl>
parents:
diff changeset
11 This patch has been taken from:
de129d8bdb4b package nsis: fixed build failure
Mark Brand <mabrand@mabrand.nl>
parents:
diff changeset
12 http://sourceforge.net/tracker/index.php?func=detail&aid=3305366&group_id=22049&atid=373085
de129d8bdb4b package nsis: fixed build failure
Mark Brand <mabrand@mabrand.nl>
parents:
diff changeset
13
de129d8bdb4b package nsis: fixed build failure
Mark Brand <mabrand@mabrand.nl>
parents:
diff changeset
14 diff --git a/SCons/Tools/crossmingw.py b/SCons/Tools/crossmingw.py
de129d8bdb4b package nsis: fixed build failure
Mark Brand <mabrand@mabrand.nl>
parents:
diff changeset
15 index d27e01c..fef9150 100755
de129d8bdb4b package nsis: fixed build failure
Mark Brand <mabrand@mabrand.nl>
parents:
diff changeset
16 --- a/SCons/Tools/crossmingw.py
de129d8bdb4b package nsis: fixed build failure
Mark Brand <mabrand@mabrand.nl>
parents:
diff changeset
17 +++ b/SCons/Tools/crossmingw.py
de129d8bdb4b package nsis: fixed build failure
Mark Brand <mabrand@mabrand.nl>
parents:
diff changeset
18 @@ -61,6 +61,9 @@ prefixes = SCons.Util.Split("""
de129d8bdb4b package nsis: fixed build failure
Mark Brand <mabrand@mabrand.nl>
parents:
diff changeset
19 """)
de129d8bdb4b package nsis: fixed build failure
Mark Brand <mabrand@mabrand.nl>
parents:
diff changeset
20
de129d8bdb4b package nsis: fixed build failure
Mark Brand <mabrand@mabrand.nl>
parents:
diff changeset
21 def find(env):
de129d8bdb4b package nsis: fixed build failure
Mark Brand <mabrand@mabrand.nl>
parents:
diff changeset
22 + if env.has_key('MINGW_CROSS_PREFIX'):
de129d8bdb4b package nsis: fixed build failure
Mark Brand <mabrand@mabrand.nl>
parents:
diff changeset
23 + return env['MINGW_CROSS_PREFIX']
de129d8bdb4b package nsis: fixed build failure
Mark Brand <mabrand@mabrand.nl>
parents:
diff changeset
24 +
de129d8bdb4b package nsis: fixed build failure
Mark Brand <mabrand@mabrand.nl>
parents:
diff changeset
25 for prefix in prefixes:
de129d8bdb4b package nsis: fixed build failure
Mark Brand <mabrand@mabrand.nl>
parents:
diff changeset
26 # First search in the SCons path and then the OS path:
de129d8bdb4b package nsis: fixed build failure
Mark Brand <mabrand@mabrand.nl>
parents:
diff changeset
27 if env.WhereIs(prefix + 'gcc') or SCons.Util.WhereIs(prefix + 'gcc'):
de129d8bdb4b package nsis: fixed build failure
Mark Brand <mabrand@mabrand.nl>
parents:
diff changeset
28 diff --git a/SConstruct b/SConstruct
de129d8bdb4b package nsis: fixed build failure
Mark Brand <mabrand@mabrand.nl>
parents:
diff changeset
29 index 80872bc..4f113dd 100755
de129d8bdb4b package nsis: fixed build failure
Mark Brand <mabrand@mabrand.nl>
parents:
diff changeset
30 --- a/SConstruct
de129d8bdb4b package nsis: fixed build failure
Mark Brand <mabrand@mabrand.nl>
parents:
diff changeset
31 +++ b/SConstruct
de129d8bdb4b package nsis: fixed build failure
Mark Brand <mabrand@mabrand.nl>
parents:
diff changeset
32 @@ -59,6 +59,7 @@ doc = [
de129d8bdb4b package nsis: fixed build failure
Mark Brand <mabrand@mabrand.nl>
parents:
diff changeset
33
de129d8bdb4b package nsis: fixed build failure
Mark Brand <mabrand@mabrand.nl>
parents:
diff changeset
34 path = ARGUMENTS.get('PATH', '')
de129d8bdb4b package nsis: fixed build failure
Mark Brand <mabrand@mabrand.nl>
parents:
diff changeset
35 toolset = ARGUMENTS.get('TOOLSET', '')
de129d8bdb4b package nsis: fixed build failure
Mark Brand <mabrand@mabrand.nl>
parents:
diff changeset
36 +mingw_cross_prefix = ARGUMENTS.get('MINGW_CROSS_PREFIX', '')
de129d8bdb4b package nsis: fixed build failure
Mark Brand <mabrand@mabrand.nl>
parents:
diff changeset
37
de129d8bdb4b package nsis: fixed build failure
Mark Brand <mabrand@mabrand.nl>
parents:
diff changeset
38 if toolset and path:
de129d8bdb4b package nsis: fixed build failure
Mark Brand <mabrand@mabrand.nl>
parents:
diff changeset
39 defenv = Environment(ENV = {'PATH' : path}, TOOLS = toolset.split(',') + ['zip'])
de129d8bdb4b package nsis: fixed build failure
Mark Brand <mabrand@mabrand.nl>
parents:
diff changeset
40 @@ -69,6 +70,8 @@ else:
de129d8bdb4b package nsis: fixed build failure
Mark Brand <mabrand@mabrand.nl>
parents:
diff changeset
41 defenv = Environment(TOOLS = toolset.split(',') + ['zip'])
de129d8bdb4b package nsis: fixed build failure
Mark Brand <mabrand@mabrand.nl>
parents:
diff changeset
42 if not toolset and not path:
de129d8bdb4b package nsis: fixed build failure
Mark Brand <mabrand@mabrand.nl>
parents:
diff changeset
43 defenv = Environment()
de129d8bdb4b package nsis: fixed build failure
Mark Brand <mabrand@mabrand.nl>
parents:
diff changeset
44 +if mingw_cross_prefix:
de129d8bdb4b package nsis: fixed build failure
Mark Brand <mabrand@mabrand.nl>
parents:
diff changeset
45 + defenv['MINGW_CROSS_PREFIX'] = mingw_cross_prefix
de129d8bdb4b package nsis: fixed build failure
Mark Brand <mabrand@mabrand.nl>
parents:
diff changeset
46
de129d8bdb4b package nsis: fixed build failure
Mark Brand <mabrand@mabrand.nl>
parents:
diff changeset
47 Export('defenv')
de129d8bdb4b package nsis: fixed build failure
Mark Brand <mabrand@mabrand.nl>
parents:
diff changeset
48
de129d8bdb4b package nsis: fixed build failure
Mark Brand <mabrand@mabrand.nl>
parents:
diff changeset
49 --
2994
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
50 1.8.2.1
2687
de129d8bdb4b package nsis: fixed build failure
Mark Brand <mabrand@mabrand.nl>
parents:
diff changeset
51
de129d8bdb4b package nsis: fixed build failure
Mark Brand <mabrand@mabrand.nl>
parents:
diff changeset
52
2994
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
53 From d48abdf87538c76261cc447501e0abd755b88c4b Mon Sep 17 00:00:00 2001
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
54 From: MXE
2687
de129d8bdb4b package nsis: fixed build failure
Mark Brand <mabrand@mabrand.nl>
parents:
diff changeset
55 Date: Sun, 12 Aug 2012 12:36:39 +0200
2994
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
56 Subject: [PATCH 2/3] add missing header
2687
de129d8bdb4b package nsis: fixed build failure
Mark Brand <mabrand@mabrand.nl>
parents:
diff changeset
57
de129d8bdb4b package nsis: fixed build failure
Mark Brand <mabrand@mabrand.nl>
parents:
diff changeset
58
de129d8bdb4b package nsis: fixed build failure
Mark Brand <mabrand@mabrand.nl>
parents:
diff changeset
59 diff --git a/Source/util.h b/Source/util.h
de129d8bdb4b package nsis: fixed build failure
Mark Brand <mabrand@mabrand.nl>
parents:
diff changeset
60 index 4259a6a..664923e 100755
de129d8bdb4b package nsis: fixed build failure
Mark Brand <mabrand@mabrand.nl>
parents:
diff changeset
61 --- a/Source/util.h
de129d8bdb4b package nsis: fixed build failure
Mark Brand <mabrand@mabrand.nl>
parents:
diff changeset
62 +++ b/Source/util.h
de129d8bdb4b package nsis: fixed build failure
Mark Brand <mabrand@mabrand.nl>
parents:
diff changeset
63 @@ -25,6 +25,7 @@
de129d8bdb4b package nsis: fixed build failure
Mark Brand <mabrand@mabrand.nl>
parents:
diff changeset
64 #ifndef _WIN32
de129d8bdb4b package nsis: fixed build failure
Mark Brand <mabrand@mabrand.nl>
parents:
diff changeset
65 # include <iconv.h>
de129d8bdb4b package nsis: fixed build failure
Mark Brand <mabrand@mabrand.nl>
parents:
diff changeset
66 # include <stdio.h>
de129d8bdb4b package nsis: fixed build failure
Mark Brand <mabrand@mabrand.nl>
parents:
diff changeset
67 +# include <unistd.h>
de129d8bdb4b package nsis: fixed build failure
Mark Brand <mabrand@mabrand.nl>
parents:
diff changeset
68 #endif
de129d8bdb4b package nsis: fixed build failure
Mark Brand <mabrand@mabrand.nl>
parents:
diff changeset
69
de129d8bdb4b package nsis: fixed build failure
Mark Brand <mabrand@mabrand.nl>
parents:
diff changeset
70
de129d8bdb4b package nsis: fixed build failure
Mark Brand <mabrand@mabrand.nl>
parents:
diff changeset
71 --
2994
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
72 1.8.2.1
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
73
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
74
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
75 From ed27d84aa1de6aee0a2ba788e90a6d0857d2d535 Mon Sep 17 00:00:00 2001
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
76 From: MXE
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
77 Date: Fri, 3 May 2013 17:28:44 +1000
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
78 Subject: [PATCH 3/3] Enable native 64-bit build
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
79
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
80 Taken from:
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
81 http://anonscm.debian.org/gitweb/?p=collab-maint/nsis.git;a=blob;f=debian/patches/makensis_native_64bit.patch;h=2256a0e193db894dd99507ac0de66f8ae060b46b;hb=HEAD
2687
de129d8bdb4b package nsis: fixed build failure
Mark Brand <mabrand@mabrand.nl>
parents:
diff changeset
82
2994
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
83 diff --git a/SCons/Config/gnu b/SCons/Config/gnu
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
84 index a1f917f..adfcbd1 100755
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
85 --- a/SCons/Config/gnu
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
86 +++ b/SCons/Config/gnu
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
87 @@ -95,8 +95,6 @@ makensis_env.Append(CXXFLAGS = ['-Wno-non-virtual-dtor']) # ignore virtual dtor
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
88 makensis_env.Append(CXXFLAGS = ['-Wall']) # all warnings
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
89
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
90 conf = FlagsConfigure(makensis_env)
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
91 -conf.CheckCompileFlag('-m32') #
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
92 -conf.CheckLinkFlag('-m32') #
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
93 conf.CheckLinkFlag('$MAP_FLAG') # generate map file
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
94 if not defenv['DEBUG'] and defenv['STRIP'] and defenv['STRIP_CP']:
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
95 TestStrip(conf) # strip
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
96 @@ -149,8 +147,6 @@ conf.Finish()
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
97 ### cross-platform util environment adjustments
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
98
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
99 conf = FlagsConfigure(cp_util_env)
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
100 -conf.CheckCompileFlag('-m32')
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
101 -conf.CheckLinkFlag('-m32')
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
102 if not defenv['DEBUG'] and defenv['STRIP'] and defenv['STRIP_CP']:
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
103 TestStrip(conf) # strip
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
104 conf.Finish()
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
105 @@ -160,8 +156,6 @@ conf.Finish()
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
106 test_env = defenv.Clone()
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
107 test_env.Append(CPPPATH = ['#$BUILD_CONFIG'])
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
108 conf = FlagsConfigure(test_env)
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
109 -conf.CheckCompileFlag('-m32')
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
110 -conf.CheckLinkFlag('-m32')
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
111 conf.Finish()
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
112
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
113 ### weird GCC requirements
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
114 diff --git a/Source/DialogTemplate.cpp b/Source/DialogTemplate.cpp
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
115 index 109a1d7..f821a05 100755
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
116 --- a/Source/DialogTemplate.cpp
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
117 +++ b/Source/DialogTemplate.cpp
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
118 @@ -74,7 +74,7 @@ void ReadVarLenArr(LPBYTE &seeker, WCHAR* &readInto, unsigned int uCodePage) {
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
119 if (IS_INTRESOURCE(x)) { \
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
120 *(WORD*)seeker = 0xFFFF; \
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
121 seeker += sizeof(WORD); \
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
122 - *(WORD*)seeker = ConvertEndianness(WORD(DWORD(x))); \
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
123 + *(WORD*)seeker = ConvertEndianness(WORD((ULONG_PTR)(x))); \
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
124 seeker += sizeof(WORD); \
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
125 } \
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
126 else { \
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
127 @@ -444,7 +444,7 @@ void CDialogTemplate::ConvertToRTL() {
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
128 szClass = winchar_toansi(m_vItems[i]->szClass);
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
129
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
130 // Button
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
131 - if (long(m_vItems[i]->szClass) == 0x80) {
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
132 + if ((ULONG_PTR)(m_vItems[i]->szClass) == 0x80) {
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
133 m_vItems[i]->dwStyle ^= BS_LEFTTEXT;
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
134 m_vItems[i]->dwStyle ^= BS_RIGHT;
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
135 m_vItems[i]->dwStyle ^= BS_LEFT;
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
136 @@ -458,13 +458,13 @@ void CDialogTemplate::ConvertToRTL() {
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
137 }
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
138 }
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
139 // Edit
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
140 - else if (long(m_vItems[i]->szClass) == 0x81) {
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
141 + else if ((ULONG_PTR)(m_vItems[i]->szClass) == 0x81) {
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
142 if ((m_vItems[i]->dwStyle & ES_CENTER) == 0) {
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
143 m_vItems[i]->dwStyle ^= ES_RIGHT;
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
144 }
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
145 }
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
146 // Static
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
147 - else if (long(m_vItems[i]->szClass) == 0x82) {
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
148 + else if ((ULONG_PTR)(m_vItems[i]->szClass) == 0x82) {
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
149 if ((m_vItems[i]->dwStyle & SS_TYPEMASK) == SS_LEFT || (m_vItems[i]->dwStyle & SS_TYPEMASK) == SS_LEFTNOWORDWRAP)
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
150 {
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
151 m_vItems[i]->dwStyle &= ~SS_TYPEMASK;
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
152 @@ -571,7 +571,7 @@ BYTE* CDialogTemplate::Save(DWORD& dwSize) {
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
153 // Write all of the items
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
154 for (unsigned int i = 0; i < m_vItems.size(); i++) {
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
155 // DLGITEMTEMPLATE[EX]s must be aligned on DWORD boundary
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
156 - if (DWORD(seeker - pbDlg) % sizeof(DWORD))
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
157 + if ((seeker - pbDlg) % sizeof(DWORD))
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
158 seeker += sizeof(WORD);
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
159
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
160 if (m_bExtended) {
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
161 @@ -622,7 +622,7 @@ BYTE* CDialogTemplate::Save(DWORD& dwSize) {
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
162 }
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
163 }
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
164
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
165 - assert((DWORD) seeker - (DWORD) pbDlg == dwSize);
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
166 + assert((DWORD)(seeker - pbDlg) == dwSize);
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
167
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
168 // DONE!
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
169 return pbDlg;
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
170 diff --git a/Source/Platform.h b/Source/Platform.h
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
171 index 52eb9bc..3cdfe32 100755
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
172 --- a/Source/Platform.h
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
173 +++ b/Source/Platform.h
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
174 @@ -53,6 +53,7 @@ typedef unsigned char UCHAR;
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
175 typedef const char *LPCCH, *PCSTR, *LPCSTR;
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
176 typedef unsigned short WCHAR, OLECHAR, *PWCHAR, *LPWCH, *PWCH, *NWPSTR, *LPWSTR, *PWSTR, *BSTR;
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
177 typedef const unsigned short *LPCWCH, *PCWCH, *LPCWSTR, *PCWSTR, *LPCOLESTR;
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
178 +typedef int INT_PTR;
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
179 typedef unsigned int UINT_PTR;
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
180 // basic stuff
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
181 typedef void * HANDLE;
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
182 @@ -60,8 +61,8 @@ typedef HANDLE HWND;
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
183 typedef HANDLE HMODULE;
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
184 typedef unsigned long HKEY;
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
185 // some gdi
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
186 -typedef unsigned long COLORREF;
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
187 -typedef unsigned long HBRUSH;
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
188 +typedef DWORD COLORREF;
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
189 +typedef UINT32 HBRUSH;
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
190 // bool
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
191 # define FALSE 0
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
192 # define TRUE 1
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
193 @@ -166,7 +167,7 @@ typedef DWORDLONG ULONGLONG,*PULONGLONG;
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
194 # define MAKEINTRESOURCE MAKEINTRESOURCEA
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
195 # endif
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
196 # ifndef IMAGE_FIRST_SECTION
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
197 -# define IMAGE_FIRST_SECTION(h) ( PIMAGE_SECTION_HEADER( (DWORD) h + \
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
198 +# define IMAGE_FIRST_SECTION(h) ( PIMAGE_SECTION_HEADER( (ULONG_PTR) h + \
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
199 FIELD_OFFSET(IMAGE_NT_HEADERS, OptionalHeader) + \
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
200 FIX_ENDIAN_INT16(PIMAGE_NT_HEADERS(h)->FileHeader.SizeOfOptionalHeader) ) )
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
201 # endif
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
202 @@ -174,7 +175,7 @@ typedef DWORDLONG ULONGLONG,*PULONGLONG;
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
203 # define RGB(r,g,b) ((DWORD)(((BYTE)(r)|((WORD)(g)<<8))|(((DWORD)(BYTE)(b))<<16)))
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
204 # endif
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
205 # ifndef MAKELONG
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
206 -# define MAKELONG(a,b) ((LONG)(((WORD)(a))|(((DWORD)((WORD)(b)))<<16)))
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
207 +# define MAKELONG(a,b) ((DWORD)(((WORD)(a))|(((DWORD)((WORD)(b)))<<16)))
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
208 # endif
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
209 #endif
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
210 #ifndef IS_INTRESOURCE
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
211 @@ -197,8 +198,10 @@ typedef DWORDLONG ULONGLONG,*PULONGLONG;
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
212 # define FOF_NOERRORUI 0x0400
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
213 #endif
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
214
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
215 -#ifndef ULONG_PTR
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
216 -# define ULONG_PTR DWORD
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
217 +// mingw32 and w64-mingw32 do not define ULONG_PTR
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
218 +// but rather declare ULONG_PTR via typedef (see basetsd.h)
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
219 +#if !defined(__MINGW32__) && !defined(ULONG_PTR)
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
220 +# define ULONG_PTR unsigned long
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
221 #endif
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
222
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
223 #ifndef IDC_HAND
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
224 @@ -238,7 +241,7 @@ typedef DWORDLONG ULONGLONG,*PULONGLONG;
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
225 # undef INVALID_FILE_ATTRIBUTES
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
226 #endif
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
227 #ifndef INVALID_FILE_ATTRIBUTES
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
228 -# define INVALID_FILE_ATTRIBUTES ((unsigned long) -1)
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
229 +# define INVALID_FILE_ATTRIBUTES ((DWORD) -1)
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
230 #endif
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
231
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
232 // shell folders
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
233 diff --git a/Source/Plugins.cpp b/Source/Plugins.cpp
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
234 index 6872b28..90ad393 100755
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
235 --- a/Source/Plugins.cpp
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
236 +++ b/Source/Plugins.cpp
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
237 @@ -29,7 +29,7 @@
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
238 #include "dirreader.h"
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
239
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
240 #ifdef _WIN32
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
241 -# include <WinNT.h>
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
242 +# include <winnt.h>
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
243 #else
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
244 # include <sys/stat.h>
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
245 #endif
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
246 @@ -136,8 +136,8 @@ void Plugins::GetExports(const string &pathToDll, bool displayInfo)
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
247 DWORD prd = FIX_ENDIAN_INT32(sections[i].PointerToRawData);
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
248 PIMAGE_EXPORT_DIRECTORY exports = PIMAGE_EXPORT_DIRECTORY(&dlldata[0] + prd + ExportDirVA - va);
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
249 DWORD na = FIX_ENDIAN_INT32(exports->AddressOfNames);
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
250 - unsigned long *names = (unsigned long*)((unsigned long) exports + (char *) na - ExportDirVA);
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
251 - for (unsigned long j = 0; j < FIX_ENDIAN_INT32(exports->NumberOfNames); j++)
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
252 + LPDWORD names = (LPDWORD)((ULONG_PTR)exports + na - ExportDirVA);
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
253 + for (DWORD j = 0; j < FIX_ENDIAN_INT32(exports->NumberOfNames); j++)
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
254 {
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
255 const string name = string((char*)exports + FIX_ENDIAN_INT32(names[j]) - ExportDirVA);
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
256 const string signature = dllName + "::" + name;
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
257 diff --git a/Source/ResourceEditor.cpp b/Source/ResourceEditor.cpp
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
258 index 8509414..b819f4e 100755
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
259 --- a/Source/ResourceEditor.cpp
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
260 +++ b/Source/ResourceEditor.cpp
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
261 @@ -27,20 +27,10 @@ using namespace std;
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
262 #define ALIGN(dwToAlign, dwAlignOn) dwToAlign = (dwToAlign%dwAlignOn == 0) ? dwToAlign : dwToAlign - (dwToAlign%dwAlignOn) + dwAlignOn
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
263 #define RALIGN(dwToAlign, dwAlignOn) ((dwToAlign%dwAlignOn == 0) ? dwToAlign : dwToAlign - (dwToAlign%dwAlignOn) + dwAlignOn)
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
264
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
265 -#ifndef _WIN32
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
266 -static inline ULONG ConvertEndianness(ULONG u) {
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
267 - return FIX_ENDIAN_INT32(u);
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
268 -}
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
269 -#endif
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
270 -
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
271 static inline DWORD ConvertEndianness(DWORD d) {
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
272 return FIX_ENDIAN_INT32(d);
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
273 }
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
274
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
275 -static inline LONG ConvertEndianness(LONG l) {
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
276 - return FIX_ENDIAN_INT32(l);
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
277 -}
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
278 -
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
279 static inline WORD ConvertEndianness(WORD w) {
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
280 return FIX_ENDIAN_INT16(w);
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
281 }
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
282 @@ -52,7 +42,7 @@ PIMAGE_NT_HEADERS CResourceEditor::GetNTHeaders(BYTE* pbPE) {
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
283 throw runtime_error("PE file contains invalid DOS header");
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
284
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
285 // Get NT headers
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
286 - PIMAGE_NT_HEADERS ntHeaders = (PIMAGE_NT_HEADERS)(pbPE + ConvertEndianness(dosHeader->e_lfanew));
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
287 + PIMAGE_NT_HEADERS ntHeaders = (PIMAGE_NT_HEADERS)(pbPE + ConvertEndianness((DWORD)dosHeader->e_lfanew));
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
288 if (ntHeaders->Signature != IMAGE_NT_SIGNATURE)
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
289 throw runtime_error("PE file missing NT signature");
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
290
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
291 @@ -684,7 +674,7 @@ void CResourceEditor::WriteRsrcSec(BYTE* pbRsrcSec) {
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
292 rdDir.NumberOfIdEntries = ConvertEndianness(rdDir.NumberOfIdEntries);
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
293
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
294 CopyMemory(seeker, &rdDir, sizeof(IMAGE_RESOURCE_DIRECTORY));
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
295 - crd->m_dwWrittenAt = DWORD(seeker);
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
296 + crd->m_ulWrittenAt = (ULONG_PTR)(seeker);
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
297 seeker += sizeof(IMAGE_RESOURCE_DIRECTORY);
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
298
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
299 for (int i = 0; i < crd->CountEntries(); i++) {
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
300 @@ -705,7 +695,7 @@ void CResourceEditor::WriteRsrcSec(BYTE* pbRsrcSec) {
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
301 rDirE.UName.NameString.NameIsString = (crd->GetEntry(i)->HasName()) ? 1 : 0;
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
302
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
303 CopyMemory(seeker, &rDirE, sizeof(MY_IMAGE_RESOURCE_DIRECTORY_ENTRY));
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
304 - crd->GetEntry(i)->m_dwWrittenAt = DWORD(seeker);
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
305 + crd->GetEntry(i)->m_ulWrittenAt = (ULONG_PTR)(seeker);
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
306 seeker += sizeof(MY_IMAGE_RESOURCE_DIRECTORY_ENTRY);
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
307 }
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
308 qDirs.pop();
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
309 @@ -721,7 +711,7 @@ void CResourceEditor::WriteRsrcSec(BYTE* pbRsrcSec) {
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
310 rDataE.Size = ConvertEndianness(cRDataE->GetSize());
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
311
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
312 CopyMemory(seeker, &rDataE, sizeof(IMAGE_RESOURCE_DATA_ENTRY));
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
313 - cRDataE->m_dwWrittenAt = DWORD(seeker);
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
314 + cRDataE->m_ulWrittenAt = (ULONG_PTR)(seeker);
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
315 seeker += sizeof(IMAGE_RESOURCE_DATA_ENTRY);
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
316
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
317 qDataEntries.pop();
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
318 @@ -733,7 +723,7 @@ void CResourceEditor::WriteRsrcSec(BYTE* pbRsrcSec) {
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
319 while (!qStrings.empty()) {
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
320 CResourceDirectoryEntry* cRDirE = qStrings.front();
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
321
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
322 - PMY_IMAGE_RESOURCE_DIRECTORY_ENTRY(cRDirE->m_dwWrittenAt)->UName.NameString.NameOffset = ConvertEndianness(DWORD(seeker) - DWORD(pbRsrcSec));
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
323 + PMY_IMAGE_RESOURCE_DIRECTORY_ENTRY(cRDirE->m_ulWrittenAt)->UName.NameString.NameOffset = ConvertEndianness((DWORD) (seeker - pbRsrcSec));
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
324
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
325 WCHAR* szName = cRDirE->GetName();
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
326 WORD iLen = winchar_strlen(szName) + 1;
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
327 @@ -754,7 +744,7 @@ void CResourceEditor::WriteRsrcSec(BYTE* pbRsrcSec) {
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
328 while (!qDataEntries2.empty()) {
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
329 CResourceDataEntry* cRDataE = qDataEntries2.front();
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
330 CopyMemory(seeker, cRDataE->GetData(), cRDataE->GetSize());
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
331 - PIMAGE_RESOURCE_DATA_ENTRY(cRDataE->m_dwWrittenAt)->OffsetToData = ConvertEndianness(seeker - pbRsrcSec + m_dwResourceSectionVA);
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
332 + PIMAGE_RESOURCE_DATA_ENTRY(cRDataE->m_ulWrittenAt)->OffsetToData = ConvertEndianness((DWORD)(seeker - pbRsrcSec) + m_dwResourceSectionVA);
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
333
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
334 seeker += RALIGN(cRDataE->GetSize(), 8);
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
335
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
336 @@ -764,21 +754,21 @@ void CResourceEditor::WriteRsrcSec(BYTE* pbRsrcSec) {
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
337 /*
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
338 * Set all of the directory entries offsets.
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
339 */
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
340 - SetOffsets(m_cResDir, DWORD(pbRsrcSec));
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
341 + SetOffsets(m_cResDir, (ULONG_PTR)(pbRsrcSec));
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
342 }
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
343
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
344 // Sets the offsets in directory entries
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
345 -void CResourceEditor::SetOffsets(CResourceDirectory* resDir, DWORD newResDirAt) {
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
346 +void CResourceEditor::SetOffsets(CResourceDirectory* resDir, ULONG_PTR newResDirAt) {
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
347 for (int i = 0; i < resDir->CountEntries(); i++) {
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
348 - PMY_IMAGE_RESOURCE_DIRECTORY_ENTRY rde = PMY_IMAGE_RESOURCE_DIRECTORY_ENTRY(resDir->GetEntry(i)->m_dwWrittenAt);
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
349 + PMY_IMAGE_RESOURCE_DIRECTORY_ENTRY rde = PMY_IMAGE_RESOURCE_DIRECTORY_ENTRY(resDir->GetEntry(i)->m_ulWrittenAt);
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
350 if (resDir->GetEntry(i)->IsDataDirectory()) {
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
351 rde->UOffset.DirectoryOffset.DataIsDirectory = 1;
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
352 - rde->UOffset.DirectoryOffset.OffsetToDirectory = resDir->GetEntry(i)->GetSubDirectory()->m_dwWrittenAt - newResDirAt;
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
353 + rde->UOffset.DirectoryOffset.OffsetToDirectory = resDir->GetEntry(i)->GetSubDirectory()->m_ulWrittenAt - newResDirAt;
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
354 rde->UOffset.OffsetToData = ConvertEndianness(rde->UOffset.OffsetToData);
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
355 SetOffsets(resDir->GetEntry(i)->GetSubDirectory(), newResDirAt);
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
356 }
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
357 else {
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
358 - rde->UOffset.OffsetToData = ConvertEndianness(resDir->GetEntry(i)->GetDataEntry()->m_dwWrittenAt - newResDirAt);
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
359 + rde->UOffset.OffsetToData = ConvertEndianness((DWORD)(resDir->GetEntry(i)->GetDataEntry()->m_ulWrittenAt - newResDirAt));
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
360 }
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
361 }
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
362 }
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
363 @@ -887,7 +877,7 @@ int CResourceDirectory::CountEntries() {
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
364 // Returns -1 if can not be found
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
365 int CResourceDirectory::Find(WCHAR* szName) {
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
366 if (IS_INTRESOURCE(szName))
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
367 - return Find((WORD) (DWORD) szName);
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
368 + return Find((WORD) (ULONG_PTR) szName);
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
369 else
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
370 if (szName[0] == '#')
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
371 return Find(WORD(winchar_stoi(szName + 1)));
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
372 @@ -965,7 +955,7 @@ CResourceDirectoryEntry::CResourceDirectoryEntry(WCHAR* szName, CResourceDirecto
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
373 if (IS_INTRESOURCE(szName)) {
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
374 m_bHasName = false;
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
375 m_szName = 0;
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
376 - m_wId = (WORD) (DWORD) szName;
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
377 + m_wId = (WORD) (ULONG_PTR) szName;
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
378 }
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
379 else {
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
380 m_bHasName = true;
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
381 @@ -979,7 +969,7 @@ CResourceDirectoryEntry::CResourceDirectoryEntry(WCHAR* szName, CResourceDataEnt
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
382 if (IS_INTRESOURCE(szName)) {
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
383 m_bHasName = false;
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
384 m_szName = 0;
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
385 - m_wId = (WORD) (DWORD) szName;
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
386 + m_wId = (WORD) (ULONG_PTR) szName;
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
387 }
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
388 else {
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
389 m_bHasName = true;
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
390 diff --git a/Source/ResourceEditor.h b/Source/ResourceEditor.h
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
391 index 59def2e..d25be31 100755
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
392 --- a/Source/ResourceEditor.h
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
393 +++ b/Source/ResourceEditor.h
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
394 @@ -27,7 +27,7 @@
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
395
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
396 #include "Platform.h"
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
397 #ifdef _WIN32
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
398 -# include <WinNT.h>
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
399 +# include <winnt.h>
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
400 #else
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
401 // all definitions for non Win32 platforms were taken from MinGW's free Win32 library
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
402 # define IMAGE_DIRECTORY_ENTRY_RESOURCE 2
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
403 @@ -156,7 +156,7 @@ private:
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
404 CResourceDirectory* ScanDirectory(PRESOURCE_DIRECTORY rdRoot, PRESOURCE_DIRECTORY rdToScan);
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
405
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
406 void WriteRsrcSec(BYTE* pbRsrcSec);
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
407 - void SetOffsets(CResourceDirectory* resDir, DWORD newResDirAt);
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
408 + void SetOffsets(CResourceDirectory* resDir, ULONG_PTR newResDirAt);
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
409
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
410 DWORD AdjustVA(DWORD dwVirtualAddress, DWORD dwAdjustment);
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
411 DWORD AlignVA(DWORD dwVirtualAddress);
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
412 @@ -180,7 +180,7 @@ public:
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
413
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
414 void Destroy();
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
415
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
416 - DWORD m_dwWrittenAt;
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
417 + ULONG_PTR m_ulWrittenAt;
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
418
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
419 private:
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
420 IMAGE_RESOURCE_DIRECTORY m_rdDir;
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
421 @@ -204,7 +204,7 @@ public:
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
422
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
423 CResourceDataEntry* GetDataEntry();
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
424
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
425 - DWORD m_dwWrittenAt;
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
426 + ULONG_PTR m_ulWrittenAt;
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
427
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
428 private:
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
429 bool m_bHasName;
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
430 @@ -232,7 +232,7 @@ public:
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
431 DWORD GetCodePage();
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
432 DWORD GetOffset();
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
433
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
434 - DWORD m_dwWrittenAt;
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
435 + ULONG_PTR m_ulWrittenAt;
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
436
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
437 private:
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
438 BYTE* m_pbData;
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
439 diff --git a/Source/ResourceVersionInfo.cpp b/Source/ResourceVersionInfo.cpp
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
440 index 71df19e..7ed0ccf 100755
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
441 --- a/Source/ResourceVersionInfo.cpp
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
442 +++ b/Source/ResourceVersionInfo.cpp
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
443 @@ -146,7 +146,7 @@ int GetVersionHeader (LPSTR &p, WORD &wLength, WORD &wValueLength, WORD &wType)
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
444 p += sizeof(WORD);
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
445 szKey = (WCHAR*)p;
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
446 p += (winchar_strlen(szKey) + 1) * sizeof (WCHAR);
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
447 - while ( ((long)p % 4) != 0 )
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
448 + while ( ((ULONG_PTR)p % 4) != 0 )
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
449 p++;
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
450 return p - baseP;
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
451 }
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
452 diff --git a/Source/fileform.cpp b/Source/fileform.cpp
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
453 index 72296ba..e879ad5 100755
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
454 --- a/Source/fileform.cpp
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
455 +++ b/Source/fileform.cpp
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
456 @@ -149,7 +149,7 @@ void ctlcolors_writer::write(const ctlcolors *data)
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
457 m_sink->write_int(data->text);
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
458 m_sink->write_int(data->bkc);
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
459 m_sink->write_int(data->lbStyle);
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
460 - m_sink->write_int((int) data->bkb);
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
461 + m_sink->write_int((INT_PTR) data->bkb);
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
462 m_sink->write_int(data->bkmode);
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
463 m_sink->write_int(data->flags);
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
464 }
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
465 diff --git a/Source/mmap.cpp b/Source/mmap.cpp
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
466 index 1e0be7a..562a7ed 100755
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
467 --- a/Source/mmap.cpp
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
468 +++ b/Source/mmap.cpp
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
469 @@ -322,7 +322,7 @@ void MMapFile::release(void *pView, int size)
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
470 if (!pView)
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
471 return;
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
472
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
473 - unsigned int alignment = ((unsigned int)pView) % m_iAllocationGranularity;
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
474 + unsigned int alignment = ((ULONG_PTR)pView) % m_iAllocationGranularity;
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
475 pView = (char *)pView - alignment;
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
476 size += alignment;
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
477 #ifdef _WIN32
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
478 diff --git a/Source/script.cpp b/Source/script.cpp
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
479 index a492051..2951d98 100755
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
480 --- a/Source/script.cpp
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
481 +++ b/Source/script.cpp
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
482 @@ -2129,7 +2129,7 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
483 int k=line.gettoken_enum(1,rootkeys[0]);
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
484 if (k == -1) k=line.gettoken_enum(1,rootkeys[1]);
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
485 if (k == -1) PRINTHELP()
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
486 - build_header.install_reg_rootkey=(int)rootkey_tab[k];
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
487 + build_header.install_reg_rootkey=(INT_PTR)rootkey_tab[k];
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
488 if (!build_header.install_reg_rootkey) PRINTHELP() // SHCTX is invalid here
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
489 build_header.install_reg_key_ptr = add_string(line.gettoken_str(2),0);
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
490 if (line.gettoken_str(2)[0] == '\\')
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
491 @@ -5184,7 +5184,7 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
492 int k=line.gettoken_enum(2,rootkeys[0]);
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
493 if (k == -1) k=line.gettoken_enum(2,rootkeys[1]);
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
494 if (ent.offsets[0] == -1 || k == -1) PRINTHELP()
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
495 - ent.offsets[1]=(int)rootkey_tab[k];
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
496 + ent.offsets[1]=(INT_PTR)rootkey_tab[k];
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
497 ent.offsets[2]=add_string(line.gettoken_str(3));
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
498 ent.offsets[3]=add_string(line.gettoken_str(4));
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
499 if (which_token == TOK_READREGDWORD) ent.offsets[4]=1;
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
500 @@ -5216,7 +5216,7 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
501 if (k == -1) k=line.gettoken_enum(a,rootkeys[1]);
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
502 if (k == -1) PRINTHELP()
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
503 ent.which=EW_DELREG;
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
504 - ent.offsets[1]=(int)rootkey_tab[k];
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
505 + ent.offsets[1]=(INT_PTR)rootkey_tab[k];
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
506 ent.offsets[2]=add_string(line.gettoken_str(a+1));
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
507 ent.offsets[3]=(which_token==TOK_DELETEREGKEY)?0:add_string(line.gettoken_str(a+2));
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
508 if (line.gettoken_str(a+1)[0] == '\\')
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
509 @@ -5236,7 +5236,7 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
510 if (k == -1) k=line.gettoken_enum(1,rootkeys[1]);
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
511 if (k == -1) PRINTHELP()
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
512 ent.which=EW_WRITEREG;
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
513 - ent.offsets[0]=(int)rootkey_tab[k];
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
514 + ent.offsets[0]=(INT_PTR)rootkey_tab[k];
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
515 ent.offsets[1]=add_string(line.gettoken_str(2));
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
516 if (line.gettoken_str(2)[0] == '\\')
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
517 warning_fl("%s: registry path name begins with \'\\\', may cause problems",line.gettoken_str(0));
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
518 @@ -5305,7 +5305,7 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
519 int k=line.gettoken_enum(2,rootkeys[0]);
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
520 if (k == -1) k=line.gettoken_enum(2,rootkeys[1]);
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
521 if (ent.offsets[0] == -1 || k == -1) PRINTHELP()
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
522 - ent.offsets[1]=(int)rootkey_tab[k];
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
523 + ent.offsets[1]=(INT_PTR)rootkey_tab[k];
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
524 ent.offsets[2]=add_string(line.gettoken_str(3));
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
525 ent.offsets[3]=add_string(line.gettoken_str(4));
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
526 ent.offsets[4]=which_token == TOK_ENUMREGKEY;
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
527 diff --git a/Source/util.cpp b/Source/util.cpp
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
528 index 2c0b07f..18c31a2 100755
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
529 --- a/Source/util.cpp
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
530 +++ b/Source/util.cpp
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
531 @@ -77,9 +77,9 @@ int update_bitmap(CResourceEditor* re, WORD id, const char* filename, int width/
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
532 }
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
533
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
534 if (width != 0) {
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
535 - LONG biWidth;
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
536 + INT32 biWidth;
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
537 fseek(f, 18, SEEK_SET); // Seek to the width member of the header
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
538 - fread(&biWidth, sizeof(LONG), 1, f);
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
539 + fread(&biWidth, sizeof(INT32), 1, f);
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
540 FIX_ENDIAN_INT32_INPLACE(biWidth);
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
541 if (width != biWidth) {
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
542 fclose(f);
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
543 @@ -88,9 +88,9 @@ int update_bitmap(CResourceEditor* re, WORD id, const char* filename, int width/
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
544 }
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
545
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
546 if (height != 0) {
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
547 - LONG biHeight;
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
548 + INT32 biHeight;
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
549 fseek(f, 22, SEEK_SET); // Seek to the height member of the header
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
550 - fread(&biHeight, sizeof(LONG), 1, f);
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
551 + fread(&biHeight, sizeof(INT32), 1, f);
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
552 FIX_ENDIAN_INT32_INPLACE(biHeight);
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
553 // Bitmap height can be negative too...
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
554 if (height != abs(biHeight)) {
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
555 @@ -689,8 +689,8 @@ static BOOL GetVxdVersion( LPCSTR szFile, LPDWORD lpdwLen, LPVOID lpData )
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
556 }
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
557
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
558 // Find the beginning of the NT header at offset e_lfanew.
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
559 - pNtExeHdr = (PIMAGE_NT_HEADERS) ( (DWORD) pView
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
560 - + (DWORD) pDosExeHdr->e_lfanew );
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
561 + pNtExeHdr = (PIMAGE_NT_HEADERS) ( (ULONG_PTR) pView
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
562 + + pDosExeHdr->e_lfanew );
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
563
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
564 // Check to make sure the file is a VxD.
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
565 if ( (DWORD) pNtExeHdr->Signature != IMAGE_VXD_SIGNATURE )
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
566 @@ -728,8 +728,8 @@ static BOOL GetVxdVersion( LPCSTR szFile, LPDWORD lpdwLen, LPVOID lpData )
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
567 }
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
568
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
569 // e32_winresoff contains the offset of the resource in the VxD.
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
570 - pVerRes = (VXD_VERSION_RESOURCE *) ( (DWORD) pView
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
571 - + (DWORD) pLEHdr->e32_winresoff );
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
572 + pVerRes = (VXD_VERSION_RESOURCE *) ( (ULONG_PTR) pView
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
573 + + pLEHdr->e32_winresoff );
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
574 dwSize = pVerRes->dwResSize;
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
575 pRawRes = &(pVerRes->bVerData);
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
576
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
577 @@ -780,7 +780,7 @@ static DWORD GetVxdVersionInfoSize( LPCSTR szFile )
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
578
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
579 // GetVxdVersion() will fail with ERROR_INSUFFICIENT_BUFFER and
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
580 // the required buffer size will be returned in dwResult.
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
581 - if ( GetLastError() == ERROR_INSUFFICIENT_BUFFER )
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
582 + if ( dwError == ERROR_INSUFFICIENT_BUFFER )
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
583 {
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
584 SetLastError( 0 );
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
585 return dwResult;
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
586 --
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
587 1.8.2.1
a1d474da2036 Update nsis to mxe devel branch 22-May 2013.
John Donoghue <john.donoghue@ieee.org>
parents: 2687
diff changeset
588
3526
60cd6f076a3d allow nsis to compile with 32-bit mingw-w64
John W. Eaton <jwe@octave.org>
parents: 2994
diff changeset
589 diff -ur a/Contrib/InstallOptions/InstallerOptions.cpp b/Contrib/InstallOptions/InstallerOptions.cpp
60cd6f076a3d allow nsis to compile with 32-bit mingw-w64
John W. Eaton <jwe@octave.org>
parents: 2994
diff changeset
590 --- a/Contrib/InstallOptions/InstallerOptions.cpp 2009-02-04 09:08:31.000000000 -0500
60cd6f076a3d allow nsis to compile with 32-bit mingw-w64
John W. Eaton <jwe@octave.org>
parents: 2994
diff changeset
591 +++ b/Contrib/InstallOptions/InstallerOptions.cpp 2014-02-14 18:14:18.638628714 -0500
60cd6f076a3d allow nsis to compile with 32-bit mingw-w64
John W. Eaton <jwe@octave.org>
parents: 2994
diff changeset
592 @@ -33,6 +33,7 @@
60cd6f076a3d allow nsis to compile with 32-bit mingw-w64
John W. Eaton <jwe@octave.org>
parents: 2994
diff changeset
593 #define strdup(x) STRDUP(x)
60cd6f076a3d allow nsis to compile with 32-bit mingw-w64
John W. Eaton <jwe@octave.org>
parents: 2994
diff changeset
594 #define stricmp(x,y) lstrcmpi(x,y)
60cd6f076a3d allow nsis to compile with 32-bit mingw-w64
John W. Eaton <jwe@octave.org>
parents: 2994
diff changeset
595 //#define abs(x) ((x) < 0 ? -(x) : (x))
60cd6f076a3d allow nsis to compile with 32-bit mingw-w64
John W. Eaton <jwe@octave.org>
parents: 2994
diff changeset
596 +#define min(x,y) ((x) < (y) ? (x) : (y))
60cd6f076a3d allow nsis to compile with 32-bit mingw-w64
John W. Eaton <jwe@octave.org>
parents: 2994
diff changeset
597
60cd6f076a3d allow nsis to compile with 32-bit mingw-w64
John W. Eaton <jwe@octave.org>
parents: 2994
diff changeset
598 char *WINAPI STRDUP(const char *c)
60cd6f076a3d allow nsis to compile with 32-bit mingw-w64
John W. Eaton <jwe@octave.org>
parents: 2994
diff changeset
599 {