svn rev #23741: trunk/src/include/

raeburn@MIT.EDU raeburn at MIT.EDU
Sat Feb 20 02:37:13 EST 2010


http://src.mit.edu/fisheye/changelog/krb5/?cs=23741
Commit By: raeburn
Log Message:
Use bswap16 and bswap32 on NetBSD.


Changed Files:
U   trunk/src/include/k5-platform.h
Modified: trunk/src/include/k5-platform.h
===================================================================
--- trunk/src/include/k5-platform.h	2010-02-20 04:26:53 UTC (rev 23740)
+++ trunk/src/include/k5-platform.h	2010-02-20 07:37:13 UTC (rev 23741)
@@ -526,8 +526,7 @@
 # ifdef HAVE_BSWAP_64
 #  define SWAP64                bswap_64
 # endif
-#endif
-#if TARGET_OS_MAC
+#elif TARGET_OS_MAC
 # include <architecture/byte_order.h>
 # if 0 /* This causes compiler warnings.  */
 #  define SWAP16                OSSwapInt16
@@ -540,6 +539,19 @@
 # endif
 # define SWAP32                 OSSwapInt32
 # define SWAP64                 OSSwapInt64
+#elif defined(HAVE_SYS_BSWAP_H)
+/* XXX NetBSD/x86 5.0.1 defines bswap16 and bswap32 as inline
+   functions only, so autoconf doesn't pick up on their existence.
+   So, no feature macro test for them here.  The 64-bit version isn't
+   inline at all, though, for whatever reason.  */
+# include <sys/bswap.h>
+# define SWAP16                 bswap16
+# define SWAP32                 bswap32
+/* However, bswap64 causes lots of warnings about 'long long'
+   constants; probably only on 32-bit platforms.  */
+# if LONG_MAX > 0x7fffffffL
+#  define SWAP64                bswap64
+# endif
 #endif
 
 /* Note that on Windows at least this file can be included from C++




More information about the cvs-krb5 mailing list