aboutsummaryrefslogtreecommitdiff
path: root/src/include/k5-platform.h
diff options
context:
space:
mode:
authorKen Raeburn <raeburn@mit.edu>2007-12-22 02:21:15 +0000
committerKen Raeburn <raeburn@mit.edu>2007-12-22 02:21:15 +0000
commit4bb06dac53226ad0a0791ca4a8a26c575e23e20f (patch)
tree5d4a93d0fa5c0ae4b0bc8bd5d7074455d7c5d380 /src/include/k5-platform.h
parente38cfbf9a4cd22b42c6a26b69903e14961c27435 (diff)
downloadkrb5-4bb06dac53226ad0a0791ca4a8a26c575e23e20f.zip
krb5-4bb06dac53226ad0a0791ca4a8a26c575e23e20f.tar.gz
krb5-4bb06dac53226ad0a0791ca4a8a26c575e23e20f.tar.bz2
Implement SWAP16 for Mac without compiler warning
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@20194 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/include/k5-platform.h')
-rw-r--r--src/include/k5-platform.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/include/k5-platform.h b/src/include/k5-platform.h
index 90eddf5..c9bcb8a 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 <architecture/byte_order.h>
-# 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