1
0
mirror of https://github.com/OlafvdSpek/ctemplate.git synced 2025-09-28 19:05:49 +08:00

Use <cstdint>

This commit is contained in:
Olaf van der Spek 2017-01-30 11:26:45 +01:00
parent dfc73bec45
commit 65f080f2b4
5 changed files with 3 additions and 23 deletions

View File

@ -58,15 +58,6 @@ AC_CHECK_FUNCS([getopt_long getopt])
AC_CHECK_HEADERS([getopt.h])
AC_CHECK_HEADERS([utime.h]) # used by unittests to mock file-times
# These are the types I need. We look for them in either stdint.h,
# sys/types.h, or inttypes.h, all of which are part of the default-includes.
AC_CHECK_TYPES([uint32_t])
AC_CHECK_TYPES([u_int32_t])
AC_CHECK_TYPES([__int32])
AC_CHECK_TYPES([uint64_t])
AC_CHECK_TYPES([u_int64_t])
AC_CHECK_TYPES([__int64])
AC_HEADER_DIRENT # for template_unittest.cc, template_regtest.cc
# We need to do byte-swapping efficiently to hash efficiently in

View File

@ -55,7 +55,6 @@
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif // last place uintptr_t might be
#include "base/macros.h" // for uint64
#include "base/mutex.h"
#include "base/util.h" // for DCHECK_*

View File

@ -273,10 +273,10 @@
#include <config.h>
#include "base/mutex.h" // must go first to get _XOPEN_SOURCE
#include <assert.h>
#include <cstdint>
#include <string.h>
#include <vector>
#include "base/thread_annotations.h"
#include "base/macros.h"
#include "base/util.h" // for CHECK, etc
namespace ctemplate {

View File

@ -9,17 +9,7 @@
#define CTEMPLATE_MACROS_H_
#include <config.h>
#ifdef HAVE_STDINT_H
#include <stdint.h> // the normal place uint32_t is defined
#endif
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h> // the normal place u_int32_t is defined
#endif
#ifdef HAVE_INTTYPES_H
#ifdef HAVE_INTTYPES_H
# include <inttypes.h>
#endif // a third place for uint32_t or u_int32_t
#endif
#include <cstdint>
// This is all to figure out endian-ness and byte-swapping on various systems
#if defined(HAVE_ENDIAN_H)

View File

@ -110,7 +110,7 @@ struct @ac_windows_dllexport@ StringHash {
// ----------------------- THE CLASSES -------------------------------
typedef @ac_cv_uint64@ TemplateId;
typedef uint64_t TemplateId;
const TemplateId kIllegalTemplateId = 0;