This makes manifest file names unique per manifest version, thus avoiding
ccache versions with different manifest versions overwriting each other's
manifests.
struct file_hash *object_hash = NULL;
char *p;
+ if (direct_mode) {
+ hash_delimiter(hash, "manifest version");
+ hash_int(hash, MANIFEST_VERSION);
+ }
+
/* first the arguments */
for (i = 1; i < args->argc; i++) {
/* -L doesn't affect compilation. */
*/
static const uint32_t MAGIC = 0x63436d46U;
-static const uint8_t VERSION = 1;
static const uint32_t MAX_MANIFEST_ENTRIES = 100;
#define ccache_static_assert(e) \
return NULL;
}
READ_BYTE(mf->version);
- if (mf->version != VERSION) {
+ if (mf->version != MANIFEST_VERSION) {
cc_log("Manifest file has unknown version %u", mf->version);
free_manifest(mf);
return NULL;
uint16_t i, j;
WRITE_INT(4, MAGIC);
- WRITE_INT(1, VERSION);
+ WRITE_INT(1, MANIFEST_VERSION);
WRITE_INT(1, 16);
WRITE_INT(2, 0);
#include "hashutil.h"
#include "hashtable.h"
+#define MANIFEST_VERSION 1
+
struct file_hash *manifest_get(struct conf *conf, const char *manifest_path);
bool manifest_put(const char *manifest_path, struct file_hash *object_hash,
struct hashtable *included_files);