AC_CONFIG_FILES([dev.mk])
include_dev_mk='include dev.mk'
version=`(git --git-dir=$srcdir/.git describe --dirty 2>/dev/null || echo vunknown) | sed -e 's/v//' -e 's/-/+/' -e 's/-/_/g'`
- echo "const char CCACHE_VERSION@<:@@:>@ = \"$version\";" >src/version.c
+ echo "extern const char CCACHE_VERSION@<:@@:>@; const char CCACHE_VERSION@<:@@:>@ = \"$version\";" >src/version.c
else
AC_MSG_NOTICE(developer mode disabled)
fi
if test ! -f $srcdir/src/version.c -a ! -f src/version.c ; then
AC_MSG_WARN(unable to determine ccache version)
- echo "const char CCACHE_VERSION@<:@@:>@ = \"unknown\";" >src/version.c
+ echo "extern const char CCACHE_VERSION@<:@@:>@; const char CCACHE_VERSION@<:@@:>@ = \"unknown\";" >src/version.c
fi
dnl Find test suite files.
src/snprintf.c
ifneq ($(shell sed 's/.*"\(.*\)".*/\1/' src/version.c 2>/dev/null),$(version))
- $(shell echo 'const char CCACHE_VERSION[] = "$(version)";' >src/version.c)
+ $(shell echo 'extern const char CCACHE_VERSION[]; const char CCACHE_VERSION[] = "$(version)";' >src/version.c)
endif
src/version.o: src/version.c
#define STRINGIFY(x) #x
#define TO_STRING(x) STRINGIFY(x)
+extern struct conf *conf;
+extern char *primary_config_path;
+extern char *secondary_config_path;
+extern char *current_working_dir;
+extern char *stats_file;
+extern unsigned lock_staleness_limit;
+
+int ccache_main(int argc, char *argv[]);
+
static const char VERSION_TEXT[] =
MYNAME " version %s\n"
"\n"
}
// Create or update the manifest file.
-void update_manifest_file(void)
+static void
+update_manifest_file(void)
{
if (!conf->direct_mode
|| !included_files
}
// Wipe one cache subdirectory.
-void
+static void
wipe_dir(const char *dir)
{
cc_log("Clearing out cache directory %s", dir);
return retval;
}
+extern bool compopt_verify_sortedness(void);
+
// For test purposes.
bool
compopt_verify_sortedness(void)
*/
#include "hashtable.h"
+#define HASHTABLE_INDEXFOR
#include "hashtable_private.h"
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <math.h>
+extern const unsigned int prime_table_length;
+extern const float max_load_factor;
+
/*
Credit for primes table: Aaron Krowne
http://br.endernet.org/~akrowne/
/* Copyright (C) 2002, 2004 Christopher Clark <firstname.lastname@cl.cam.ac.uk> */
#include "hashtable.h"
+#define HASHTABLE_INDEXFOR
#include "hashtable_private.h"
#include "hashtable_itr.h"
#include <stdlib.h> /* defines NULL */
hash(struct hashtable *h, void *k);
/*****************************************************************************/
+#ifdef HASHTABLE_INDEXFOR
/* indexFor */
static inline unsigned int
indexFor(unsigned int tablelength, unsigned int hashvalue) {
return (hashvalue & (tablelength - 1u));
}
*/
+#endif
/*****************************************************************************/
#define freekey(X) free(X)
#include "ccache.h"
+#include "language.h"
+
// Supported file extensions and corresponding languages (as in parameter to
// the -x option).
static const struct {
return ret;
}
-char const CACHEDIR_TAG[] =
+static char const CACHEDIR_TAG[] =
"Signature: 8a477f597d28d172789f06886806bc55\n"
"# This file is a cache directory tag created by ccache.\n"
"# For information about cache directory tags, see:\n"
// ============================================================================
#define TEST_SUITE(name) \
+ extern unsigned suite_##name(unsigned _start_point); \
unsigned suite_##name(unsigned _start_point) \
{ \
unsigned _test_counter = 0; \
#undef SUITE
// *INDENT-ON* enable uncrustify
-const char USAGE_TEXT[] =
+static const char USAGE_TEXT[] =
"Usage:\n"
" test [options]\n"
"\n"
TEST(option_table_should_be_sorted)
{
- bool compopt_verify_sortedness();
+ extern bool compopt_verify_sortedness(void);
CHECK(compopt_verify_sortedness());
}