Make sure config.h gets included before system headers, since it
may include feature macros.
diff --git a/compress.c b/compress.c
index fc85f44..76e91d2 100644
--- a/compress.c
+++ b/compress.c
@@ -1,7 +1,7 @@
/* $Id$ */
/* ----------------------------------------------------------------------- *
*
- * Copyright 2001 H. Peter Anvin - All Rights Reserved
+ * Copyright 2001-2006 H. Peter Anvin - All Rights Reserved
*
* 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
@@ -11,19 +11,21 @@
*
* ----------------------------------------------------------------------- */
+#include "mkzftree.h" /* Must be included first! */
+
#include <stdlib.h>
#include <stdio.h>
#include <utime.h>
#include <unistd.h>
#include <zlib.h>
-#include "mkzftree.h"
+
#include "iso9660.h"
int block_compress_file(FILE *input, FILE *output, off_t size)
{
struct compressed_file_header hdr;
- char inbuf[CBLOCK_SIZE], outbuf[2*CBLOCK_SIZE];
+ Bytef inbuf[CBLOCK_SIZE], outbuf[2*CBLOCK_SIZE];
size_t bytes, pointer_bytes, nblocks, block;
uLong cbytes; /* uLong is a zlib datatype */
char *pointer_block, *curptr;
diff --git a/copytime.c b/copytime.c
index 0f7bd02..c327205 100644
--- a/copytime.c
+++ b/copytime.c
@@ -12,12 +12,12 @@
* ----------------------------------------------------------------------- */
/*
- * copytime.h
+ * copytime.c
*
* Copy time(s) from a struct stat
*/
-#include "mkzftree.h"
+#include "mkzftree.h" /* Must be included first! */
#include <utime.h>
#include <sys/time.h>
@@ -52,4 +52,3 @@
#endif
}
-
diff --git a/hash.c b/hash.c
index d9ba1a6..ae70329 100644
--- a/hash.c
+++ b/hash.c
@@ -17,7 +17,7 @@
* Hash table used to find hard-linked files
*/
-#include "mkzftree.h"
+#include "mkzftree.h" /* Must be included first! */
#define HASH_BUCKETS 2683
diff --git a/iso9660.h b/iso9660.h
index 8e0f04d..5da7aea 100644
--- a/iso9660.h
+++ b/iso9660.h
@@ -13,6 +13,9 @@
/* zisofs definitions */
+#ifndef ISO9660_H
+#define ISO9660_H
+
#ifndef CBLOCK_SIZE_LG2
#define CBLOCK_SIZE_LG2 15 /* Compressed block size */
#endif
@@ -43,3 +46,5 @@
void set_733(void *, unsigned int);
#define get_723(x) get_721(x)
#define get_733(x) get_731(x)
+
+#endif /* ISO9660_H */
diff --git a/mkzftree.c b/mkzftree.c
index 3ddb1d7..9c7b038 100644
--- a/mkzftree.c
+++ b/mkzftree.c
@@ -59,6 +59,8 @@
* The block data is compressed according to "zlib".
*/
+#include "mkzftree.h" /* Must be included first! */
+
#include <errno.h>
#include <stdlib.h>
#include <string.h>
@@ -69,13 +71,12 @@
#include <sys/types.h>
#include <sys/time.h>
-#include "mkzftree.h"
-#include "version.h"
-
#ifdef HAVE_GETOPT_H
#include <getopt.h>
#endif
+#include "version.h"
+
/* Command line options */
struct cmdline_options opt = {
0, /* Force compression */
diff --git a/mkzftree.h b/mkzftree.h
index 4762374..a4ac7a4 100644
--- a/mkzftree.h
+++ b/mkzftree.h
@@ -1,7 +1,7 @@
#ident "$Id$"
/* ----------------------------------------------------------------------- *
*
- * Copyright 2001 H. Peter Anvin - All Rights Reserved
+ * Copyright 2001-2006 H. Peter Anvin - All Rights Reserved
*
* 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
@@ -11,7 +11,12 @@
*
* ----------------------------------------------------------------------- */
+#ifndef MKZFTREE_H
+#define MKZFTREE_H
+
+/* config.h should be included before any system headers!!!! */
#include "config.h"
+
#include <stddef.h>
#include <stdlib.h>
#include <string.h>
@@ -95,3 +100,4 @@
/* copytime.h */
int copytime(const char *, const struct stat *);
+#endif /* MKZFTREE_H */
diff --git a/uncompress.c b/uncompress.c
index bb457d9..19a26f0 100644
--- a/uncompress.c
+++ b/uncompress.c
@@ -1,7 +1,7 @@
/* $Id$ */
/* ----------------------------------------------------------------------- *
*
- * Copyright 2001 H. Peter Anvin - All Rights Reserved
+ * Copyright 2001-2006 H. Peter Anvin - All Rights Reserved
*
* 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
@@ -11,16 +11,18 @@
*
* ----------------------------------------------------------------------- */
+#include "mkzftree.h" /* Must be included first! */
+
#include <stdio.h>
#include <stdlib.h>
#include <zlib.h>
-#include "mkzftree.h"
+
#include "iso9660.h"
int block_uncompress_file(FILE *input, FILE *output, off_t size)
{
struct compressed_file_header hdr;
- char *inbuf, *outbuf;
+ Bytef *inbuf, *outbuf;
int block_shift;
char *pointer_block, *pptr;
unsigned long nblocks;
diff --git a/util.c b/util.c
index 5d7f9a0..22e3334 100644
--- a/util.c
+++ b/util.c
@@ -1,7 +1,7 @@
/* $Id$ */
/* ----------------------------------------------------------------------- *
*
- * Copyright 2001 H. Peter Anvin - All Rights Reserved
+ * Copyright 2001-2006 H. Peter Anvin - All Rights Reserved
*
* 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
@@ -11,12 +11,13 @@
*
* ----------------------------------------------------------------------- */
+#include "mkzftree.h" /* Must be included first! */
+
#include <stdio.h>
#include <errno.h>
#include <stdlib.h>
#include <stdarg.h>
#include <string.h>
-#include "mkzftree.h"
/* Convenience functions */
void *xmalloc(size_t size)
diff --git a/version b/version
index af0b7dd..238d6e8 100644
--- a/version
+++ b/version
@@ -1 +1 @@
-1.0.6
+1.0.7
diff --git a/walk.c b/walk.c
index 5e5ffb0..73f323a 100644
--- a/walk.c
+++ b/walk.c
@@ -1,7 +1,7 @@
#ident "$Id$"
/* ----------------------------------------------------------------------- *
*
- * Copyright 2001-2002 H. Peter Anvin - All Rights Reserved
+ * Copyright 2001-2006 H. Peter Anvin - All Rights Reserved
*
* 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
@@ -17,6 +17,8 @@
* Functions to walk the file tree
*/
+#include "mkzftree.h" /* Must be included first! */
+
#include <stdlib.h>
#include <stdio.h>
#include <limits.h>
@@ -26,7 +28,7 @@
#include <unistd.h>
#include <sys/stat.h>
#include <sys/types.h>
-#include "mkzftree.h"
+
#include "iso9660.h"
static int munge_file(const char *inpath, const char *outpath,
diff --git a/workers.c b/workers.c
index 21fd0ea..8ca92b3 100644
--- a/workers.c
+++ b/workers.c
@@ -1,7 +1,7 @@
#ident "$Id$"
/* ----------------------------------------------------------------------- *
*
- * Copyright 2001 H. Peter Anvin - All Rights Reserved
+ * Copyright 2001-2006 H. Peter Anvin - All Rights Reserved
*
* 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
@@ -17,13 +17,14 @@
* Parallel job maintenance
*/
+#include "mkzftree.h" /* Must be included first! */
+
#include <stddef.h>
#include <stdlib.h>
#include <unistd.h>
#include <signal.h>
#include <stdio.h>
#include <sys/wait.h>
-#include "mkzftree.h"
/* Global option */
extern int parallel; /* Number of parallel jobs */