int_types.h: remove hacks to workaround old systems

Signed-off-by: Kefu Chai <kchai@redhat.com>
This commit is contained in:
Kefu Chai 2017-05-13 02:25:53 +08:00
parent 2a616ddbc3
commit 9a44857a09
3 changed files with 2 additions and 61 deletions

View File

@ -106,10 +106,8 @@ CHECK_FUNCTION_EXISTS(pthread_setname_np HAVE_PTHREAD_SETNAME_NP)
CHECK_FUNCTION_EXISTS(pthread_getname_np HAVE_PTHREAD_GETNAME_NP)
CHECK_FUNCTION_EXISTS(eventfd HAVE_EVENTFD)
CHECK_INCLUDE_FILES("inttypes.h" HAVE_INTTYPES_H)
CHECK_INCLUDE_FILES("linux/types.h" HAVE_LINUX_TYPES_H)
CHECK_INCLUDE_FILES("linux/version.h" HAVE_LINUX_VERSION_H)
CHECK_INCLUDE_FILES("stdint.h" HAVE_STDINT_H)
CHECK_INCLUDE_FILES("arpa/nameser_compat.h" HAVE_ARPA_NAMESER_COMPAT_H)
CHECK_INCLUDE_FILES("sys/mount.h" HAVE_SYS_MOUNT_H)
CHECK_INCLUDE_FILES("sys/param.h" HAVE_SYS_PARAM_H)

View File

@ -205,18 +205,12 @@
/* Define to 1 if you have fdatasync. */
#cmakedefine HAVE_FDATASYNC 1
/* Define to 1 if you have the <inttypes.h> header file. */
#cmakedefine HAVE_INTTYPES_H 1
/* Defined if you have librocksdb enabled */
#cmakedefine HAVE_LIBROCKSDB
/* Define to 1 if you have the <valgrind/helgrind.h> header file. */
#cmakedefine HAVE_VALGRIND_HELGRIND_H 1
/* Define to 1 if you have the <stdint.h> header file. */
#cmakedefine HAVE_STDINT_H 1
/* Define to 1 if you have the <sys/prctl.h> header file. */
#cmakedefine HAVE_SYS_PRCTL_H 1

View File

@ -3,62 +3,11 @@
#include "acconfig.h"
/*
* Get 64b integers either from inttypes.h or glib.h
*/
#ifdef HAVE_INTTYPES_H
# include <inttypes.h>
//#else
//# ifdef HAVE_GLIB
//# include <glib.h>
//# endif
#endif
#include <inttypes.h>
/*
* C99 says inttypes.h includes stdint.h, but that's not true on all
* systems. If it's there, include it always - just in case.
*/
#ifdef HAVE_STDINT_H
#include <stdint.h>
#endif
/*
* Include types.h after stdint.h to accomodate for older distributions
*
*/
#ifdef HAVE_LINUX_TYPES_H
#include <linux/types.h>
#endif
/*
* Emergency replacements for PRI*64 modifiers. Some systems have
* an inttypes.h that doesn't define all the PRI[doxu]64 macros.
*/
#if !defined(PRIu64)
# if defined(HAVE_INTTYPES_H) || defined(HAVE_GLIB)
/* If we have inttypes or glib, assume we have 64-bit long long int */
# define PRIu64 "llu"
# define PRIi64 "lli"
# define PRIx64 "llx"
# define PRIX64 "llX"
# define PRIo64 "llo"
# define PRId64 "lld"
# else
/* Assume that we don't have long long, so use long int modifiers */
# define PRIu64 "lu"
# define PRIi64 "li"
# define PRIx64 "lx"
# define PRIX64 "lX"
# define PRIo64 "lo"
# define PRId64 "ld"
# endif
#endif
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#ifndef HAVE_LINUX_TYPES_H
#else
#ifndef HAVE___U8
typedef uint8_t __u8;
#endif