libxc: Fix xc_pm.c build by avoiding bogus header includes.
authorKeir Fraser <keir.fraser@citrix.com>
Thu, 11 Dec 2008 11:19:27 +0000 (11:19 +0000)
committerKeir Fraser <keir.fraser@citrix.com>
Thu, 11 Dec 2008 11:19:27 +0000 (11:19 +0000)
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
tools/libxc/xc_pm.c
tools/libxc/xc_private.h

index f37cd1d55f99fc4d7ea0f1034261f998aa86ee74..6edb1a210f7f8feee6d333339efa1cfe8e0def53 100644 (file)
@@ -24,9 +24,7 @@
  */
 
 #include <errno.h>
-#include <curses.h>
-#include <linux/kernel.h>
-
+#include <stdbool.h>
 #include "xc_private.h"
 
 /*
@@ -256,8 +254,8 @@ int xc_get_cpufreq_para(int xc_handle, int cpuid,
                 sys_para->scaling_governor, CPUFREQ_NAME_LEN);
 
         /* copy to user_para no matter what cpufreq governor */
-        BUILD_BUG_ON(sizeof(((struct xc_get_cpufreq_para *)0)->u) !=
-                     sizeof(((struct xen_get_cpufreq_para *)0)->u));
+        XC_BUILD_BUG_ON(sizeof(((struct xc_get_cpufreq_para *)0)->u) !=
+                        sizeof(((struct xen_get_cpufreq_para *)0)->u));
 
         memcpy(&user_para->u, &sys_para->u, sizeof(sys_para->u));
     }
index 6e49b749a0b29a0fbc45c49ed3662673f60e1f90..ef8e3d2f7a4c5209793190b04e527736cdaf2f89 100644 (file)
@@ -43,6 +43,9 @@
 #define INFO     1
 #define PROGRESS 0
 
+/* Force a compilation error if condition is true */
+#define XC_BUILD_BUG_ON(p) ((void)sizeof(struct { int:-!!(p); }))
+
 /*
 ** Define max dirty page cache to permit during save/restore -- need to balance 
 ** keeping cache usage down with CPU impact of invalidating too often.