summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoel Rosdahl <joel@rosdahl.net>2012-02-22 22:07:55 +0100
committerJoel Rosdahl <joel@rosdahl.net>2012-02-23 19:32:06 +0100
commit235c19b2b39a36c6d6947c4eeeb3981e5d527d3c (patch)
tree864e5de0141eaa24bdc92428c81eb45aaeeb65d4
parentc1790b700ba82a4dbb5061af8e23df31930da0ed (diff)
downloadccache-235c19b2b39a36c6d6947c4eeeb3981e5d527d3c.tar.gz
Solaris build fixes
-rw-r--r--system.h4
-rwxr-xr-xtest.sh2
-rw-r--r--test/test_conf.c2
-rw-r--r--test/test_util.c6
4 files changed, 8 insertions, 6 deletions
diff --git a/system.h b/system.h
index eca78a68..5309fc5f 100644
--- a/system.h
+++ b/system.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2010-2011 Joel Rosdahl
+ * Copyright (C) 2010-2012 Joel Rosdahl
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
@@ -47,6 +47,8 @@
#include <time.h>
#include <utime.h>
+extern char **environ;
+
#if !HAVE_VSNPRINTF
int rpl_vsnprintf(char *, size_t, const char *, va_list);
#define vsnprintf rpl_vsnprintf
diff --git a/test.sh b/test.sh
index 86b402b0..f1ea65c4 100755
--- a/test.sh
+++ b/test.sh
@@ -356,7 +356,7 @@ touch override_path_compiler_executed
EOF
chmod +x $override_path/cc
CCACHE_PATH=$override_path $CCACHE cc -c test1.c
- if [ ! -e override_path_compiler_executed ]; then
+ if [ ! -f override_path_compiler_executed ]; then
test_failed "CCACHE_PATH had no effect"
fi
diff --git a/test/test_conf.c b/test/test_conf.c
index 27ab4416..db1f381e 100644
--- a/test/test_conf.c
+++ b/test/test_conf.c
@@ -306,7 +306,7 @@ TEST(conf_update_from_environment)
CHECK(conf_update_from_environment(conf, &errmsg));
CHECK(conf->compression);
- unsetenv("CCACHE_COMPRESS");
+ putenv("CCACHE_COMPRESS"); /* unsetenv isn't portable */
putenv("CCACHE_NOCOMPRESS=1");
CHECK(conf_update_from_environment(conf, &errmsg));
CHECK(!conf->compression);
diff --git a/test/test_util.c b/test/test_util.c
index 19c0afe0..7a9fbcdb 100644
--- a/test/test_util.c
+++ b/test/test_util.c
@@ -127,7 +127,7 @@ TEST(format_parsable_size_with_suffix)
TEST(parse_size_with_suffix)
{
- size_t size;
+ uint64_t size;
size_t i;
struct { const char *size; int64_t expected; } sizes[] = {
{"0", 0},
@@ -138,13 +138,13 @@ TEST(parse_size_with_suffix)
{"1.1 M", 1.1 * 1000 * 1000},
{"438.55M", 438.55 * 1000 * 1000},
{"1 G", 1 * 1000 * 1000 * 1000},
- {"2T", 2L * 1000 * 1000 * 1000 * 1000},
+ {"2T", (int64_t)2 * 1000 * 1000 * 1000 * 1000},
{"78 Ki", 78 * 1024},
{"1.1Mi", 1.1 * 1024 * 1024},
{"438.55 Mi", 438.55 * 1024 * 1024},
{"1Gi", 1 * 1024 * 1024 * 1024},
- {"2 Ti", 2L * 1024 * 1024 * 1024 * 1024},
+ {"2 Ti", (int64_t)2 * 1024 * 1024 * 1024 * 1024},
};