aboutsummaryrefslogtreecommitdiff
path: root/src/include/k5-platform.h
diff options
context:
space:
mode:
authorGreg Hudson <ghudson@mit.edu>2014-02-01 15:20:08 -0500
committerGreg Hudson <ghudson@mit.edu>2014-02-26 16:15:19 -0500
commit17e205070745e4712d40eed32d92d02edb47009f (patch)
tree7b84dc2f536d8c73da8155a186fbbc23c3b88dc1 /src/include/k5-platform.h
parent4c376a3776aed0fb19b761406eaa2e0516ff6735 (diff)
downloadkrb5-17e205070745e4712d40eed32d92d02edb47009f.zip
krb5-17e205070745e4712d40eed32d92d02edb47009f.tar.gz
krb5-17e205070745e4712d40eed32d92d02edb47009f.tar.bz2
Assume <stdint.h> and fixed-width types
Make unconditional use of <stdint.h> and fixed-width types such as uint32_t. k5-plugin.h doesn't use any special integer types, so remove the conditional include block there. Nothing uses INT64_FMT/UINT64_FMT, so leave those out of k5-platform.h for now.
Diffstat (limited to 'src/include/k5-platform.h')
-rw-r--r--src/include/k5-platform.h39
1 files changed, 3 insertions, 36 deletions
diff --git a/src/include/k5-platform.h b/src/include/k5-platform.h
index 8f0ca9f..537c8ad 100644
--- a/src/include/k5-platform.h
+++ b/src/include/k5-platform.h
@@ -52,6 +52,7 @@
#include <assert.h>
#include <string.h>
#include <stdarg.h>
+#include <stdint.h>
#include <limits.h>
#include <stdlib.h>
#include <stdio.h>
@@ -410,42 +411,13 @@ typedef struct { int error; unsigned char did_run; } k5_init_t;
#endif
-
-/* 64-bit support: krb5_ui_8 and krb5_int64.
-
- This should move to krb5.h eventually, but without the namespace
- pollution from the autoconf macros. */
-#if defined(HAVE_STDINT_H) || defined(HAVE_INTTYPES_H)
-# ifdef HAVE_STDINT_H
-# include <stdint.h>
-# endif
-# ifdef HAVE_INTTYPES_H
-# include <inttypes.h>
-# endif
-# define INT64_TYPE int64_t
-# define UINT64_TYPE uint64_t
-# define INT64_FMT PRId64
-# define UINT64_FMT PRIu64
-#elif defined(_WIN32)
-# define INT64_TYPE signed __int64
-# define UINT64_TYPE unsigned __int64
-# define INT64_FMT "I64d"
-# define UINT64_FMT "I64u"
-#else /* not Windows, and neither stdint.h nor inttypes.h */
-# define INT64_TYPE signed long long
-# define UINT64_TYPE unsigned long long
-# define INT64_FMT "lld"
-# define UINT64_FMT "llu"
-#endif
+#define INT64_TYPE int64_t
+#define UINT64_TYPE uint64_t
#ifndef SIZE_MAX
# define SIZE_MAX ((size_t)((size_t)0 - 1))
#endif
-#ifndef UINT64_MAX
-# define UINT64_MAX ((UINT64_TYPE)((UINT64_TYPE)0 - 1))
-#endif
-
#ifdef _WIN32
# define SSIZE_MAX ((ssize_t)(SIZE_MAX/2))
#endif
@@ -743,13 +715,8 @@ load_64_le (const void *cvp)
#endif
}
-#ifdef _WIN32
-#define UINT16_TYPE unsigned __int16
-#define UINT32_TYPE unsigned __int32
-#else
#define UINT16_TYPE uint16_t
#define UINT32_TYPE uint32_t
-#endif
static inline void
store_16_n (unsigned int val, void *vp)