Windows doesn't have truncate, but otherwise SQLite3 seems to work fine 
(although I've left it out of my binary release).  I've also fixed a warning 
generated by gtags-cscope/exec.c.

-- 
Jason.
diff -urp global-6.3.3/gtags-cscope/exec.c global-6.3-3/gtags-cscope/exec.c
--- global-6.3.3/gtags-cscope/exec.c    2014-11-26 12:49:36 +1000
+++ global-6.3-3/gtags-cscope/exec.c    2014-11-27 10:12:20 +1000
@@ -91,7 +91,7 @@ execute(char *a, ...) /* note: "exec" is
 #if !HAVE_FORK
        /* HBB 20010313: in MSDOG, everything is completely different.
         * No fork()/exec()/wait(), but rather a single libc call: */
-        exitcode = spawnvp(P_WAIT, a, argv);
+       exitcode = spawnvp(P_WAIT, a, (const char* const*)argv);
 #else
        if ((p = myfork()) == 0) {
                myexecvp(a, argv);      /* child */
diff -urp global-6.3.3/libutil/dbop.c global-6.3-3/libutil/dbop.c
--- global-6.3.3/libutil/dbop.c 2014-11-26 12:49:36 +1000
+++ global-6.3-3/libutil/dbop.c 2014-11-27 10:00:30 +1000
@@ -845,8 +845,15 @@ dbop3_open(const char *path, int mode, i
                /*
                 * In case of creation.
                 */
-               if (mode == 1)
+               if (mode == 1) {
+#ifndef _WIN32
                        (void)truncate(path, 0);
+#else
+                       FILE* f = fopen(path, "w");
+                       if (f)
+                               fclose(f);
+#endif
+               }
                tblname = "db";
        }
        /*
@@ -866,7 +873,7 @@ dbop3_open(const char *path, int mode, i
                assert(0);
        }
        /*
-        * When the forth argument is NULL, sqlite3_vfs is used.
+        * When the fourth argument is NULL, sqlite3_vfs is used.
         */
        rc = sqlite3_open_v2(path, &db3, rw, NULL);
        if (rc != SQLITE_OK)
_______________________________________________
Bug-global mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/bug-global

Reply via email to