More pre-C99 inttypes.h compatibility fixes. Now the code
authorLasse Collin <lasse.collin@tukaani.org>
Mon, 7 Jan 2008 22:48:30 +0000 (00:48 +0200)
committerLasse Collin <lasse.collin@tukaani.org>
Mon, 7 Jan 2008 22:48:30 +0000 (00:48 +0200)
should work even if the system has no inttypes.h.

src/common/physmem.h
src/liblzma/check/crc32_init.c
src/liblzma/check/crc32_tablegen.c
src/liblzma/check/crc64_init.c
src/liblzma/check/crc64_tablegen.c

index 1d40b29..597227a 100644 (file)
 #ifndef PHYSMEM_H
 #define PHYSMEM_H
 
-#ifdef HAVE_CONFIG_H
-#      include <config.h>
-#endif
-
-#include <sys/types.h>
-#include <inttypes.h>
-
-#ifdef HAVE_LIMITS_H
-#      include <limits.h>
-#endif
-
 #if defined(HAVE_PHYSMEM_SYSCTL) || defined(HAVE_NCPU_SYSCTL)
 #      ifdef HAVE_SYS_PARAM_H
 #              include <sys/param.h>
index eee9040..996ad26 100644 (file)
 ///////////////////////////////////////////////////////////////////////////////
 
 #ifdef HAVE_CONFIG_H
-#      include <config.h>
+#      include "sysdefs.h"
 #endif
 
-#include <sys/types.h>
-#include <inttypes.h>
-
 #ifdef WORDS_BIGENDIAN
 #      include "check_byteswap.h"
 #endif
index f05d753..f793d59 100644 (file)
@@ -3,7 +3,7 @@
 /// \file       crc32_tablegen.c
 /// \brief      Generates CRC32 crc32_table.c
 ///
-/// Compiling: gcc -std=c99 -o crc32_tablegen crc32_tablegen.c crc32_init.c
+/// Compiling: gcc -std=c99 -o crc32_tablegen crc32_tablegen.c
 /// Add -DWORDS_BIGENDIAN to generate big endian table.
 //
 //  This code has been put into the public domain.
 #include <inttypes.h>
 #include <stdio.h>
 
-
-extern void lzma_crc32_init(void);
-
-extern uint32_t lzma_crc32_table[8][256];
+#include "crc32_init.c"
 
 
 int
index 49c59e9..b0963f6 100644 (file)
 ///////////////////////////////////////////////////////////////////////////////
 
 #ifdef HAVE_CONFIG_H
-#      include <config.h>
+#      include "sysdefs.h"
 #endif
 
-#include <sys/types.h>
-#include <inttypes.h>
-
 #ifdef WORDS_BIGENDIAN
 #      include "check_byteswap.h"
 #endif
index 4b35ac1..78e3906 100644 (file)
@@ -3,7 +3,7 @@
 /// \file       crc64_tablegen.c
 /// \brief      Generates CRC64 crc64_table.c
 ///
-/// Compiling: gcc -std=c99 -o crc64_tablegen crc64_tablegen.c crc64_init.c
+/// Compiling: gcc -std=c99 -o crc64_tablegen crc64_tablegen.c
 /// Add -DWORDS_BIGENDIAN to generate big endian table.
 //
 //  This code has been put into the public domain.
 #include <inttypes.h>
 #include <stdio.h>
 
-
-extern void lzma_crc64_init(void);
-
-extern uint64_t lzma_crc64_table[4][256];
+#include "crc64_init.c"
 
 
 int