aboutsummaryrefslogtreecommitdiff
path: root/src/liblzma/check
diff options
context:
space:
mode:
authorLasse Collin <lasse.collin@tukaani.org>2008-01-06 16:27:41 +0200
committerLasse Collin <lasse.collin@tukaani.org>2008-01-06 16:27:41 +0200
commit4e7e54c4c522ab2f6a7abb92cefc4f707e9568fb (patch)
tree852cde1e5bef3e46c5415884e283ef874f8eed73 /src/liblzma/check
parentFix typo in comment (INT64_MAX -> UINT64_MAX). (diff)
downloadxz-4e7e54c4c522ab2f6a7abb92cefc4f707e9568fb.tar.xz
Introduced compatibility with systems that have pre-C99
or no inttypes.h. This is useful when the compiler has good enough support for C99, but libc headers don't. Changed liblzma API so that sys/types.h and inttypes.h have to be #included before #including lzma.h. On systems that don't have C99 inttypes.h, it's the problem of the applications to provide the required types and macros before #including lzma.h. If lzma.h defined the missing types and macros, it could conflict with third-party applications whose configure has detected that the types are missing and defined them in config.h already. An alternative would have been introducing lzma_uint32 and similar types, but that would just be an extra pain on modern systems.
Diffstat (limited to '')
-rw-r--r--src/liblzma/check/crc32_table.c4
-rw-r--r--src/liblzma/check/crc32_table_be.h2
-rw-r--r--src/liblzma/check/crc32_table_le.h2
-rw-r--r--src/liblzma/check/crc32_tablegen.c1
-rw-r--r--src/liblzma/check/crc64_table.c4
-rw-r--r--src/liblzma/check/crc64_table_be.h2
-rw-r--r--src/liblzma/check/crc64_table_le.h2
-rw-r--r--src/liblzma/check/crc64_tablegen.c1
8 files changed, 2 insertions, 16 deletions
diff --git a/src/liblzma/check/crc32_table.c b/src/liblzma/check/crc32_table.c
index b59642d4..f1cc0daf 100644
--- a/src/liblzma/check/crc32_table.c
+++ b/src/liblzma/check/crc32_table.c
@@ -11,9 +11,7 @@
//
///////////////////////////////////////////////////////////////////////////////
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
+#include "sysdefs.h"
#ifdef WORDS_BIGENDIAN
# include "crc32_table_be.h"
diff --git a/src/liblzma/check/crc32_table_be.h b/src/liblzma/check/crc32_table_be.h
index bc5a5fbd..f4f4e365 100644
--- a/src/liblzma/check/crc32_table_be.h
+++ b/src/liblzma/check/crc32_table_be.h
@@ -1,7 +1,5 @@
/* This file has been automatically generated by crc32_tablegen.c. */
-#include <inttypes.h>
-
const uint32_t lzma_crc32_table[8][256] = {
{
0x00000000, 0x96300777, 0x2C610EEE, 0xBA510999,
diff --git a/src/liblzma/check/crc32_table_le.h b/src/liblzma/check/crc32_table_le.h
index a96d772a..7b816665 100644
--- a/src/liblzma/check/crc32_table_le.h
+++ b/src/liblzma/check/crc32_table_le.h
@@ -1,7 +1,5 @@
/* This file has been automatically generated by crc32_tablegen.c. */
-#include <inttypes.h>
-
const uint32_t lzma_crc32_table[8][256] = {
{
0x00000000, 0x77073096, 0xEE0E612C, 0x990951BA,
diff --git a/src/liblzma/check/crc32_tablegen.c b/src/liblzma/check/crc32_tablegen.c
index 280d3b12..f05d7536 100644
--- a/src/liblzma/check/crc32_tablegen.c
+++ b/src/liblzma/check/crc32_tablegen.c
@@ -31,7 +31,6 @@ main()
printf("/* This file has been automatically generated by "
"crc32_tablegen.c. */\n\n"
- "#include <inttypes.h>\n\n"
"const uint32_t lzma_crc32_table[8][256] = {\n\t{");
for (size_t s = 0; s < 8; ++s) {
diff --git a/src/liblzma/check/crc64_table.c b/src/liblzma/check/crc64_table.c
index 0f2d1fb1..2f227319 100644
--- a/src/liblzma/check/crc64_table.c
+++ b/src/liblzma/check/crc64_table.c
@@ -11,9 +11,7 @@
//
///////////////////////////////////////////////////////////////////////////////
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
+#include "sysdefs.h"
#ifdef WORDS_BIGENDIAN
# include "crc64_table_be.h"
diff --git a/src/liblzma/check/crc64_table_be.h b/src/liblzma/check/crc64_table_be.h
index 99518400..2d2794fe 100644
--- a/src/liblzma/check/crc64_table_be.h
+++ b/src/liblzma/check/crc64_table_be.h
@@ -1,7 +1,5 @@
/* This file has been automatically generated by crc64_tablegen.c. */
-#include <inttypes.h>
-
const uint64_t lzma_crc64_table[4][256] = {
{
UINT64_C(0x0000000000000000), UINT64_C(0x6F5FA703BE4C2EB3),
diff --git a/src/liblzma/check/crc64_table_le.h b/src/liblzma/check/crc64_table_le.h
index 3047ea16..6f82cad1 100644
--- a/src/liblzma/check/crc64_table_le.h
+++ b/src/liblzma/check/crc64_table_le.h
@@ -1,7 +1,5 @@
/* This file has been automatically generated by crc64_tablegen.c. */
-#include <inttypes.h>
-
const uint64_t lzma_crc64_table[4][256] = {
{
UINT64_C(0x0000000000000000), UINT64_C(0xB32E4CBE03A75F6F),
diff --git a/src/liblzma/check/crc64_tablegen.c b/src/liblzma/check/crc64_tablegen.c
index 0f1005f4..4b35ac1f 100644
--- a/src/liblzma/check/crc64_tablegen.c
+++ b/src/liblzma/check/crc64_tablegen.c
@@ -31,7 +31,6 @@ main()
printf("/* This file has been automatically generated by "
"crc64_tablegen.c. */\n\n"
- "#include <inttypes.h>\n\n"
"const uint64_t lzma_crc64_table[4][256] = {\n\t{");
for (size_t s = 0; s < 4; ++s) {