From 418dd986e5d61283ea4faf3b0e297460edc423cd Mon Sep 17 00:00:00 2001 From: Asanka Herath Date: Wed, 26 Aug 2009 14:44:13 -0400 Subject: [PATCH] Add bit-types to roken.h so that we don't need to include krb5-types.h everywhere --- lib/roken/roken.h.in | 32 +++++++++++++++++++++++++++++--- 1 file changed, 29 insertions(+), 3 deletions(-) diff --git a/lib/roken/roken.h.in b/lib/roken/roken.h.in index 977bb445e..6c74de535 100644 --- a/lib/roken/roken.h.in +++ b/lib/roken/roken.h.in @@ -95,6 +95,24 @@ typedef int SOCKET; #include +#ifndef __BIT_TYPES_DEFINED__ +#define __BIT_TYPES_DEFINED__ + +typedef __int8 int8_t; +typedef __int16 int16_t; +typedef __int32 int32_t; +typedef __int64 int64_t; +typedef unsigned __int8 uint8_t; +typedef unsigned __int16 uint16_t; +typedef unsigned __int32 uint32_t; +typedef unsigned __int64 uint64_t; +typedef uint8_t u_int8_t; +typedef uint16_t u_int16_t; +typedef uint32_t u_int32_t; +typedef uint64_t u_int64_t; + +#endif /* __BIT_TYPES_DEFINED__ */ + #define UNREACHABLE(x) x #define UNUSED_ARGUMENT(x) ((void) x) @@ -221,14 +239,16 @@ ROKEN_CPP_START #ifdef _MSC_VER /* Additional macros for Visual C/C++ runtime */ -#define close _close +#define close _close -#define getpid _getpid +#define getpid _getpid -#define open _open +#define open _open #define chdir _chdir +#define fsync _commit + /* The MSVC implementation of snprintf is not C99 compliant. */ #define snprintf rk_snprintf #define vsnprintf rk_vsnprintf @@ -580,9 +600,13 @@ readv(int, const struct iovec *, int); #endif #ifndef HAVE_PIDFILE +#ifdef NO_PIDFILES +#define pidfile(x) ((void) 0) +#else #define pidfile rk_pidfile ROKEN_LIB_FUNCTION void ROKEN_LIB_CALL pidfile (const char*); #endif +#endif #ifndef HAVE_BSWAP32 #define bswap32 rk_bswap32 @@ -788,6 +812,8 @@ ROKEN_LIB_FUNCTION const char * ROKEN_LIB_CALL gai_strerror(int); #endif +#ifdef HAVE_WINSOCK + /* While we are at it, define WinSock specific scatter gather socket I/O. */