Re: [vdagent-win PATCH] Reuse spice-protocol macros instead of defining new ones for alignment

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

 



> 
> Signed-off-by: Frediano Ziglio <fziglio@xxxxxxxxxx>
> ---
>  common/vdcommon.h   | 8 --------
>  vdagent/vdagent.cpp | 6 ++++--
>  2 files changed, 4 insertions(+), 10 deletions(-)
> 
> diff --git a/common/vdcommon.h b/common/vdcommon.h
> index c1920e9..ac58efe 100644
> --- a/common/vdcommon.h
> +++ b/common/vdcommon.h
> @@ -67,14 +67,6 @@ typedef Mutex mutex_t;
>  #define VD_AGENT_REGISTRY_KEY "SOFTWARE\\Red Hat\\Spice\\vdagent\\"
>  #define VD_AGENT_STOP_EVENT   TEXT("Global\\vdagent_stop_event")
>  
> -#if defined __GNUC__
> -#define ALIGN_GCC __attribute__ ((packed))
> -#define ALIGN_VC
> -#else
> -#define ALIGN_GCC
> -#define ALIGN_VC __declspec (align(1))
> -#endif
> -
>  /*
>   * Note: OLDMSVCRT, which is defined (in the Makefile) for mingw builds, and
>   * is not defined for Visual Studio builds.
> diff --git a/vdagent/vdagent.cpp b/vdagent/vdagent.cpp
> index 2fbcce8..6dc3dee 100644
> --- a/vdagent/vdagent.cpp
> +++ b/vdagent/vdagent.cpp
> @@ -55,10 +55,12 @@ static const VDClipboardFormat clipboard_formats[] = {
>  
>  #define clipboard_formats_count SPICE_N_ELEMENTS(clipboard_formats)
>  
> -typedef struct ALIGN_VC VDIChunk {
> +#include <spice/start-packed.h>
> +typedef struct VDIChunk {

Forgot... added SPICE_ATTR_PACKED after "struct"

>      VDIChunkHeader hdr;
>      uint8_t data[0];
> -} ALIGN_GCC VDIChunk;
> +} VDIChunk;
> +#include <spice/end-packed.h>
>  
>  #define VD_MESSAGE_HEADER_SIZE (sizeof(VDIChunk) + sizeof(VDAgentMessage))
>  #define VD_READ_BUF_SIZE       (sizeof(VDIChunk) + VD_AGENT_MAX_DATA_SIZE)

Frediano
_______________________________________________
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]