]> xenbits.xensource.com Git - people/dariof/xen.git/commitdiff
xen, tools: console.h shouldn't require string.h by default
authorWei Liu <wei.liu2@citrix.com>
Fri, 6 Oct 2017 17:41:09 +0000 (18:41 +0100)
committerWei Liu <wei.liu2@citrix.com>
Mon, 9 Oct 2017 08:57:02 +0000 (09:57 +0100)
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@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
tools/console/daemon/io.c
xen/arch/arm/vpl011.c
xen/include/Makefile
xen/include/public/io/console.h

index afe162e9c289a0784c11e0c0146a06a39e0d9a0c..e22009aa395cacca6c32f06c17f6f4dc8cac58e3 100644 (file)
@@ -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>
index 56d9cbe09ed43e3983e38231fbccc99311146304..f7ddccb42a6e2343dad355914ea11aa6e6d20c0d 100644 (file)
@@ -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>
index c90fdeee75d70dd321adbba9837572d685f3707c..1299b1962f3bc312bcb530c4ed02af53d527e36d 100644 (file)
@@ -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
index 0f0711fbdb88040c9d2c74587c17a2a57ab912c8..1f79ef8504059e130e8def56e2c906a3da712fac 100644 (file)
@@ -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__)
+#ifdef XEN_WANT_FLEX_CONSOLE_RING
+#include "ring.h"
 DEFINE_XEN_FLEX_RING(xencons);
 #endif