Fossil SCM

Experimental version for Win9x, using unicows

jan.nijtmans 2012-09-14 10:31 UTC restore-win95
Commit bf0fede2ee9962585d5e574f49de5a9aee2fd094
+12 -4
--- src/main.c
+++ src/main.c
@@ -197,10 +197,13 @@
197197
const char *azAuxVal[MX_AUX]; /* Value of each aux() or option() value */
198198
const char **azAuxOpt[MX_AUX]; /* Options of each option() value */
199199
int anAuxCols[MX_AUX]; /* Number of columns for option() values */
200200
201201
int allowSymlinks; /* Cached "allow-symlinks" option */
202
+#ifdef _WIN32
203
+ int isNT;
204
+#endif
202205
203206
#ifdef FOSSIL_ENABLE_JSON
204207
struct FossilJsonBits {
205208
int isJsonMode; /* True if running in JSON mode, else
206209
false. This changes how errors are
@@ -553,13 +556,21 @@
553556
int main(int argc, char **argv)
554557
{
555558
const char *zCmdName = "unknown";
556559
int idx;
557560
int rc;
561
+#ifdef _WIN32
562
+ OSVERSIONINFOA sInfo;
563
+#endif
558564
559565
sqlite3_config(SQLITE_CONFIG_LOG, fossil_sqlite_log, 0);
560566
memset(&g, 0, sizeof(g));
567
+#ifdef _WIN32
568
+ sInfo.dwOSVersionInfoSize = sizeof(sInfo);
569
+ GetVersionExA(&sInfo);
570
+ g.isNT = sInfo.dwPlatformId==VER_PLATFORM_WIN32_NT;
571
+#endif
561572
g.now = time(0);
562573
#ifdef FOSSIL_ENABLE_JSON
563574
#if defined(NDEBUG)
564575
g.json.errorDetailParanoia = 2 /* FIXME: make configurable
565576
One problem we have here is that this
@@ -830,17 +841,14 @@
830841
int rc;
831842
#if defined(_WIN32)
832843
/* On windows NT, we have to put double-quotes around the entire command.
833844
** Who knows why - this is just the way windows works.
834845
*/
835
- OSVERSIONINFOA sInfo;
836846
char *zNewCmd;
837847
TCHAR *zMbcs;
838848
839
- sInfo.dwOSVersionInfoSize = sizeof(sInfo);
840
- GetVersionExA(&sInfo);
841
- if (sInfo.dwPlatformId==VER_PLATFORM_WIN32_NT) {
849
+ if (g.isNT) {
842850
zNewCmd = mprintf("\"%s\"", zOrigCmd);
843851
} else {
844852
zNewCmd = mprintf("%s", zOrigCmd);
845853
}
846854
zMbcs = fossil_utf8_to_mbcs(zNewCmd);
847855
--- src/main.c
+++ src/main.c
@@ -197,10 +197,13 @@
197 const char *azAuxVal[MX_AUX]; /* Value of each aux() or option() value */
198 const char **azAuxOpt[MX_AUX]; /* Options of each option() value */
199 int anAuxCols[MX_AUX]; /* Number of columns for option() values */
200
201 int allowSymlinks; /* Cached "allow-symlinks" option */
 
 
 
202
203 #ifdef FOSSIL_ENABLE_JSON
204 struct FossilJsonBits {
205 int isJsonMode; /* True if running in JSON mode, else
206 false. This changes how errors are
@@ -553,13 +556,21 @@
553 int main(int argc, char **argv)
554 {
555 const char *zCmdName = "unknown";
556 int idx;
557 int rc;
 
 
 
558
559 sqlite3_config(SQLITE_CONFIG_LOG, fossil_sqlite_log, 0);
560 memset(&g, 0, sizeof(g));
 
 
 
 
 
561 g.now = time(0);
562 #ifdef FOSSIL_ENABLE_JSON
563 #if defined(NDEBUG)
564 g.json.errorDetailParanoia = 2 /* FIXME: make configurable
565 One problem we have here is that this
@@ -830,17 +841,14 @@
830 int rc;
831 #if defined(_WIN32)
832 /* On windows NT, we have to put double-quotes around the entire command.
833 ** Who knows why - this is just the way windows works.
834 */
835 OSVERSIONINFOA sInfo;
836 char *zNewCmd;
837 TCHAR *zMbcs;
838
839 sInfo.dwOSVersionInfoSize = sizeof(sInfo);
840 GetVersionExA(&sInfo);
841 if (sInfo.dwPlatformId==VER_PLATFORM_WIN32_NT) {
842 zNewCmd = mprintf("\"%s\"", zOrigCmd);
843 } else {
844 zNewCmd = mprintf("%s", zOrigCmd);
845 }
846 zMbcs = fossil_utf8_to_mbcs(zNewCmd);
847
--- src/main.c
+++ src/main.c
@@ -197,10 +197,13 @@
197 const char *azAuxVal[MX_AUX]; /* Value of each aux() or option() value */
198 const char **azAuxOpt[MX_AUX]; /* Options of each option() value */
199 int anAuxCols[MX_AUX]; /* Number of columns for option() values */
200
201 int allowSymlinks; /* Cached "allow-symlinks" option */
202 #ifdef _WIN32
203 int isNT;
204 #endif
205
206 #ifdef FOSSIL_ENABLE_JSON
207 struct FossilJsonBits {
208 int isJsonMode; /* True if running in JSON mode, else
209 false. This changes how errors are
@@ -553,13 +556,21 @@
556 int main(int argc, char **argv)
557 {
558 const char *zCmdName = "unknown";
559 int idx;
560 int rc;
561 #ifdef _WIN32
562 OSVERSIONINFOA sInfo;
563 #endif
564
565 sqlite3_config(SQLITE_CONFIG_LOG, fossil_sqlite_log, 0);
566 memset(&g, 0, sizeof(g));
567 #ifdef _WIN32
568 sInfo.dwOSVersionInfoSize = sizeof(sInfo);
569 GetVersionExA(&sInfo);
570 g.isNT = sInfo.dwPlatformId==VER_PLATFORM_WIN32_NT;
571 #endif
572 g.now = time(0);
573 #ifdef FOSSIL_ENABLE_JSON
574 #if defined(NDEBUG)
575 g.json.errorDetailParanoia = 2 /* FIXME: make configurable
576 One problem we have here is that this
@@ -830,17 +841,14 @@
841 int rc;
842 #if defined(_WIN32)
843 /* On windows NT, we have to put double-quotes around the entire command.
844 ** Who knows why - this is just the way windows works.
845 */
 
846 char *zNewCmd;
847 TCHAR *zMbcs;
848
849 if (g.isNT) {
 
 
850 zNewCmd = mprintf("\"%s\"", zOrigCmd);
851 } else {
852 zNewCmd = mprintf("%s", zOrigCmd);
853 }
854 zMbcs = fossil_utf8_to_mbcs(zNewCmd);
855
--- src/makemake.tcl
+++ src/makemake.tcl
@@ -477,11 +477,11 @@
477477
endif
478478
479479
#### We add the -static option here so that we can build a static
480480
# executable that will run in a chroot jail.
481481
#
482
-LIB = -static
482
+LIB = -lunicows -static
483483
484484
# OpenSSL: Add the necessary libraries required, if enabled.
485485
ifdef FOSSIL_ENABLE_SSL
486486
LIB += -lssl -lcrypto -lgdi32
487487
endif
@@ -904,11 +904,11 @@
904904
INCL = -I. -I$(SRCDIR) -I$B\win\include -I$(MSCDIR)\extra\include -I$(ZINCDIR)
905905
906906
CFLAGS = -nologo -MT -O2
907907
BCC = $(CC) $(CFLAGS)
908908
TCC = $(CC) -c $(CFLAGS) -DUNICODE -D_UNICODE $(MSCDEF) $(SSL) $(INCL)
909
-LIBS = $(ZLIB) ws2_32.lib advapi32.lib $(SSLLIB)
909
+LIBS = unicows.lib $(ZLIB) ws2_32.lib advapi32.lib $(SSLLIB)
910910
LIBDIR = -LIBPATH:$(MSCDIR)\extra\lib -LIBPATH:$(ZLIBDIR)
911911
}
912912
regsub -all {[-]D} $SQLITE_OPTIONS {/D} MSC_SQLITE_OPTIONS
913913
writeln "SQLITE_OPTIONS = $MSC_SQLITE_OPTIONS\n"
914914
writeln -nonewline "SRC = "
915915
--- src/makemake.tcl
+++ src/makemake.tcl
@@ -477,11 +477,11 @@
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 # OpenSSL: Add the necessary libraries required, if enabled.
485 ifdef FOSSIL_ENABLE_SSL
486 LIB += -lssl -lcrypto -lgdi32
487 endif
@@ -904,11 +904,11 @@
904 INCL = -I. -I$(SRCDIR) -I$B\win\include -I$(MSCDIR)\extra\include -I$(ZINCDIR)
905
906 CFLAGS = -nologo -MT -O2
907 BCC = $(CC) $(CFLAGS)
908 TCC = $(CC) -c $(CFLAGS) -DUNICODE -D_UNICODE $(MSCDEF) $(SSL) $(INCL)
909 LIBS = $(ZLIB) ws2_32.lib advapi32.lib $(SSLLIB)
910 LIBDIR = -LIBPATH:$(MSCDIR)\extra\lib -LIBPATH:$(ZLIBDIR)
911 }
912 regsub -all {[-]D} $SQLITE_OPTIONS {/D} MSC_SQLITE_OPTIONS
913 writeln "SQLITE_OPTIONS = $MSC_SQLITE_OPTIONS\n"
914 writeln -nonewline "SRC = "
915
--- src/makemake.tcl
+++ src/makemake.tcl
@@ -477,11 +477,11 @@
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 = -lunicows -static
483
484 # OpenSSL: Add the necessary libraries required, if enabled.
485 ifdef FOSSIL_ENABLE_SSL
486 LIB += -lssl -lcrypto -lgdi32
487 endif
@@ -904,11 +904,11 @@
904 INCL = -I. -I$(SRCDIR) -I$B\win\include -I$(MSCDIR)\extra\include -I$(ZINCDIR)
905
906 CFLAGS = -nologo -MT -O2
907 BCC = $(CC) $(CFLAGS)
908 TCC = $(CC) -c $(CFLAGS) -DUNICODE -D_UNICODE $(MSCDEF) $(SSL) $(INCL)
909 LIBS = unicows.lib $(ZLIB) ws2_32.lib advapi32.lib $(SSLLIB)
910 LIBDIR = -LIBPATH:$(MSCDIR)\extra\lib -LIBPATH:$(ZLIBDIR)
911 }
912 regsub -all {[-]D} $SQLITE_OPTIONS {/D} MSC_SQLITE_OPTIONS
913 writeln "SQLITE_OPTIONS = $MSC_SQLITE_OPTIONS\n"
914 writeln -nonewline "SRC = "
915
--- src/winhttp.c
+++ src/winhttp.c
@@ -556,10 +556,15 @@
556556
void cmd_win32_service(void){
557557
int n;
558558
const char *zMethod;
559559
const char *zSvcName = "Fossil-DSCM"; /* Default service name */
560560
561
+#ifdef _WIN32
562
+ if( !g.isNT ) {
563
+ fossil_fatal("%s command not support on Windows 9x", g.argv[1]);
564
+ }
565
+#endif
561566
if( g.argc<3 ){
562567
usage("create|delete|show|start|stop ...");
563568
}
564569
zMethod = g.argv[2];
565570
n = strlen(zMethod);
566571
--- src/winhttp.c
+++ src/winhttp.c
@@ -556,10 +556,15 @@
556 void cmd_win32_service(void){
557 int n;
558 const char *zMethod;
559 const char *zSvcName = "Fossil-DSCM"; /* Default service name */
560
 
 
 
 
 
561 if( g.argc<3 ){
562 usage("create|delete|show|start|stop ...");
563 }
564 zMethod = g.argv[2];
565 n = strlen(zMethod);
566
--- src/winhttp.c
+++ src/winhttp.c
@@ -556,10 +556,15 @@
556 void cmd_win32_service(void){
557 int n;
558 const char *zMethod;
559 const char *zSvcName = "Fossil-DSCM"; /* Default service name */
560
561 #ifdef _WIN32
562 if( !g.isNT ) {
563 fossil_fatal("%s command not support on Windows 9x", g.argv[1]);
564 }
565 #endif
566 if( g.argc<3 ){
567 usage("create|delete|show|start|stop ...");
568 }
569 zMethod = g.argv[2];
570 n = strlen(zMethod);
571
--- win/Makefile.mingw
+++ win/Makefile.mingw
@@ -149,11 +149,11 @@
149149
endif
150150
151151
#### We add the -static option here so that we can build a static
152152
# executable that will run in a chroot jail.
153153
#
154
-LIB = -static
154
+LIB = -lunicows -static
155155
156156
# OpenSSL: Add the necessary libraries required, if enabled.
157157
ifdef FOSSIL_ENABLE_SSL
158158
LIB += -lssl -lcrypto -lgdi32
159159
endif
160160
--- win/Makefile.mingw
+++ win/Makefile.mingw
@@ -149,11 +149,11 @@
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 # OpenSSL: Add the necessary libraries required, if enabled.
157 ifdef FOSSIL_ENABLE_SSL
158 LIB += -lssl -lcrypto -lgdi32
159 endif
160
--- win/Makefile.mingw
+++ win/Makefile.mingw
@@ -149,11 +149,11 @@
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 = -lunicows -static
155
156 # OpenSSL: Add the necessary libraries required, if enabled.
157 ifdef FOSSIL_ENABLE_SSL
158 LIB += -lssl -lcrypto -lgdi32
159 endif
160
--- win/Makefile.msc
+++ win/Makefile.msc
@@ -35,11 +35,11 @@
3535
INCL = -I. -I$(SRCDIR) -I$B\win\include -I$(MSCDIR)\extra\include -I$(ZINCDIR)
3636
3737
CFLAGS = -nologo -MT -O2
3838
BCC = $(CC) $(CFLAGS)
3939
TCC = $(CC) -c $(CFLAGS) -DUNICODE -D_UNICODE $(MSCDEF) $(SSL) $(INCL)
40
-LIBS = $(ZLIB) ws2_32.lib advapi32.lib $(SSLLIB)
40
+LIBS = unicows.lib $(ZLIB) ws2_32.lib advapi32.lib $(SSLLIB)
4141
LIBDIR = -LIBPATH:$(MSCDIR)\extra\lib -LIBPATH:$(ZLIBDIR)
4242
4343
SQLITE_OPTIONS = /DSQLITE_OMIT_LOAD_EXTENSION=1 /DSQLITE_THREADSAFE=0 /DSQLITE_DEFAULT_FILE_FORMAT=4 /DSQLITE_ENABLE_STAT3 /Dlocaltime=fossil_localtime /DSQLITE_ENABLE_LOCKING_STYLE=0
4444
4545
SRC = add_.c allrepo_.c attach_.c bag_.c bisect_.c blob_.c branch_.c browse_.c captcha_.c cgi_.c checkin_.c checkout_.c clearsign_.c clone_.c comformat_.c configure_.c content_.c db_.c delta_.c deltacmd_.c descendants_.c diff_.c diffcmd_.c doc_.c encode_.c event_.c export_.c file_.c finfo_.c glob_.c graph_.c gzip_.c http_.c http_socket_.c http_ssl_.c http_transport_.c import_.c info_.c json_.c json_artifact_.c json_branch_.c json_config_.c json_diff_.c json_dir_.c json_finfo_.c json_login_.c json_query_.c json_report_.c json_tag_.c json_timeline_.c json_user_.c json_wiki_.c leaf_.c login_.c main_.c manifest_.c md5_.c merge_.c merge3_.c name_.c path_.c pivot_.c popen_.c pqueue_.c printf_.c rebuild_.c report_.c rss_.c schema_.c search_.c setup_.c sha1_.c shun_.c skins_.c sqlcmd_.c stash_.c stat_.c style_.c sync_.c tag_.c tar_.c th_main_.c timeline_.c tkt_.c tktsetup_.c undo_.c update_.c url_.c user_.c verify_.c vfile_.c wiki_.c wikiformat_.c winhttp_.c wysiwyg_.c xfer_.c xfersetup_.c zip_.c
4646
--- win/Makefile.msc
+++ win/Makefile.msc
@@ -35,11 +35,11 @@
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) -DUNICODE -D_UNICODE $(MSCDEF) $(SSL) $(INCL)
40 LIBS = $(ZLIB) ws2_32.lib advapi32.lib $(SSLLIB)
41 LIBDIR = -LIBPATH:$(MSCDIR)\extra\lib -LIBPATH:$(ZLIBDIR)
42
43 SQLITE_OPTIONS = /DSQLITE_OMIT_LOAD_EXTENSION=1 /DSQLITE_THREADSAFE=0 /DSQLITE_DEFAULT_FILE_FORMAT=4 /DSQLITE_ENABLE_STAT3 /Dlocaltime=fossil_localtime /DSQLITE_ENABLE_LOCKING_STYLE=0
44
45 SRC = add_.c allrepo_.c attach_.c bag_.c bisect_.c blob_.c branch_.c browse_.c captcha_.c cgi_.c checkin_.c checkout_.c clearsign_.c clone_.c comformat_.c configure_.c content_.c db_.c delta_.c deltacmd_.c descendants_.c diff_.c diffcmd_.c doc_.c encode_.c event_.c export_.c file_.c finfo_.c glob_.c graph_.c gzip_.c http_.c http_socket_.c http_ssl_.c http_transport_.c import_.c info_.c json_.c json_artifact_.c json_branch_.c json_config_.c json_diff_.c json_dir_.c json_finfo_.c json_login_.c json_query_.c json_report_.c json_tag_.c json_timeline_.c json_user_.c json_wiki_.c leaf_.c login_.c main_.c manifest_.c md5_.c merge_.c merge3_.c name_.c path_.c pivot_.c popen_.c pqueue_.c printf_.c rebuild_.c report_.c rss_.c schema_.c search_.c setup_.c sha1_.c shun_.c skins_.c sqlcmd_.c stash_.c stat_.c style_.c sync_.c tag_.c tar_.c th_main_.c timeline_.c tkt_.c tktsetup_.c undo_.c update_.c url_.c user_.c verify_.c vfile_.c wiki_.c wikiformat_.c winhttp_.c wysiwyg_.c xfer_.c xfersetup_.c zip_.c
46
--- win/Makefile.msc
+++ win/Makefile.msc
@@ -35,11 +35,11 @@
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) -DUNICODE -D_UNICODE $(MSCDEF) $(SSL) $(INCL)
40 LIBS = unicows.lib $(ZLIB) ws2_32.lib advapi32.lib $(SSLLIB)
41 LIBDIR = -LIBPATH:$(MSCDIR)\extra\lib -LIBPATH:$(ZLIBDIR)
42
43 SQLITE_OPTIONS = /DSQLITE_OMIT_LOAD_EXTENSION=1 /DSQLITE_THREADSAFE=0 /DSQLITE_DEFAULT_FILE_FORMAT=4 /DSQLITE_ENABLE_STAT3 /Dlocaltime=fossil_localtime /DSQLITE_ENABLE_LOCKING_STYLE=0
44
45 SRC = add_.c allrepo_.c attach_.c bag_.c bisect_.c blob_.c branch_.c browse_.c captcha_.c cgi_.c checkin_.c checkout_.c clearsign_.c clone_.c comformat_.c configure_.c content_.c db_.c delta_.c deltacmd_.c descendants_.c diff_.c diffcmd_.c doc_.c encode_.c event_.c export_.c file_.c finfo_.c glob_.c graph_.c gzip_.c http_.c http_socket_.c http_ssl_.c http_transport_.c import_.c info_.c json_.c json_artifact_.c json_branch_.c json_config_.c json_diff_.c json_dir_.c json_finfo_.c json_login_.c json_query_.c json_report_.c json_tag_.c json_timeline_.c json_user_.c json_wiki_.c leaf_.c login_.c main_.c manifest_.c md5_.c merge_.c merge3_.c name_.c path_.c pivot_.c popen_.c pqueue_.c printf_.c rebuild_.c report_.c rss_.c schema_.c search_.c setup_.c sha1_.c shun_.c skins_.c sqlcmd_.c stash_.c stat_.c style_.c sync_.c tag_.c tar_.c th_main_.c timeline_.c tkt_.c tktsetup_.c undo_.c update_.c url_.c user_.c verify_.c vfile_.c wiki_.c wikiformat_.c winhttp_.c wysiwyg_.c xfer_.c xfersetup_.c zip_.c
46

Keyboard Shortcuts

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