summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard W.M. Jones <rjones@redhat.com>2011-08-15 08:36:04 +0100
committerRichard W.M. Jones <rjones@redhat.com>2011-08-15 08:36:04 +0100
commit422d46d06a84d0b8194a53de4ad242dbeea85c52 (patch)
tree14c19bacc3da9cc004a202e4343f91282c276b99
parente0b21193257f9784b28e931525f2a382a74775c6 (diff)
downloadhivex-422d46d06a84d0b8194a53de4ad242dbeea85c52.tar.gz
hivex-422d46d06a84d0b8194a53de4ad242dbeea85c52.tar.xz
hivex-422d46d06a84d0b8194a53de4ad242dbeea85c52.zip
header: Fix including just <hivex.h>.
Also this adds a regression test so we don't break it in future.
-rw-r--r--.gitignore1
-rwxr-xr-xgenerator/generator.ml1
-rw-r--r--lib/Makefile.am15
-rw-r--r--lib/test-just-header.c30
4 files changed, 46 insertions, 1 deletions
diff --git a/.gitignore b/.gitignore
index 8b06c6a..cf49940 100644
--- a/.gitignore
+++ b/.gitignore
@@ -38,6 +38,7 @@ lib/*.3
lib/hivex.h
lib/hivex.pod
lib/hivex.syms
+lib/test-just-header
lib/tools/*.opt
.libs
libtool
diff --git a/generator/generator.ml b/generator/generator.ml
index 943039c..d8efc04 100755
--- a/generator/generator.ml
+++ b/generator/generator.ml
@@ -704,6 +704,7 @@ let rec generate_c_header () =
#ifndef HIVEX_H_
#define HIVEX_H_
+#include <stdlib.h>
#include <stdint.h>
#ifdef __cplusplus
diff --git a/lib/Makefile.am b/lib/Makefile.am
index 7e5b92b..12f415a 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -1,5 +1,5 @@
# hivex
-# Copyright (C) 2009-2010 Red Hat Inc.
+# Copyright (C) 2009-2011 Red Hat Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -63,3 +63,16 @@ $(top_builddir)/html/hivex.3.html: hivex.pod
$<
CLEANFILES = $(man_MANS)
+
+# Tests.
+
+check_PROGRAMS = test-just-header
+
+TESTS = test-just-header
+
+test_just_header_SOURCES = test-just-header.c
+test_just_header_CFLAGS = \
+ -I$(top_srcdir)/lib -I$(top_builddir)/lib \
+ $(WARN_CFLAGS) $(WERROR_CFLAGS)
+test_just_header_LDADD = \
+ $(top_builddir)/lib/libhivex.la
diff --git a/lib/test-just-header.c b/lib/test-just-header.c
new file mode 100644
index 0000000..ee81e21
--- /dev/null
+++ b/lib/test-just-header.c
@@ -0,0 +1,30 @@
+/* hivex
+ * Copyright (C) 2010-2011 Red Hat Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+/* Check that just including the header and nothing else works, ie.
+ * that there are no implicit dependencies in the header file.
+ */
+
+#include "hivex.h"
+
+int
+main (int argc, char *argv[])
+{
+ hive_h *h = hivex_open ("../images/minimal", 0);
+ return 0;
+}