From: Ken Raeburn <raeburn@mit.edu>
Date: Mon, 5 Jan 2009 22:45:10 +0000 (+0000)
Subject: Define SWAP16 if not already defined
X-Git-Tag: krb5-1.7-alpha1~105
X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=c83458872a8510232e184d6ca200283d368fa422;p=krb5.git

Define SWAP16 if not already defined

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@21703 dc483132-0cff-0310-8789-dd5450dbe970
---

diff --git a/src/util/support/utf8_conv.c b/src/util/support/utf8_conv.c
index a8c9267ef..185dc4ba7 100644
--- a/src/util/support/utf8_conv.c
+++ b/src/util/support/utf8_conv.c
@@ -103,6 +103,9 @@ k5_utf8s_to_ucs2s(krb5_ucs2 *ucs2str,
 		
 	if (ucs2str != NULL) {
 #ifdef K5_BE
+#ifndef SWAP16
+#define SWAP16(X)	((((X) << 8) | ((X) >> 8)) & 0xFFFF)
+#endif
 	    if (little_endian)
 		ucs2str[ucs2len] = SWAP16(ch);
 	    else