aboutsummaryrefslogtreecommitdiffstats
path: root/tools/libxl/libxl_internal.c
diff options
context:
space:
mode:
authorKeir Fraser <keir.fraser@citrix.com>2009-11-23 07:00:08 +0000
committerKeir Fraser <keir.fraser@citrix.com>2009-11-23 07:00:08 +0000
commitaf7af769b97af63b70e38b607dc389d1b689e8bc (patch)
tree8186e2ec7f199bc8c98209b9ecf1c99f2ca34af2 /tools/libxl/libxl_internal.c
parentc14ce8a1257fbbc43c4196b186a7677209c6b12e (diff)
downloadxen-af7af769b97af63b70e38b607dc389d1b689e8bc.tar.gz
xen-af7af769b97af63b70e38b607dc389d1b689e8bc.tar.bz2
xen-af7af769b97af63b70e38b607dc389d1b689e8bc.zip
libxenlight: correct broken osdeps.[ch] and make #includes consistent
osdeps.[hc] previously mistakenly declared and defined [v]asprintf. These functions are available in the libc on most platforms. Also, osdeps.h is used by xc.c but xc.c is not part of the library, so osdeps.h is part of the public interface and should have a better name. So now, instead: * osdeps.h is libxl_osdeps.h. * _GNU_SOURCE is #defined in libxl_osdeps.h so that we get the system [v]asprintf (and various other functions) * libxl_osdeps.h is included first in every libxl*.c file (it needs to be before any system headers so that _GNU_SOURCE) takes effect. * osdeps.[hc] only provide their own reimplementation of [v]asprintf if NEED_OWN_ASPRINTF is defined. Currently it is not ever defined but this is provided for any platform which needs it. * While I was editing the #includes in each .c file, I put them all into the same order: "libxl_osdeps.h", then system headers, then local headers. * xs.h is included in libxl.h. This is needed for "bool"; it has to not be typedefed in libxl.h because otherwise we get a duplicate definition when including xs.h. Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Diffstat (limited to 'tools/libxl/libxl_internal.c')
-rw-r--r--tools/libxl/libxl_internal.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/tools/libxl/libxl_internal.c b/tools/libxl/libxl_internal.c
index 7ba0c9790f..a04ac8ddf7 100644
--- a/tools/libxl/libxl_internal.c
+++ b/tools/libxl/libxl_internal.c
@@ -12,13 +12,17 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*/
-#include "libxl.h"
-#include "libxl_internal.h"
-#include "libxl_utils.h"
+
+#include "libxl_osdeps.h"
+
#include <stdio.h>
#include <stdarg.h>
#include <string.h>
+#include "libxl.h"
+#include "libxl_internal.h"
+#include "libxl_utils.h"
+
int libxl_error_set(struct libxl_ctx *ctx, int code)
{
return 0;