Fossil SCM

enable unicode commandline for MinGW/MinGW-w64 as well <p> remove unused MINGW_BROKEN_MAINARGS

jan.nijtmans 2012-09-11 18:49 trunk
Commit 274d8a1dcd3b1eaae45e1665471c684708c24129
-4
--- src/main.c
+++ src/main.c
@@ -552,15 +552,11 @@
552552
}
553553
554554
/*
555555
** This procedure runs first.
556556
*/
557
-#if defined(_WIN32) && defined(UNICODE)
558
-int wmain(int argc, wchar_t **argv)
559
-#else
560557
int main(int argc, char **argv)
561
-#endif
562558
{
563559
const char *zCmdName = "unknown";
564560
int idx;
565561
int rc;
566562
567563
--- src/main.c
+++ src/main.c
@@ -552,15 +552,11 @@
552 }
553
554 /*
555 ** This procedure runs first.
556 */
557 #if defined(_WIN32) && defined(UNICODE)
558 int wmain(int argc, wchar_t **argv)
559 #else
560 int main(int argc, char **argv)
561 #endif
562 {
563 const char *zCmdName = "unknown";
564 int idx;
565 int rc;
566
567
--- src/main.c
+++ src/main.c
@@ -552,15 +552,11 @@
552 }
553
554 /*
555 ** This procedure runs first.
556 */
 
 
 
557 int main(int argc, char **argv)
 
