[PATCH spice-protocol 2/2] macros: Use Visual C++ built-ins for byte swapping if available

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Frediano Ziglio <fziglio@xxxxxxxxxx>
---
 spice/macros.h | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/spice/macros.h b/spice/macros.h
index 023fd6a..ab1d056 100644
--- a/spice/macros.h
+++ b/spice/macros.h
@@ -252,6 +252,10 @@
 #  define SPICE_BYTESWAP16(val) __builtin_bswap16(val)
 #  define SPICE_BYTESWAP32(val) __builtin_bswap32(val)
 #  define SPICE_BYTESWAP64(val) __builtin_bswap64(val)
+#elif defined(_MSC_VER)
+#  define SPICE_BYTESWAP16(val) _byteswap_ushort(val)
+#  define SPICE_BYTESWAP32(val) _byteswap_ulong(val)
+#  define SPICE_BYTESWAP64(val) _byteswap_uint64(val)
 #else /* generic */
 #  define SPICE_BYTESWAP16(val) (SPICE_BYTESWAP16_CONSTANT (val))
 #  define SPICE_BYTESWAP32(val) (SPICE_BYTESWAP32_CONSTANT (val))
-- 
2.14.3

_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/spice-devel




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]