]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
Use semicolon as the CCACHE_EXTRAFILES path separator on Windows
authorJoel Rosdahl <joel@rosdahl.net>
Fri, 16 Jul 2010 14:56:48 +0000 (16:56 +0200)
committerJoel Rosdahl <joel@rosdahl.net>
Fri, 16 Jul 2010 14:56:48 +0000 (16:56 +0200)
ccache.c
ccache.h
manual.txt
test.sh

index 725b81d4e25432f7dba68fd4da127d72d77c49f6..64bf92d5af1669992db12942e1180b023f9057c1 100644 (file)
--- a/ccache.c
+++ b/ccache.c
@@ -942,7 +942,7 @@ static void calculate_common_hash(ARGS *args, struct mdfour *hash)
                char *path, *q;
                p = x_strdup(p);
                q = p;
-               while ((path = strtok(q, ":"))) {
+               while ((path = strtok(q, PATH_DELIM))) {
                        cc_log("Hashing extra file %s", path);
                        hash_delimiter(hash, "extrafile");
                        if (!hash_file(hash, path)) {
index 041362d9dc54fe0b33d123bcace4ca174fac96d9..905386c5b65c33b7904394f8117d9724c6b014d8 100644 (file)
--- a/ccache.h
+++ b/ccache.h
@@ -190,6 +190,6 @@ typedef int (*COMPAR_FN_T)(const void *, const void *);
 #undef HAVE_MKSTEMP
 #endif
 
-#    define PATH_DELIM ":"
+#define PATH_DELIM ":"
 
 #endif /* ifndef CCACHE_H */
index d8141c9a1e0278c3cf8c2e48b6b91de6160dc7df..a821a0eeeec48dfe6d332fb1e2e36b0fb9bf009b 100644 (file)
@@ -239,9 +239,10 @@ are doing.
 
 *CCACHE_EXTRAFILES*::
 
-    If you set the environment variable *CCACHE_EXTRAFILES* to a
-    colon-separated list of paths then ccache will include the contents of
-    those files when calculating the hash sum.
+    If you set the environment variable *CCACHE_EXTRAFILES* to a list of paths
+    then ccache will include the contents of those files when calculating the
+    hash sum. The list separator is semicolon in Windows systems and colon on
+    other systems.
 
 *CCACHE_HARDLINK*::
 
diff --git a/test.sh b/test.sh
index 016178da90f98b988015deb4e6edc1ede82b3272..7abeeea0af7467a647282c17544be17cc04c8bf4 100755 (executable)
--- a/test.sh
+++ b/test.sh
@@ -1312,23 +1312,23 @@ EOF
     checkstat 'cache miss' 1
 
     testname="cache miss a b"
-    CCACHE_EXTRAFILES="a:b" $CCACHE $COMPILER -c test.c
+    CCACHE_EXTRAFILES="a${PATH_DELIM}b" $CCACHE $COMPILER -c test.c
     checkstat 'cache hit (preprocessed)' 1
     checkstat 'cache miss' 2
 
     testname="cache hit a b"
-    CCACHE_EXTRAFILES="a:b" $CCACHE $COMPILER -c test.c
+    CCACHE_EXTRAFILES="a${PATH_DELIM}b" $CCACHE $COMPILER -c test.c
     checkstat 'cache hit (preprocessed)' 2
     checkstat 'cache miss' 2
 
     testname="cache miss a b2"
     echo b2 >b
-    CCACHE_EXTRAFILES="a:b" $CCACHE $COMPILER -c test.c
+    CCACHE_EXTRAFILES="a${PATH_DELIM}b" $CCACHE $COMPILER -c test.c
     checkstat 'cache hit (preprocessed)' 2
     checkstat 'cache miss' 3
 
     testname="cache hit a b2"
-    CCACHE_EXTRAFILES="a:b" $CCACHE $COMPILER -c test.c
+    CCACHE_EXTRAFILES="a${PATH_DELIM}b" $CCACHE $COMPILER -c test.c
     checkstat 'cache hit (preprocessed)' 3
     checkstat 'cache miss' 3
 
@@ -1561,9 +1561,11 @@ host_os="`uname -s`"
 case $host_os in
     *MINGW*|*mingw*)
         DEVNULL=NUL
+        PATH_DELIM=";"
         ;;
     *)
         DEVNULL=/dev/null
+        PATH_DELIM=":"
         all_suites="$all_suites link basedir"
         ;;
 esac