558 {
559 const char *zCmdName = "unknown";
560 int idx;
561 int rc;
562
563
--- src/makemake.tcl
+++ src/makemake.tcl
@@ -432,11 +432,11 @@
432432
# will run on the target platform. This is usually the same
433433
# as BCC, unless you are cross-compiling. This C compiler builds
434434
# the finished binary for fossil. The BCC compiler above is used
435435
# for building intermediate code-generator tools.
436436
#
437
-TCC = $(PREFIX)gcc -Os -Wall -L$(ZLIBDIR) -I$(ZINCDIR)
437
+TCC = $(PREFIX)gcc -Os -Wall -DUNICODE -D_UNICODE -L$(ZLIBDIR) -I$(ZINCDIR)
438438
439439
#### Compile resources for use in building executables that will run
440440
# on the target platform.
441441
#
442442
RCC = $(PREFIX)windres -I$(SRCDIR) -I$(ZINCDIR)
@@ -474,15 +474,10 @@
474474
ifdef FOSSIL_ENABLE_JSON
475475
TCC += -DFOSSIL_ENABLE_JSON=1
476476
RCC += -DFOSSIL_ENABLE_JSON=1
477477
endif
478478
479
-# Fix buggy MinGW command line parsing
480
-ifdef MINGW_BROKEN_MAINARGS
481
-TCC += -DMINGW_BROKEN_MAINARGS
482
-endif
483
-
484479
#### We add the -static option here so that we can build a static
485480
# executable that will run in a chroot jail.
486481
#
487482
LIB = -static
488483
489484
--- src/makemake.tcl
+++ src/makemake.tcl
@@ -432,11 +432,11 @@
432 # will run on the target platform. This is usually the same
433 # as BCC, unless you are cross-compiling. This C compiler builds
434 # the finished binary for fossil. The BCC compiler above is used
435 # for building intermediate code-generator tools.
436 #
437 TCC = $(PREFIX)gcc -Os -Wall -L$(ZLIBDIR) -I$(ZINCDIR)
438
439 #### Compile resources for use in building executables that will run
440 # on the target platform.
441 #
442 RCC = $(PREFIX)windres -I$(SRCDIR) -I$(ZINCDIR)
@@ -474,15 +474,10 @@
474 ifdef FOSSIL_ENABLE_JSON
475 TCC += -DFOSSIL_ENABLE_JSON=1
476 RCC += -DFOSSIL_ENABLE_JSON=1
477 endif
478
479 # Fix buggy MinGW command line parsing
480 ifdef MINGW_BROKEN_MAINARGS
481 TCC += -DMINGW_BROKEN_MAINARGS
482 endif
483
484 #### We add the -static option here so that we can build a static
485 # executable that will run in a chroot jail.
486 #
487 LIB = -static
488
489
--- src/makemake.tcl
+++ src/makemake.tcl
@@ -432,11 +432,11 @@
432 # will run on the target platform. This is usually the same
433 # as BCC, unless you are cross-compiling. This C compiler builds
434 # the finished binary for fossil. The BCC compiler above is used
435 # for building intermediate code-generator tools.
436 #
437 TCC = $(PREFIX)gcc -Os -Wall -DUNICODE -D_UNICODE -L$(ZLIBDIR) -I$(ZINCDIR)
438
439 #### Compile resources for use in building executables that will run
440 # on the target platform.
441 #
442 RCC = $(PREFIX)windres -I$(SRCDIR) -I$(ZINCDIR)
@@ -474,15 +474,10 @@
474 ifdef FOSSIL_ENABLE_JSON
475 TCC += -DFOSSIL_ENABLE_JSON=1
476 RCC += -DFOSSIL_ENABLE_JSON=1
477 endif
478
 
 
 
 
 
479 #### We add the -static option here so that we can build a static
480 # executable that will run in a chroot jail.
481 #
482 LIB = -static
483
484
--- test/cmdline.test
+++ test/cmdline.test
@@ -1,7 +1,7 @@
11
#
2
-# Copyright (c) 2011 D. Richard Hipp
2
+# Copyright (c) 2012 D. Richard Hipp
33
#
44
# This program is free software; you can redistribute it and/or
55
# modify it under the terms of the Simplified BSD License (also
66
# known as the "2-Clause License" or "FreeBSD License".)
77
#
@@ -19,12 +19,12 @@
1919
#
2020
2121
proc cmd-line {testname args} {
2222
set i 1
2323
foreach {cmdline result} $args {
24
- fossil test-echo {*}$cmdline
24
+ fossil test-echo $cmdline
2525
test cmd-line-$testname.$i {[lrange [split $::RESULT \n] 2 end]=="\{argv\[2\] = \[$result\]\}"}
2626
incr i
2727
}
2828
}
29
-cmd-line 100 abc abc {"abc"} abc
30
-cmd-line 101 * {*} *.* {*.*}
29
+cmd-line 100 abc abc a\"bc a\"bc \"abc\" \"abc\"
30
+cmd-line 101 * * *.* *.*
3131
--- test/cmdline.test
+++ test/cmdline.test
@@ -1,7 +1,7 @@
1 #
2 # Copyright (c) 2011 D. Richard Hipp
3 #
4 # This program is free software; you can redistribute it and/or
5 # modify it under the terms of the Simplified BSD License (also
6 # known as the "2-Clause License" or "FreeBSD License".)
7 #
@@ -19,12 +19,12 @@
19 #
20
21 proc cmd-line {testname args} {
22 set i 1
23 foreach {cmdline result} $args {
24 fossil test-echo {*}$cmdline
25 test cmd-line-$testname.$i {[lrange [split $::RESULT \n] 2 end]=="\{argv\[2\] = \[$result\]\}"}
26 incr i
27 }
28 }
29 cmd-line 100 abc abc {"abc"} abc
30 cmd-line 101 * {*} *.* {*.*}
31
--- test/cmdline.test
+++ test/cmdline.test
@@ -1,7 +1,7 @@
1 #
2 # Copyright (c) 2012 D. Richard Hipp
3 #
4 # This program is free software; you can redistribute it and/or
5 # modify it under the terms of the Simplified BSD License (also
6 # known as the "2-Clause License" or "FreeBSD License".)
7 #
@@ -19,12 +19,12 @@
19 #
20
21 proc cmd-line {testname args} {
22 set i 1
23 foreach {cmdline result} $args {
24 fossil test-echo $cmdline
25 test cmd-line-$testname.$i {[lrange [split $::RESULT \n] 2 end]=="\{argv\[2\] = \[$result\]\}"}
26 incr i
27 }
28 }
29 cmd-line 100 abc abc a\"bc a\"bc \"abc\" \"abc\"
30 cmd-line 101 * * *.* *.*
31
--- win/Makefile.mingw
+++ win/Makefile.mingw
@@ -104,11 +104,11 @@
104104
# will run on the target platform. This is usually the same
105105
# as BCC, unless you are cross-compiling. This C compiler builds
106106
# the finished binary for fossil. The BCC compiler above is used
107107
# for building intermediate code-generator tools.
108108
#
109
-TCC = $(PREFIX)gcc -Os -Wall -L$(ZLIBDIR) -I$(ZINCDIR)
109
+TCC = $(PREFIX)gcc -Os -Wall -DUNICODE -D_UNICODE -L$(ZLIBDIR) -I$(ZINCDIR)
110110
111111
#### Compile resources for use in building executables that will run
112112
# on the target platform.
113113
#
114114
RCC = $(PREFIX)windres -I$(SRCDIR) -I$(ZINCDIR)
@@ -146,15 +146,10 @@
146146
ifdef FOSSIL_ENABLE_JSON
147147
TCC += -DFOSSIL_ENABLE_JSON=1
148148
RCC += -DFOSSIL_ENABLE_JSON=1
149149
endif
150150
151
-# Fix buggy MinGW command line parsing
152
-ifdef MINGW_BROKEN_MAINARGS
153
-TCC += -DMINGW_BROKEN_MAINARGS
154
-endif
155
-
156151
#### We add the -static option here so that we can build a static
157152
# executable that will run in a chroot jail.
158153
#
159154
LIB = -static
160155
161156
--- win/Makefile.mingw
+++ win/Makefile.mingw
@@ -104,11 +104,11 @@
104 # will run on the target platform. This is usually the same
105 # as BCC, unless you are cross-compiling. This C compiler builds
106 # the finished binary for fossil. The BCC compiler above is used
107 # for building intermediate code-generator tools.
108 #
109 TCC = $(PREFIX)gcc -Os -Wall -L$(ZLIBDIR) -I$(ZINCDIR)
110
111 #### Compile resources for use in building executables that will run
112 # on the target platform.
113 #
114 RCC = $(PREFIX)windres -I$(SRCDIR) -I$(ZINCDIR)
@@ -146,15 +146,10 @@
146 ifdef FOSSIL_ENABLE_JSON
147 TCC += -DFOSSIL_ENABLE_JSON=1
148 RCC += -DFOSSIL_ENABLE_JSON=1
149 endif
150
151 # Fix buggy MinGW command line parsing
152 ifdef MINGW_BROKEN_MAINARGS
153 TCC += -DMINGW_BROKEN_MAINARGS
154 endif
155
156 #### We add the -static option here so that we can build a static
157 # executable that will run in a chroot jail.
158 #
159 LIB = -static
160
161
--- win/Makefile.mingw
+++ win/Makefile.mingw
@@ -104,11 +104,11 @@
104 # will run on the target platform. This is usually the same
105 # as BCC, unless you are cross-compiling. This C compiler builds
106 # the finished binary for fossil. The BCC compiler above is used
107 # for building intermediate code-generator tools.
108 #
109 TCC = $(PREFIX)gcc -Os -Wall -DUNICODE -D_UNICODE -L$(ZLIBDIR) -I$(ZINCDIR)
110
111 #### Compile resources for use in building executables that will run
112 # on the target platform.
113 #
114 RCC = $(PREFIX)windres -I$(SRCDIR) -I$(ZINCDIR)
@@ -146,15 +146,10 @@
146 ifdef FOSSIL_ENABLE_JSON
147 TCC += -DFOSSIL_ENABLE_JSON=1
148 RCC += -DFOSSIL_ENABLE_JSON=1
149 endif
150
 
 
 
 
 
151 #### We add the -static option here so that we can build a static
152 # executable that will run in a chroot jail.
153 #
154 LIB = -static
155
156
--- win/Makefile.mingw.mistachkin
+++ win/Makefile.mingw.mistachkin
@@ -104,11 +104,11 @@
104104
# will run on the target platform. This is usually the same
105105
# as BCC, unless you are cross-compiling. This C compiler builds
106106
# the finished binary for fossil. The BCC compiler above is used
107107
# for building intermediate code-generator tools.
108108
#
109
-TCC = $(PREFIX)gcc -Os -Wall -L$(ZLIBDIR) -I$(ZINCDIR)
109
+TCC = $(PREFIX)gcc -Os -Wall -DUNICODE -D_UNICODE -L$(ZLIBDIR) -I$(ZINCDIR)
110110
111111
#### Compile resources for use in building executables that will run
112112
# on the target platform.
113113
#
114114
RCC = $(PREFIX)windres -I$(SRCDIR) -I$(ZINCDIR)
115115
--- win/Makefile.mingw.mistachkin
+++ win/Makefile.mingw.mistachkin
@@ -104,11 +104,11 @@
104 # will run on the target platform. This is usually the same
105 # as BCC, unless you are cross-compiling. This C compiler builds
106 # the finished binary for fossil. The BCC compiler above is used
107 # for building intermediate code-generator tools.
108 #
109 TCC = $(PREFIX)gcc -Os -Wall -L$(ZLIBDIR) -I$(ZINCDIR)
110
111 #### Compile resources for use in building executables that will run
112 # on the target platform.
113 #
114 RCC = $(PREFIX)windres -I$(SRCDIR) -I$(ZINCDIR)
115
--- win/Makefile.mingw.mistachkin
+++ win/Makefile.mingw.mistachkin
@@ -104,11 +104,11 @@
104 # will run on the target platform. This is usually the same
105 # as BCC, unless you are cross-compiling. This C compiler builds
106 # the finished binary for fossil. The BCC compiler above is used
107 # for building intermediate code-generator tools.
108 #
109 TCC = $(PREFIX)gcc -Os -Wall -DUNICODE -D_UNICODE -L$(ZLIBDIR) -I$(ZINCDIR)
110
111 #### Compile resources for use in building executables that will run
112 # on the target platform.
113 #
114 RCC = $(PREFIX)windres -I$(SRCDIR) -I$(ZINCDIR)
115
--- win/Makefile.msc
+++ win/Makefile.msc
@@ -32,11 +32,11 @@
3232
ZLIBDIR = $(MSCDIR)\extra\lib
3333
ZLIB = zlib.lib
3434
3535
INCL = -I. -I$(SRCDIR) -I$B\win\include -I$(MSCDIR)\extra\include -I$(ZINCDIR)
3636
37
-CFLAGS = -nologo -MT -O2 -DUNICODE -D_UNICODE
37
+CFLAGS = -nologo -MT -O2
3838
BCC = $(CC) $(CFLAGS)
3939
TCC = $(CC) -c $(CFLAGS) $(MSCDEF) $(SSL) $(INCL)
4040
LIBS = $(ZLIB) ws2_32.lib advapi32.lib $(SSLLIB)
4141
LIBDIR = -LIBPATH:$(MSCDIR)\extra\lib -LIBPATH:$(ZLIBDIR)
4242
4343
--- win/Makefile.msc
+++ win/Makefile.msc
@@ -32,11 +32,11 @@
32 ZLIBDIR = $(MSCDIR)\extra\lib
33 ZLIB = zlib.lib
34
35 INCL = -I. -I$(SRCDIR) -I$B\win\include -I$(MSCDIR)\extra\include -I$(ZINCDIR)
36
37 CFLAGS = -nologo -MT -O2 -DUNICODE -D_UNICODE
38 BCC = $(CC) $(CFLAGS)
39 TCC = $(CC) -c $(CFLAGS) $(MSCDEF) $(SSL) $(INCL)
40 LIBS = $(ZLIB) ws2_32.lib advapi32.lib $(SSLLIB)
41 LIBDIR = -LIBPATH:$(MSCDIR)\extra\lib -LIBPATH:$(ZLIBDIR)
42
43
--- win/Makefile.msc
+++ win/Makefile.msc
@@ -32,11 +32,11 @@
32 ZLIBDIR = $(MSCDIR)\extra\lib
33 ZLIB = zlib.lib
34
35 INCL = -I. -I$(SRCDIR) -I$B\win\include -I$(MSCDIR)\extra\include -I$(ZINCDIR)
36
37 CFLAGS = -nologo -MT -O2
38 BCC = $(CC) $(CFLAGS)
39 TCC = $(CC) -c $(CFLAGS) $(MSCDEF) $(SSL) $(INCL)
40 LIBS = $(ZLIB) ws2_32.lib advapi32.lib $(SSLLIB)
41 LIBDIR = -LIBPATH:$(MSCDIR)\extra\lib -LIBPATH:$(ZLIBDIR)
42
43

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button