summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Jones <rjones@centos5x32.home.annexia.org>2009-07-07 17:32:34 +0100
committerRichard Jones <rjones@centos5x32.home.annexia.org>2009-07-07 17:32:34 +0100
commit9a3c4a62398d9f0c553ac2b5f43a3eefafd7bac5 (patch)
treeb1f8e8649c39a61ef3ae111553618b2e7665607e
parent157035503b509385084cafac8e5c5fa0afa2fef7 (diff)
downloadlibguestfs-9a3c4a62398d9f0c553ac2b5f43a3eefafd7bac5.tar.gz
libguestfs-9a3c4a62398d9f0c553ac2b5f43a3eefafd7bac5.tar.xz
libguestfs-9a3c4a62398d9f0c553ac2b5f43a3eefafd7bac5.zip
RHEL 5: for (int i = ...) is not permitted with this old version of GCC.
-rwxr-xr-xsrc/generator.ml9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/generator.ml b/src/generator.ml
index e97472d5..1a4e507b 100755
--- a/src/generator.ml
+++ b/src/generator.ml
@@ -5009,15 +5009,22 @@ and generate_fish_cmds () =
(* print_* functions *)
List.iter (
fun (typ, cols) ->
+ let needs_i =
+ List.exists (function (_, FUUID) -> true | _ -> false) cols in
+
pr "static void print_%s (struct guestfs_%s *%s)\n" typ typ typ;
pr "{\n";
+ if needs_i then (
+ pr " int i;\n";
+ pr "\n"
+ );
List.iter (
function
| name, FString ->
pr " printf (\"%s: %%s\\n\", %s->%s);\n" name typ name
| name, FUUID ->
pr " printf (\"%s: \");\n" name;
- pr " for (int i = 0; i < 32; ++i)\n";
+ pr " for (i = 0; i < 32; ++i)\n";
pr " printf (\"%%c\", %s->%s[i]);\n" typ name;
pr " printf (\"\\n\");\n"
| name, (FUInt64|FBytes) ->