Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:merge trunk

enable UNICODE mode (experimental)

Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | eclipse-project
Files: files | file ages | folders
SHA1:2017d2f83269bf49b08440f8b612cdc8b090b8e7
User & Date: jan.nijtmans 2012-09-06 09:10:34
Context
2012-09-25
06:40
allow Eclipse to be used as fossil development IDE, merged from "fossil-eclipse" branch, which is now closed. check-in: ae356a7b user: jan.nijtmans tags: trunk
2012-09-06
09:10
merge trunk

enable UNICODE mode (experimental)

Closed-Leaf check-in: 2017d2f8 user: jan.nijtmans tags: eclipse-project
2012-09-05
20:54
Do not count divider lines as "items" on the timeline. check-in: 49139643 user: drh tags: trunk
13:45
merge trunk, fix compilation on Cygwin/Linux check-in: c05ba6b0 user: jan.nijtmans tags: eclipse-project
Changes

Changes to src/checkin.c.

   699    699       const char *zOrig = db_column_text(&q, 2);
   700    700       int frid = db_column_int(&q, 3);
   701    701       int isExe = db_column_int(&q, 4);
   702    702       int isLink = db_column_int(&q, 5);
   703    703       int isSelected = db_column_int(&q, 6);
   704    704       const char *zPerm;
   705    705       int cmp;
          706  +
          707  +    blob_resize(&filename, nBasename);
          708  +    blob_append(&filename, zName, -1);
          709  +
   706    710   #if !defined(_WIN32)
   707         -    int mPerm;
   708         -
   709    711       /* For unix, extract the "executable" and "symlink" permissions
   710    712       ** directly from the filesystem.  On windows, permissions are
   711    713       ** unchanged from the original. 
   712    714       */
          715  +    {
          716  +      int mPerm;
   713    717   
   714         -    blob_resize(&filename, nBasename);
   715         -    blob_append(&filename, zName, -1);
   716         -
   717         -    mPerm = file_wd_perm(blob_str(&filename));
   718         -    isExe = ( mPerm==PERM_EXE );
   719         -    isLink = ( mPerm==PERM_LNK );
          718  +      mPerm = file_wd_perm(blob_str(&filename));
          719  +      isExe = ( mPerm==PERM_EXE );
          720  +      isLink = ( mPerm==PERM_LNK );
          721  +    }
   720    722   #endif
   721    723       if( isExe ){
   722    724         zPerm = " x";
   723    725       }else if( isLink ){
   724    726         zPerm = " l"; /* note: symlinks don't have executable bit on unix */
   725    727       }else{
   726    728         zPerm = "";

Changes to src/file.c.

  1123   1123   ** to a file, -1 is returned and nothing is written
  1124   1124   ** to the console.
  1125   1125   */
  1126   1126   int fossil_utf8_to_console(const char *zUtf8, int nByte, int toStdErr){
  1127   1127   #ifdef _WIN32
  1128   1128     int nChar;
  1129   1129     wchar_t *zUnicode; /* Unicode version of zUtf8 */
         1130  +#ifdef UNICODE
  1130   1131     DWORD dummy;
         1132  +#else
         1133  +  char *zConsole;    /* Console version of zUtf8 */
         1134  +  int codepage;      /* Console code page */
         1135  +#endif
  1131   1136   
  1132   1137     static int istty[2] = { -1, -1 };
  1133   1138     if( istty[toStdErr] == -1 ){
  1134   1139       istty[toStdErr] = _isatty(toStdErr + 1) != 0;
  1135   1140     }
  1136   1141     if( !istty[toStdErr] ){
  1137   1142       /* stdout/stderr is not a console. */
................................................................................
  1145   1150     }
  1146   1151     nChar = MultiByteToWideChar(CP_UTF8, 0, zUtf8, nByte, zUnicode, nChar);
  1147   1152     if( nChar==0 ){
  1148   1153       free(zUnicode);
  1149   1154       return 0;
  1150   1155     }
  1151   1156     zUnicode[nChar] = '\0';
         1157  +#ifdef UNICODE
  1152   1158     WriteConsoleW(GetStdHandle(STD_OUTPUT_HANDLE - toStdErr), zUnicode, nChar, &dummy, 0);
         1159  +#else /* !UNICODE */
         1160  +  codepage = GetConsoleCP();
         1161  +  nByte = WideCharToMultiByte(codepage, 0, zUnicode, nChar, 0, 0, 0, 0);
         1162  +  zConsole = malloc( nByte + 1);
         1163  +  if( zConsole==0 ){
         1164  +    free(zUnicode);
         1165  +    return 0;
         1166  +  }
         1167  +  nByte = WideCharToMultiByte(codepage, 0, zUnicode, nChar, zConsole, nByte, 0, 0);
         1168  +  zConsole[nByte] = '\0';
         1169  +  free(zUnicode);
         1170  +  if( nByte == 0 ){
         1171  +    free(zConsole);
         1172  +    zConsole = 0;
         1173  +    return 0;
         1174  +  }
         1175  +  fwrite(zConsole, 1, nByte, toStdErr ? stderr : stdout);
         1176  +  fflush(toStdErr ? stderr : stdout);
         1177  +#endif /* UNICODE */
  1153   1178     return nChar;
  1154   1179   #else
  1155   1180     return -1;  /* No-op on unix */
  1156   1181   #endif  
  1157   1182   }
  1158   1183   
  1159   1184   /*

Changes to src/finfo.c.

   216    216   ** Additional query parameters:
   217    217   **
   218    218   **    a=DATE     Only show changes after DATE
   219    219   **    b=DATE     Only show changes before DATE
   220    220   **    n=NUM      Show the first NUM changes only
   221    221   **    brbg       Background color by branch name
   222    222   **    ubg        Background color by user name
          223  +**    fco=BOOL   Show only first occurrence of each version if true (default)
   223    224   */
   224    225   void finfo_page(void){
   225    226     Stmt q;
   226    227     const char *zFilename;
   227    228     char zPrevDate[20];
   228    229     const char *zA;
   229    230     const char *zB;
................................................................................
   230    231     int n;
   231    232     Blob title;
   232    233     Blob sql;
   233    234     HQuery url;
   234    235     GraphContext *pGraph;
   235    236     int brBg = P("brbg")!=0;
   236    237     int uBg = P("ubg")!=0;
   237         -  int firstChngOnly = P("fco")!=0;
          238  +  int firstChngOnly = atoi(PD("fco","1"))!=0;
   238    239   
   239    240     login_check_credentials();
   240    241     if( !g.perm.Read ){ login_needed(); return; }
   241    242     style_header("File History");
   242    243     login_anonymous_available();
   243    244     url_initialize(&url, "finfo");
   244    245     if( brBg ) url_add_parameter(&url, "brbg", 0);
   245    246     if( uBg ) url_add_parameter(&url, "ubg", 0);
   246         -  if( firstChngOnly ) url_add_parameter(&url, "fco", 0);
          247  +  if( firstChngOnly ) url_add_parameter(&url, "fco", "0");
   247    248   
   248    249     zPrevDate[0] = 0;
   249    250     zFilename = PD("name","");
   250    251     url_add_parameter(&url, "name", zFilename);
   251    252     blob_zero(&sql);
   252    253     blob_appendf(&sql, 
   253    254       "SELECT"
................................................................................
   287    288     blob_appendf(&sql," ORDER BY event.mtime DESC /*sort*/");
   288    289     if( (n = atoi(PD("n","0")))>0 ){
   289    290       blob_appendf(&sql, " LIMIT %d", n);
   290    291       url_add_parameter(&url, "n", P("n"));
   291    292     }
   292    293     if( firstChngOnly ){
   293    294       style_submenu_element("Full", "Show all changes",
   294         -                          url_render(&url, "fco", 0, 0, 0));
          295  +                          url_render(&url, "fco", "0", 0, 0));
   295    296     }else{
   296    297       style_submenu_element("Simplified", "Show only first use of a change",
   297    298                             url_render(&url, "fco", "1", 0, 0));
   298    299     }
   299    300     db_prepare(&q, blob_str(&sql));
   300    301     blob_reset(&sql);
   301    302     blob_zero(&title);

Changes to src/info.c.

   477    477       const char *zUuid = db_column_text(&q, 0);
   478    478       char *zTitle = mprintf("Check-in [%.10s]", zUuid);
   479    479       char *zEUser, *zEComment;
   480    480       const char *zUser;
   481    481       const char *zComment;
   482    482       const char *zDate;
   483    483       const char *zOrigDate;
   484         -    const char *zBranch;
   485    484       style_header(zTitle);
   486    485       login_anonymous_available();
   487    486       free(zTitle);
   488    487       zEUser = db_text(0,
   489    488                      "SELECT value FROM tagxref WHERE tagid=%d AND rid=%d",
   490    489                       TAG_USER, rid);
   491    490       zEComment = db_text(0, 
   492    491                      "SELECT value FROM tagxref WHERE tagid=%d AND rid=%d",
   493    492                      TAG_COMMENT, rid);
   494         -    zBranch = db_text("trunk",
   495         -                   "SELECT value FROM tagxref WHERE tagid=%d AND rid=%d",
   496         -                   TAG_BRANCH, rid);
   497    493       zUser = db_column_text(&q, 2);
   498    494       zComment = db_column_text(&q, 3);
   499    495       zDate = db_column_text(&q,1);
   500    496       zOrigDate = db_column_text(&q, 4);
   501    497       @ <div class="section">Overview</div>
   502    498       @ <table class="label-value">
   503    499       @ <tr><th>SHA1&nbsp;Hash:</th><td>%s(zUuid)
................................................................................
   571    567           @ </td></tr>
   572    568           @ <tr><th>Downloads:</th><td>
   573    569           @ %z(href("%s",zUrl))Tarball</a>
   574    570           @ | %z(href("%R/zip/%s-%S.zip?uuid=%s",zProjName,zUuid,zUuid))
   575    571           @         ZIP archive</a>
   576    572           fossil_free(zUrl);
   577    573         }
   578         -#if 0
   579         -      if( isLeaf && fossil_strcmp(zBranch,"trunk")!=0 ){
   580         -        @ </td></tr>
   581         -        @ <tr><th>Diffs:</th><td>
   582         -        @ %z(href("%R/vdiff?branch=%t",zBranch))Changes in %h(zBranch)</a>
   583         -        @ | %z(href("%R/vdiff?from=trunk&to=%t",zBranch))Changes
   584         -        @         from trunk</a>
   585         -      }
   586         -#endif
   587    574         @ </td></tr>
   588    575         @ <tr><th>Other&nbsp;Links:</th>
   589    576         @   <td>
   590    577         @     %z(href("%R/dir?ci=%S",zUuid))files</a>
   591    578         @   | %z(href("%R/artifact/%S",zUuid))manifest</a>
   592    579         if( g.perm.Write ){
   593    580           @   | %z(href("%R/ci_edit?r=%S",zUuid))edit</a>

Changes to src/main.c.

   486    486       g.fSqlStats = find_option("sqlstats", 0, 0)!=0;
   487    487       g.fSystemTrace = find_option("systemtrace", 0, 0)!=0;
   488    488       if( g.fSqlTrace ) g.fSqlStats = 1;
   489    489       g.fSqlPrint = find_option("sqlprint", 0, 0)!=0;
   490    490       g.fHttpTrace = find_option("httptrace", 0, 0)!=0;
   491    491       g.zLogin = find_option("user", "U", 1);
   492    492       g.zSSLIdentity = find_option("ssl-identity", 0, 1);
          493  +    if( find_option("utc",0,0) ) g.fTimeFormat = 1;
          494  +    if( find_option("localtime",0,0) ) g.fTimeFormat = 2;
   493    495       if( zChdir && chdir(zChdir) ){
   494    496         fossil_fatal("unable to change directories to %s", zChdir);
   495    497       }
   496    498       if( find_option("help",0,0)!=0 ){
   497    499         /* --help anywhere on the command line is translated into
   498    500         ** "fossil help argv[1] argv[2]..." */
   499    501         int i;

Changes to src/makemake.tcl.

   332    332   # This is a makefile for use on Windows/Linux/Darwin/Cygwin using MinGW or
   333    333   # MinGW-w64.
   334    334   #
   335    335   
   336    336   #### Select one of MinGW, MinGW-64 (32-bit) or MinGW-w64 (64-bit) compilers.
   337    337   #    By default, this is an empty string (i.e. use the native compiler).
   338    338   #
   339         -PREFIX =
   340    339   # PREFIX = mingw32-
   341    340   # PREFIX = i686-pc-mingw32-
   342         -# PREFIX = i686-w64-mingw32-
          341  +PREFIX = i686-w64-mingw32-
   343    342   # PREFIX = x86_64-w64-mingw32-
   344    343   
   345    344   #### The toplevel directory of the source tree.  Fossil can be built
   346    345   #    in a directory that is separate from the source tree.  Just change
   347    346   #    the following to point from the build directory to the src/ folder.
   348    347   #
   349    348   SRCDIR = src
................................................................................
   423    422   
   424    423   #### C Compile and options for use in building executables that
   425    424   #    will run on the target platform.  This is usually the same
   426    425   #    as BCC, unless you are cross-compiling.  This C compiler builds
   427    426   #    the finished binary for fossil.  The BCC compiler above is used
   428    427   #    for building intermediate code-generator tools.
   429    428   #
   430         -TCC = $(PREFIX)gcc -Os -Wall -L$(ZLIBDIR) -I$(ZINCDIR)
          429  +TCC = $(PREFIX)gcc -Os -Wall -DUNICODE -D_UNICODE -L$(ZLIBDIR) -I$(ZINCDIR)
   431    430   
   432    431   #### Compile resources for use in building executables that will run
   433    432   #    on the target platform.
   434    433   #
   435    434   RCC = $(PREFIX)windres -I$(SRCDIR) -I$(ZINCDIR)
   436    435   
   437    436   # With HTTPS support
................................................................................
   494    493   #    or linking with it will not work (exact reason unknown).
   495    494   #
   496    495   ifdef FOSSIL_ENABLE_TCL
   497    496   LIB += -lnetapi32 -lkernel32 -luser32 -ladvapi32 -lws2_32
   498    497   else
   499    498   LIB += -lkernel32 -lws2_32
   500    499   endif
          500  +
          501  +LIB += -municode
   501    502   
   502    503   #### Tcl shell for use in running the fossil test suite.  This is only
   503    504   #    used for testing.
   504    505   #
   505         -TCLSH = tclsh
          506  +TCLSH = tclsh86
   506    507   
   507    508   #### Nullsoft installer MakeNSIS location
   508    509   #
   509    510   MAKENSIS = "$(ProgramFiles)\NSIS\MakeNSIS.exe"
   510    511   
   511    512   #### Include a configuration file that can override any one of these settings.
   512    513   #
................................................................................
   892    893   #ZLIB    = zdll.lib
   893    894   ZINCDIR = $(MSCDIR)\extra\include
   894    895   ZLIBDIR = $(MSCDIR)\extra\lib
   895    896   ZLIB    = zlib.lib
   896    897   
   897    898   INCL   = -I. -I$(SRCDIR) -I$B\win\include -I$(MSCDIR)\extra\include -I$(ZINCDIR)
   898    899   
   899         -CFLAGS = -nologo -MT -O2
          900  +CFLAGS = -nologo -MT -O2 -DUNICODE -D_UNICODE
   900    901   BCC    = $(CC) $(CFLAGS)
   901    902   TCC    = $(CC) -c $(CFLAGS) $(MSCDEF) $(SSL) $(INCL)
   902    903   LIBS   = $(ZLIB) ws2_32.lib advapi32.lib $(SSLLIB)
   903    904   LIBDIR = -LIBPATH:$(MSCDIR)\extra\lib -LIBPATH:$(ZLIBDIR)
   904    905   }
   905    906   regsub -all {[-]D} $SQLITE_OPTIONS {/D} MSC_SQLITE_OPTIONS
   906    907   writeln "SQLITE_OPTIONS = $MSC_SQLITE_OPTIONS\n"

Changes to src/name.c.

    27     27   
    28     28   /*
    29     29   ** Return TRUE if the string begins with something that looks roughly
    30     30   ** like an ISO date/time string.  The SQLite date/time functions will
    31     31   ** have the final say-so about whether or not the date/time string is
    32     32   ** well-formed.
    33     33   */
    34         -static int is_date(const char *z){
           34  +int fossil_isdate(const char *z){
    35     35     if( !fossil_isdigit(z[0]) ) return 0;
    36     36     if( !fossil_isdigit(z[1]) ) return 0;
    37     37     if( !fossil_isdigit(z[2]) ) return 0;
    38     38     if( !fossil_isdigit(z[3]) ) return 0;
    39     39     if( z[4]!='-') return 0;
    40     40     if( !fossil_isdigit(z[5]) ) return 0;
    41     41     if( !fossil_isdigit(z[6]) ) return 0;
................................................................................
   110    110       rid = db_int(0, 
   111    111         "SELECT objid FROM event"
   112    112         " WHERE mtime<=julianday(%Q,'utc') AND type GLOB '%q'"
   113    113         " ORDER BY mtime DESC LIMIT 1",
   114    114         &zTag[5], zType);
   115    115       return rid;
   116    116     }
   117         -  if( is_date(zTag) ){
          117  +  if( fossil_isdate(zTag) ){
   118    118       rid = db_int(0, 
   119    119         "SELECT objid FROM event"
   120    120         " WHERE mtime<=julianday(%Q,'utc') AND type GLOB '%q'"
   121    121         " ORDER BY mtime DESC LIMIT 1",
   122    122         zTag, zType);
   123    123       if( rid) return rid;
   124    124     }
................................................................................
   179    179       db_finalize(&q);
   180    180       return rid;
   181    181     }
   182    182   
   183    183     /* symbolic-name ":" date-time */
   184    184     nTag = strlen(zTag);
   185    185     for(i=0; i<nTag-10 && zTag[i]!=':'; i++){}
   186         -  if( zTag[i]==':' && is_date(&zTag[i+1]) ){
          186  +  if( zTag[i]==':' && fossil_isdate(&zTag[i+1]) ){
   187    187       char *zDate = mprintf("%s", &zTag[i+1]);
   188    188       char *zTagBase = mprintf("%.*s", i, zTag);
   189    189       int nDate = strlen(zDate);
   190    190       if( sqlite3_strnicmp(&zDate[nDate-3],"utc",3)==0 ){
   191    191         zDate[nDate-3] = 'z';
   192    192         zDate[nDate-2] = 0;
   193    193       }

Changes to src/setup.c.

  1127   1127     style_footer();
  1128   1128   }
  1129   1129   
  1130   1130   /*
  1131   1131   ** WEBPAGE: setup_timeline
  1132   1132   */
  1133   1133   void setup_timeline(void){
         1134  +  double tmDiff;
         1135  +  char zTmDiff[20];
  1134   1136     login_check_credentials();
  1135   1137     if( !g.perm.Setup ){
  1136   1138       login_needed();
  1137   1139     }
  1138   1140   
  1139   1141     style_header("Timeline Display Preferences");
  1140   1142     db_begin_transaction();
................................................................................
  1147   1149     @ <p>In timeline displays, check-in comments can be displayed with or
  1148   1150     @ without block markup (paragraphs, tables, etc.)</p>
  1149   1151   
  1150   1152     @ <hr />
  1151   1153     onoff_attribute("Use Universal Coordinated Time (UTC)",
  1152   1154                     "timeline-utc", "utc", 1);
  1153   1155     @ <p>Show times as UTC (also sometimes called Greenwich Mean Time (GMT) or
  1154         -  @ Zulu) instead of in local time.</p>
         1156  +  @ Zulu) instead of in local time.  On this server, local time is currently
         1157  +  g.fTimeFormat = 2;
         1158  +  tmDiff = db_double(0.0, "SELECT julianday('now')");
         1159  +  tmDiff = db_double(0.0, 
         1160  +        "SELECT (julianday(%.17g,'localtime')-julianday(%.17g))*24.0",
         1161  +        tmDiff, tmDiff);
         1162  +  sqlite3_snprintf(sizeof(zTmDiff), zTmDiff, "%.1f", tmDiff);
         1163  +  if( strcmp(zTmDiff, "0.0")==0 ){
         1164  +    @ the same as UTC and so this setting will make no difference in
         1165  +    @ the display.</p>
         1166  +  }else if( tmDiff<0.0 ){
         1167  +    sqlite3_snprintf(sizeof(zTmDiff), zTmDiff, "%.1f", -tmDiff);
         1168  +    @ %s(zTmDiff) hours behind UTC.</p>
         1169  +  }else{
         1170  +    @ %s(zTmDiff) hours ahead of UTC.</p>
         1171  +  }
  1155   1172   
  1156   1173     @ <hr />
  1157   1174     onoff_attribute("Show version differences by default",
  1158   1175                     "show-version-diffs", "vdiff", 0);
  1159   1176     @ <p>On the version-information pages linked from the timeline can either
  1160   1177     @ show complete diffs of all file changes, or can just list the names of
  1161   1178     @ the files that have changed.  Users can get to either page by

Changes to src/sqlcmd.c.

   116    116   ){
   117    117     sqlite3_create_function(db, "content", 1, SQLITE_ANY, 0,
   118    118                             sqlcmd_content, 0, 0);
   119    119     sqlite3_create_function(db, "compress", 1, SQLITE_ANY, 0,
   120    120                             sqlcmd_compress, 0, 0);
   121    121     sqlite3_create_function(db, "decompress", 1, SQLITE_ANY, 0,
   122    122                             sqlcmd_decompress, 0, 0);
          123  +  g.repositoryOpen = 1;
          124  +  g.db = db;
   123    125     return SQLITE_OK;
   124    126   }
   125    127   
   126    128   
   127    129   /*
   128    130   ** COMMAND: sqlite3
   129    131   **

Changes to src/timeline.c.

   816    816   ** Convert a symbolic name used as an argument to the a=, b=, or c=
   817    817   ** query parameters of timeline into a julianday mtime value.
   818    818   */
   819    819   double symbolic_name_to_mtime(const char *z){
   820    820     double mtime;
   821    821     int rid;
   822    822     if( z==0 ) return -1.0;
          823  +  if( fossil_isdate(z) ){
          824  +    mtime = db_double(0.0, "SELECT julianday(%Q,'utc')", z);
          825  +    if( mtime>0.0 ) return mtime;
          826  +  }
   823    827     rid = symbolic_name_to_rid(z, "ci");
   824    828     if( rid==0 ) return -1.0;
   825    829     mtime = db_double(0.0, "SELECT mtime FROM event WHERE objid=%d", rid);
   826    830     return mtime;
   827    831   }
   828    832   
   829    833   /*
................................................................................
  1180   1184         url_add_parameter(&url, "c", zCirca);
  1181   1185       }else{
  1182   1186         blob_appendf(&sql, " ORDER BY event.mtime DESC");
  1183   1187       }
  1184   1188       blob_appendf(&sql, " LIMIT %d", nEntry);
  1185   1189       db_multi_exec("%s", blob_str(&sql));
  1186   1190   
  1187         -    n = db_int(0, "SELECT count(*) FROM timeline /*scan*/");
         1191  +    n = db_int(0, "SELECT count(*) FROM timeline WHERE etype!='div' /*scan*/");
  1188   1192       if( zAfter==0 && zBefore==0 && zCirca==0 ){
  1189   1193         blob_appendf(&desc, "%d most recent %ss", n, zEType);
  1190   1194       }else{
  1191   1195         blob_appendf(&desc, "%d %ss", n, zEType);
  1192   1196       }
  1193   1197       if( zUser ){
  1194   1198         blob_appendf(&desc, " by user %h", zUser);

Changes to src/winhttp.c.

   127    127     if( in ) fclose(in);
   128    128     closesocket(p->s);
   129    129     file_delete(zRequestFName);
   130    130     file_delete(zReplyFName);
   131    131     free(p);
   132    132   }
   133    133   
          134  +#if !defined(UNICODE)
          135  +#  define fossil_unicode_to_utf8 fossil_mbcs_to_utf8
          136  +#  define fossil_utf8_to_unicode fossil_utf8_to_mbcs
          137  +#endif
          138  +
   134    139   /*
   135    140   ** Start a listening socket and process incoming HTTP requests on
   136    141   ** that socket.
   137    142   */
   138    143   
   139         -#if !defined(UNICODE)
   140         -#  define fossil_unicode_to_utf8 fossil_mbcs_to_utf8
   141         -#  define fossil_utf8_to_unicode fossil_utf8_to_mbcs
   142         -#endif
   143         -
   144    144   void win32_http_server(
   145    145     int mnPort, int mxPort,   /* Range of allowed TCP port numbers */
   146    146     const char *zBrowser,     /* Command to launch browser.  (Or NULL) */
   147    147     const char *zStopper,     /* Stop server when this file is exists (Or NULL) */
   148    148     const char *zNotFound,    /* The --notfound option, or NULL */
   149    149     int flags                 /* One or more HTTP_SERVER_ flags */
   150    150   ){
................................................................................
   452    452         fossil_fatal("error from StartServiceCtrlDispatcher()");
   453    453       }
   454    454     }
   455    455     return 0;
   456    456   }
   457    457   
   458    458   #ifdef _WIN32
   459         -/* dupe ifdef needed for mkindex */
          459  +/* dupe ifdef needed for mkindex
   460    460   ** COMMAND: winsrv*
   461    461   ** Usage: fossil winsrv METHOD ?SERVICE-NAME? ?OPTIONS?
   462    462   **
   463    463   ** Where METHOD is one of: create delete show start stop.
   464    464   **
   465    465   ** The winsrv command manages Fossil as a Windows service.  This allows
   466    466   ** (for example) Fossil to be running in the background when no user

Changes to win/Makefile.mingw.

    11     11   # This is a makefile for use on Windows/Linux/Darwin/Cygwin using MinGW or
    12     12   # MinGW-w64.
    13     13   #
    14     14   
    15     15   #### Select one of MinGW, MinGW-64 (32-bit) or MinGW-w64 (64-bit) compilers.
    16     16   #    By default, this is an empty string (i.e. use the native compiler).
    17     17   #
    18         -PREFIX =
    19     18   # PREFIX = mingw32-
    20     19   # PREFIX = i686-pc-mingw32-
    21         -# PREFIX = i686-w64-mingw32-
           20  +PREFIX = i686-w64-mingw32-
    22     21   # PREFIX = x86_64-w64-mingw32-
    23     22   
    24     23   #### The toplevel directory of the source tree.  Fossil can be built
    25     24   #    in a directory that is separate from the source tree.  Just change
    26     25   #    the following to point from the build directory to the src/ folder.
    27     26   #
    28     27   SRCDIR = src
................................................................................
   102    101   
   103    102   #### C Compile and options for use in building executables that
   104    103   #    will run on the target platform.  This is usually the same
   105    104   #    as BCC, unless you are cross-compiling.  This C compiler builds
   106    105   #    the finished binary for fossil.  The BCC compiler above is used
   107    106   #    for building intermediate code-generator tools.
   108    107   #
   109         -TCC = $(PREFIX)gcc -Os -Wall -L$(ZLIBDIR) -I$(ZINCDIR)
          108  +TCC = $(PREFIX)gcc -Os -Wall -DUNICODE -D_UNICODE -L$(ZLIBDIR) -I$(ZINCDIR)
   110    109   
   111    110   #### Compile resources for use in building executables that will run
   112    111   #    on the target platform.
   113    112   #
   114    113   RCC = $(PREFIX)windres -I$(SRCDIR) -I$(ZINCDIR)
   115    114   
   116    115   # With HTTPS support
................................................................................
   173    172   #    or linking with it will not work (exact reason unknown).
   174    173   #
   175    174   ifdef FOSSIL_ENABLE_TCL
   176    175   LIB += -lnetapi32 -lkernel32 -luser32 -ladvapi32 -lws2_32
   177    176   else
   178    177   LIB += -lkernel32 -lws2_32
   179    178   endif
          179  +
          180  +LIB += -municode
   180    181   
   181    182   #### Tcl shell for use in running the fossil test suite.  This is only
   182    183   #    used for testing.
   183    184   #
   184         -TCLSH = tclsh
          185  +TCLSH = tclsh86
   185    186   
   186    187   #### Nullsoft installer MakeNSIS location
   187    188   #
   188    189   MAKENSIS = "$(ProgramFiles)\NSIS\MakeNSIS.exe"
   189    190   
   190    191   #### Include a configuration file that can override any one of these settings.
   191    192   #

Changes to win/Makefile.mingw.mistachkin.

    11     11   # This is a makefile for use on Windows/Linux/Darwin/Cygwin using MinGW or
    12     12   # MinGW-w64.
    13     13   #
    14     14   
    15     15   #### Select one of MinGW, MinGW-64 (32-bit) or MinGW-w64 (64-bit) compilers.
    16     16   #    By default, this is an empty string (i.e. use the native compiler).
    17     17   #
    18         -PREFIX =
    19     18   # PREFIX = mingw32-
    20     19   # PREFIX = i686-pc-mingw32-
    21         -# PREFIX = i686-w64-mingw32-
           20  +PREFIX = i686-w64-mingw32-
    22     21   # PREFIX = x86_64-w64-mingw32-
    23     22   
    24     23   #### The toplevel directory of the source tree.  Fossil can be built
    25     24   #    in a directory that is separate from the source tree.  Just change
    26     25   #    the following to point from the build directory to the src/ folder.
    27     26   #
    28     27   SRCDIR = src
................................................................................
   102    101   
   103    102   #### C Compile and options for use in building executables that
   104    103   #    will run on the target platform.  This is usually the same
   105    104   #    as BCC, unless you are cross-compiling.  This C compiler builds
   106    105   #    the finished binary for fossil.  The BCC compiler above is used
   107    106   #    for building intermediate code-generator tools.
   108    107   #
   109         -TCC = $(PREFIX)gcc -Os -Wall -L$(ZLIBDIR) -I$(ZINCDIR)
          108  +TCC = $(PREFIX)gcc -Os -Wall -DUNICODE -D_UNICODE -L$(ZLIBDIR) -I$(ZINCDIR)
   110    109   
   111    110   #### Compile resources for use in building executables that will run
   112    111   #    on the target platform.
   113    112   #
   114    113   RCC = $(PREFIX)windres -I$(SRCDIR) -I$(ZINCDIR)
   115    114   
   116    115   # With HTTPS support
................................................................................
   173    172   #    or linking with it will not work (exact reason unknown).
   174    173   #
   175    174   ifdef FOSSIL_ENABLE_TCL
   176    175   LIB += -lnetapi32 -lkernel32 -luser32 -ladvapi32 -lws2_32
   177    176   else
   178    177   LIB += -lkernel32 -lws2_32
   179    178   endif
          179  +
          180  +LIB += -municode
   180    181   
   181    182   #### Tcl shell for use in running the fossil test suite.  This is only
   182    183   #    used for testing.
   183    184   #
   184         -TCLSH = tclsh
          185  +TCLSH = tclsh86
   185    186   
   186    187   #### Nullsoft installer MakeNSIS location
   187    188   #
   188    189   MAKENSIS = "$(ProgramFiles)\NSIS\MakeNSIS.exe"
   189    190   
   190    191   #### Include a configuration file that can override any one of these settings.
   191    192   #

Changes to win/Makefile.msc.

    30     30   #ZLIB    = zdll.lib
    31     31   ZINCDIR = $(MSCDIR)\extra\include
    32     32   ZLIBDIR = $(MSCDIR)\extra\lib
    33     33   ZLIB    = zlib.lib
    34     34   
    35     35   INCL   = -I. -I$(SRCDIR) -I$B\win\include -I$(MSCDIR)\extra\include -I$(ZINCDIR)
    36     36   
    37         -CFLAGS = -nologo -MT -O2
           37  +CFLAGS = -nologo -MT -O2 -DUNICODE -D_UNICODE
    38     38   BCC    = $(CC) $(CFLAGS)
    39     39   TCC    = $(CC) -c $(CFLAGS) $(MSCDEF) $(SSL) $(INCL)
    40     40   LIBS   = $(ZLIB) ws2_32.lib advapi32.lib $(SSLLIB)
    41     41   LIBDIR = -LIBPATH:$(MSCDIR)\extra\lib -LIBPATH:$(ZLIBDIR)
    42     42   
    43     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     44