From: Joel Rosdahl Date: Fri, 16 Jul 2010 14:56:48 +0000 (+0200) Subject: Use semicolon as the CCACHE_EXTRAFILES path separator on Windows X-Git-Tag: v3.1~181 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=2bacab3f9204c8cc96bb5ababa145712f4efbcea;p=thirdparty%2Fccache.git Use semicolon as the CCACHE_EXTRAFILES path separator on Windows --- diff --git a/ccache.c b/ccache.c index 725b81d4e..64bf92d5a 100644 --- 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)) { diff --git a/ccache.h b/ccache.h index 041362d9d..905386c5b 100644 --- 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 */ diff --git a/manual.txt b/manual.txt index d8141c9a1..a821a0eee 100644 --- a/manual.txt +++ b/manual.txt @@ -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 016178da9..7abeeea0a 100755 --- 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