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

Christophe Fergeau cfergeau at redhat.com
Fri Mar 9 15:37:20 UTC 2018


On Fri, Mar 09, 2018 at 01:06:39PM +0000, Frediano Ziglio wrote:
> Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
> ---
>  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)

I don't even know if they are going to be used? The only potential user
would be the QXL drivers, and they don't seem to be using that macro.
Not really a problem to have these anyway,

Acked-by: Christophe Fergeau <cfergeau at redhat.com>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/spice-devel/attachments/20180309/fd0f2bac/attachment.sig>


More information about the Spice-devel mailing list