From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Campbell Subject: Re: [PATCH for-4.5] libxl: expose #define to 4.5 and above Date: Wed, 3 Dec 2014 10:50:34 +0000 Message-ID: <1417603834.11243.9.camel@citrix.com> References: <1417603298-4213-1-git-send-email-wei.liu2@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1417603298-4213-1-git-send-email-wei.liu2@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Wei Liu , Konrad Rzeszutek Wilk Cc: Andrew Cooper , Ian Jackson , xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org On Wed, 2014-12-03 at 10:41 +0000, Wei Liu wrote: > In e3abab74 (libxl: un-constify return value of libxl_basename), the > macro was exposed to releases < 4.5. However only new code is able to > make use of that macro so it should be exposed to releases >= 4.5. > > Signed-off-by: Wei Liu > Cc: Ian Campbell > Cc: Ian Jackson > Cc: Andrew Cooper Acked-by: Ian Campbell Konrad, given that the original patch is in 4.5 (as of yesterday) we should obviously take this one too. > --- > tools/libxl/libxl.h | 6 +++--- > tools/libxl/libxl_utils.c | 2 +- > tools/libxl/libxl_utils.h | 2 +- > 3 files changed, 5 insertions(+), 5 deletions(-) > > diff --git a/tools/libxl/libxl.h b/tools/libxl/libxl.h > index 291c190..0a123f1 100644 > --- a/tools/libxl/libxl.h > +++ b/tools/libxl/libxl.h > @@ -478,13 +478,13 @@ typedef struct libxl__ctx libxl_ctx; > #endif > > /* > - * LIBXL_HAVE_CONST_LIBXL_BASENAME_RETURN_VALUE > + * LIBXL_HAVE_NONCONST_LIBXL_BASENAME_RETURN_VALUE > * > * The return value of libxl_basename is malloc'ed but the erroneously > * marked as "const" in releases before 4.5. > */ > -#if defined(LIBXL_API_VERSION) && LIBXL_API_VERSION < 0x040500 > -#define LIBXL_HAVE_CONST_LIBXL_BASENAME_RETURN_VALUE 1 > +#if !defined(LIBXL_API_VERSION) || LIBXL_API_VERSION >= 0x040500 > +#define LIBXL_HAVE_NONCONST_LIBXL_BASENAME_RETURN_VALUE 1 > #endif > > /* > diff --git a/tools/libxl/libxl_utils.c b/tools/libxl/libxl_utils.c > index 22119fc..7095b58 100644 > --- a/tools/libxl/libxl_utils.c > +++ b/tools/libxl/libxl_utils.c > @@ -19,7 +19,7 @@ > > #include "libxl_internal.h" > > -#ifdef LIBXL_HAVE_CONST_LIBXL_BASENAME_RETURN_VALUE > +#ifndef LIBXL_HAVE_NONCONST_LIBXL_BASENAME_RETURN_VALUE > const > #endif > char *libxl_basename(const char *name) > diff --git a/tools/libxl/libxl_utils.h b/tools/libxl/libxl_utils.h > index 8277eb9..acacdd9 100644 > --- a/tools/libxl/libxl_utils.h > +++ b/tools/libxl/libxl_utils.h > @@ -18,7 +18,7 @@ > > #include "libxl.h" > > -#ifdef LIBXL_HAVE_CONST_LIBXL_BASENAME_RETURN_VALUE > +#ifndef LIBXL_HAVE_NONCONST_LIBXL_BASENAME_RETURN_VALUE > const > #endif > char *libxl_basename(const char *name); /* returns string from strdup */