From 4bb06dac53226ad0a0791ca4a8a26c575e23e20f Mon Sep 17 00:00:00 2001 From: Ken Raeburn Date: Sat, 22 Dec 2007 02:21:15 +0000 Subject: [PATCH] Implement SWAP16 for Mac without compiler warning git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@20194 dc483132-0cff-0310-8789-dd5450dbe970 --- src/include/k5-platform.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/include/k5-platform.h b/src/include/k5-platform.h index 90eddf5d7..c9bcb8a52 100644 --- a/src/include/k5-platform.h +++ b/src/include/k5-platform.h @@ -520,7 +520,15 @@ typedef struct { int error; unsigned char did_run; } k5_init_t; #endif #if TARGET_OS_MAC # include -# define SWAP16 OSSwapInt16 +# if 0 /* This causes compiler warnings. */ +# define SWAP16 OSSwapInt16 +# else +# define SWAP16 k5_swap16 +static inline unsigned int k5_swap16 (unsigned int x) { + x &= 0xffff; + return (x >> 8) | ((x & 0xff) << 8); +} +# endif # define SWAP32 OSSwapInt32 # define SWAP64 OSSwapInt64 #endif -- 2.26.2