diff options
author | Boris Brezillon <boris.brezillon@free-electrons.com> | 2016-11-25 18:30:40 +0100 |
---|---|---|
committer | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2016-12-06 19:37:45 +0100 |
commit | b2a9601cebb67db9e02ac7bbd927a21aa95f5ba3 (patch) | |
tree | 1f6315835a869e9027c55d71c0ceb0b660c1a0bf /include | |
parent | 15c21334b201dc54870cfd3e9697307c95f7e4dc (diff) |
common: Fix PRI{x,d}off definitions for x86_64 platform
Compiling for x86_64 generates a lot of warning because the PRIxoff_t and
PRIdoff_t are not properly defined, which comes from the missing
SIZEOF_LONG definition.
Use the autotools to generate a config.h header, include this header from
common.h and ask autoheader to generate the SIZEOF_LONG and SIZEOF_LOFF_T
definitions.
Use these new definitions to assign the proper descriptors to PRIxoff_t
and PRIdoff_t.
Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/common.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/include/common.h b/include/common.h index 4f0bb9b..93ef7f3 100644 --- a/include/common.h +++ b/include/common.h @@ -30,6 +30,8 @@ #include <inttypes.h> #include <sys/sysmacros.h> +#include "config.h" + #ifndef PROGRAM_NAME # error "You must define PROGRAM_NAME before including this header" #endif @@ -71,7 +73,7 @@ extern "C" { #define PRIxoff_t PRIx64 #define PRIdoff_t PRId64 #else -#if (SIZEOF_LONG >= 8) +#if (SIZEOF_LONG == SIZEOF_LOFF_T) #define PRIxoff_t "l"PRIx32 #define PRIdoff_t "l"PRId32 #else |