From: "Jan Beulich" Subject: [PATCH] libxl: fix build for gcc prior to 4.3 Date: Wed, 08 Aug 2012 11:25:49 +0100 Message-ID: <50225ACD020000780009380F@nat28.tlf.novell.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=__Part99A8E6BD.0__=" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel List-Id: xen-devel@lists.xenproject.org This is a MIME message. If you are reading this text, you may want to consider changing to a mail reader or gateway that understands how to properly handle MIME multipart messages. --=__Part99A8E6BD.0__= Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Content-Disposition: inline So far all we (explicitly) require is gcc 3.4 or better, so we shouldn't be unconditionally using features supported only by much newer versions. Short of a proper replacement, use the "deprecated" attribute instead: It also produces a warning (thus causing the build to fail due to -Werror), and is at least getting close to the intention here. Signed-off-by: Jan Beulich --- a/tools/libxl/libxl_internal.h +++ b/tools/libxl/libxl_internal.h @@ -55,8 +55,12 @@ #ifdef LIBXL_H # error libxl.h should be included via libxl_internal.h, not separately #endif -#define LIBXL_EXTERNAL_CALLERS_ONLY \ +#if __GNUC__ > 4 || (__GNUC__ =3D=3D 4 && __GNUC_MINOR__ >=3D 3) +# define LIBXL_EXTERNAL_CALLERS_ONLY \ __attribute__((warning("may not be called from within libxl"))) +#else +# define LIBXL_EXTERNAL_CALLERS_ONLY __attribute__((__deprecated__)) +#endif =20 #include "libxl.h" #include "_paths.h" --=__Part99A8E6BD.0__= Content-Type: text/plain; name="libxl-build-gcc-pre-4.3.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="libxl-build-gcc-pre-4.3.patch" libxl: fix build for gcc prior to 4.3=0A=0ASo far all we (explicitly) = require is gcc 3.4 or better, so we=0Ashouldn't be unconditionally using = features supported only by much=0Anewer versions.=0A=0AShort of a proper = replacement, use the "deprecated" attribute instead:=0AIt also produces a = warning (thus causing the build to fail due to=0A-Werror), and is at least = getting close to the intention here.=0A=0ASigned-off-by: Jan Beulich = =0A=0A--- a/tools/libxl/libxl_internal.h=0A+++ = b/tools/libxl/libxl_internal.h=0A@@ -55,8 +55,12 @@=0A #ifdef LIBXL_H=0A # = error libxl.h should be included via libxl_internal.h, not separately=0A = #endif=0A-#define LIBXL_EXTERNAL_CALLERS_ONLY \=0A+#if __GNUC__ > 4 || = (__GNUC__ =3D=3D 4 && __GNUC_MINOR__ >=3D 3)=0A+# define LIBXL_EXTERNAL_CAL= LERS_ONLY \=0A __attribute__((warning("may not be called from within = libxl")))=0A+#else=0A+# define LIBXL_EXTERNAL_CALLERS_ONLY __attribute__((_= _deprecated__))=0A+#endif=0A =0A #include "libxl.h"=0A #include "_paths.h"= =0A --=__Part99A8E6BD.0__= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel --=__Part99A8E6BD.0__=--