From 9a44857a091f2f459f5e626bd4cc10bd062a0623 Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Sat, 13 May 2017 02:25:53 +0800 Subject: [PATCH] int_types.h: remove hacks to workaround old systems Signed-off-by: Kefu Chai --- CMakeLists.txt | 2 -- src/include/config-h.in.cmake | 6 ---- src/include/int_types.h | 55 ++--------------------------------- 3 files changed, 2 insertions(+), 61 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e33cf17744d..7258f9c60f3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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) diff --git a/src/include/config-h.in.cmake b/src/include/config-h.in.cmake index 8a903ef6108..4cc0c056b9c 100644 --- a/src/include/config-h.in.cmake +++ b/src/include/config-h.in.cmake @@ -205,18 +205,12 @@ /* Define to 1 if you have fdatasync. */ #cmakedefine HAVE_FDATASYNC 1 -/* Define to 1 if you have the header file. */ -#cmakedefine HAVE_INTTYPES_H 1 - /* Defined if you have librocksdb enabled */ #cmakedefine HAVE_LIBROCKSDB /* Define to 1 if you have the header file. */ #cmakedefine HAVE_VALGRIND_HELGRIND_H 1 -/* Define to 1 if you have the header file. */ -#cmakedefine HAVE_STDINT_H 1 - /* Define to 1 if you have the header file. */ #cmakedefine HAVE_SYS_PRCTL_H 1 diff --git a/src/include/int_types.h b/src/include/int_types.h index 2ffb162cc24..61ad7971392 100644 --- a/src/include/int_types.h +++ b/src/include/int_types.h @@ -3,62 +3,11 @@ #include "acconfig.h" -/* - * Get 64b integers either from inttypes.h or glib.h - */ -#ifdef HAVE_INTTYPES_H -# include -//#else -//# ifdef HAVE_GLIB -//# include -//# endif -#endif - -/* - * 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 -#endif +#include -/* - * Include types.h after stdint.h to accomodate for older distributions - * - */ #ifdef HAVE_LINUX_TYPES_H #include -#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 -#endif - -#ifndef HAVE_LINUX_TYPES_H +#else #ifndef HAVE___U8 typedef uint8_t __u8; #endif -- 2.39.5