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

[Xen-devel] [PATCH v2] xen, tools: console.h shouldn't require string.h by default



Unilaterally making string.h a prerequisite for console.h is going to
break build for a lot of consumers of console.h.

Define a macro for the new flex ring. Consumers which want to use it
should define the macro.

Partially revert af8d9356417cb617b635c5ace782388ebfe86e3a.

Signed-off-by: Wei Liu <wei.liu2@xxxxxxxxxx>
---
Cc: Julien Grall <julien.grall@xxxxxxx>
Cc: Bhupinder Thakur <bhupinder.thakur@xxxxxxxxxx>
Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
Cc: George Dunlap <George.Dunlap@xxxxxxxxxxxxx>
Cc: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
Cc: Jan Beulich <jbeulich@xxxxxxxx>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>
Cc: Stefano Stabellini <sstabellini@xxxxxxxxxx>
Cc: Tim Deegan <tim@xxxxxxx>
Cc: Wei Liu <wei.liu2@xxxxxxxxxx>
---
 tools/console/daemon/io.c       | 2 +-
 xen/arch/arm/vpl011.c           | 2 ++
 xen/include/Makefile            | 1 -
 xen/include/public/io/console.h | 5 ++---
 4 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/tools/console/daemon/io.c b/tools/console/daemon/io.c
index afe162e9c2..e22009aa39 100644
--- a/tools/console/daemon/io.c
+++ b/tools/console/daemon/io.c
@@ -21,7 +21,6 @@
 
 #include "utils.h"
 #include "io.h"
-#include <string.h>
 #include <xenevtchn.h>
 #include <xengnttab.h>
 #include <xenstore.h>
@@ -30,6 +29,7 @@
 
 #include <stdlib.h>
 #include <errno.h>
+#include <string.h>
 #include <poll.h>
 #include <fcntl.h>
 #include <unistd.h>
diff --git a/xen/arch/arm/vpl011.c b/xen/arch/arm/vpl011.c
index 56d9cbe09e..f7ddccb42a 100644
--- a/xen/arch/arm/vpl011.c
+++ b/xen/arch/arm/vpl011.c
@@ -16,6 +16,8 @@
  * this program; If not, see <http://www.gnu.org/licenses/>.
  */
 
+#define XEN_WANT_FLEX_CONSOLE_RING 1
+
 #include <xen/errno.h>
 #include <xen/event.h>
 #include <xen/guest_access.h>
diff --git a/xen/include/Makefile b/xen/include/Makefile
index c90fdeee75..1299b1962f 100644
--- a/xen/include/Makefile
+++ b/xen/include/Makefile
@@ -98,7 +98,6 @@ PUBLIC_C99_HEADERS := public/io/9pfs.h public/io/pvcalls.h
 PUBLIC_ANSI_HEADERS := $(filter-out public/%ctl.h public/xsm/% 
public/%hvm/save.h $(PUBLIC_C99_HEADERS), $(PUBLIC_HEADERS))
 
 public/io/9pfs.h-prereq := string
-public/io/console.h-prereq := string
 public/io/pvcalls.h-prereq := string
 
 headers.chk: $(PUBLIC_ANSI_HEADERS) Makefile
diff --git a/xen/include/public/io/console.h b/xen/include/public/io/console.h
index 0f0711fbdb..4c32f51903 100644
--- a/xen/include/public/io/console.h
+++ b/xen/include/public/io/console.h
@@ -27,8 +27,6 @@
 #ifndef __XEN_PUBLIC_IO_CONSOLE_H__
 #define __XEN_PUBLIC_IO_CONSOLE_H__
 
-#include "ring.h"
-
 typedef uint32_t XENCONS_RING_IDX;
 
 #define MASK_XENCONS_IDX(idx, ring) ((idx) & (sizeof(ring)-1))
@@ -40,7 +38,8 @@ struct xencons_interface {
     XENCONS_RING_IDX out_cons, out_prod;
 };
 
-#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
+#if defined(XEN_WANT_FLEX_CONSOLE_RING)
+#include "ring.h"
 DEFINE_XEN_FLEX_RING(xencons);
 #endif
 
-- 
2.11.0


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
https://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.