[Spice-devel] [usbredir PATCH 2/6] usbredirhost: undef ERROR if already defined

Christophe Fergeau cfergeau at redhat.com
Thu May 3 08:46:00 PDT 2012


There's an unrelated white space change in there, apart from this, ACK

Christophe

On Thu, May 03, 2012 at 06:04:35PM +0300, Uri Lublin wrote:
> On Windows (mingw), ERROR is already defined (to i0)
> 
> This fixes the following compiler warning:
>   warning: "ERROR" redefined [enabled by default]
> ---
>  usbredirhost/usbredirhost.c |    4 ++++
>  1 files changed, 4 insertions(+), 0 deletions(-)
> 
> diff --git a/usbredirhost/usbredirhost.c b/usbredirhost/usbredirhost.c
> index 1dfaee1..068ea1d 100644
> --- a/usbredirhost/usbredirhost.c
> +++ b/usbredirhost/usbredirhost.c
> @@ -142,6 +142,9 @@ static void va_log(struct usbredirhost *host, int level,
>      host->log_func(host->func_priv, level, buf);
>  }
> 
> +#ifdef ERROR /* defined on WIN32 */
> +#undef ERROR
> +#endif
>  #define ERROR(...)   va_log(host, usbredirparser_error, \
>                              "usbredirhost error: " __VA_ARGS__)
>  #define WARNING(...) va_log(host, usbredirparser_warning, \
> @@ -447,6 +450,7 @@ static int usbredirhost_claim(struct usbredirhost *host, int initial_claim)
>          ERROR("could not get descriptors for active configuration: %d", r);
>          return libusb_status_or_error_to_redir_status(host, r);
>      }
> +
>      if (host->config && host->config->bNumInterfaces > MAX_INTERFACES) {
>          ERROR("usb decriptor has too much intefaces (%d > %d)",
>                (int)host->config->bNumInterfaces, MAX_INTERFACES);
> -- 
> 1.7.7.6
> 
> _______________________________________________
> Spice-devel mailing list
> Spice-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/spice-devel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/spice-devel/attachments/20120503/3f51fb7d/attachment.pgp>


More information about the Spice-devel mailing list