Richard W.M. Jones
2010-May-21 15:14 UTC
[Libguestfs] [PATCH] C99 compatible build fix for RHEL 5.
-- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming blog: http://rwmj.wordpress.com Fedora now supports 80 OCaml packages (the OPEN alternative to F#) http://cocan.org/getting_started_with_ocaml_on_red_hat_and_fedora -------------- next part -------------->From a5d03c158d023570cf5ffdfebc538b9ef5cfebfb Mon Sep 17 00:00:00 2001From: Richard W.M. Jones <rjones at redhat.com> Date: Fri, 21 May 2010 16:14:07 +0100 Subject: [PATCH] C99 compatible build fix for RHEL 5. --- src/generator.ml | 9 ++++++--- 1 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/generator.ml b/src/generator.ml index 95a2637..d2da8ec 100755 --- a/src/generator.ml +++ b/src/generator.ml @@ -11035,9 +11035,12 @@ print_strings (char *const *argv) | FileIn n | FileOut n -> pr " printf (\"%%s\\n\", %s);\n" n | BufferIn n -> - pr " for (size_t i = 0; i < %s_size; ++i)\n" n; - pr " printf (\"<%%02x>\", %s[i]);\n" n; - pr " printf (\"\\n\");\n" + pr " {\n"; + pr " size_t i;\n"; + pr " for (i = 0; i < %s_size; ++i)\n" n; + pr " printf (\"<%%02x>\", %s[i]);\n" n; + pr " printf (\"\\n\");\n"; + pr " }\n"; | OptString n -> pr " printf (\"%%s\\n\", %s ? %s : \"null\");\n" n n | StringList n | DeviceList n -> pr " print_strings (%s);\n" n | Bool n -> pr " printf (\"%%s\\n\", %s ? \"true\" : \"false\");\n" n -- 1.5.5.6