projects
/
krb5.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e38cfbf
)
Implement SWAP16 for Mac without compiler warning
author
Ken Raeburn
<raeburn@mit.edu>
Sat, 22 Dec 2007 02:21:15 +0000
(
02:21
+0000)
committer
Ken Raeburn
<raeburn@mit.edu>
Sat, 22 Dec 2007 02:21:15 +0000
(
02:21
+0000)
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@20194
dc483132
-0cff-0310-8789-
dd5450dbe970
src/include/k5-platform.h
patch
|
blob
|
history
diff --git
a/src/include/k5-platform.h
b/src/include/k5-platform.h
index 90eddf5d7696e6e598756a3ed7e6395554ff494b..c9bcb8a52cf03d20e20f01417e8ac4295b17a69e 100644
(file)
--- 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