[glib] Make glib-compile-resources a little smarter



commit 1f1fa69375f6ed2c8f863aa9a3de38e3be49fb27
Author: alex94puchades <alex94puchades gmail com>
Date:   Wed Mar 25 15:26:07 2015 +0100

    Make glib-compile-resources a little smarter
    
    glib-compile-resources was guessing a filename ending
    in .c when generating sources, but did not do the same
    for headers. Fix it so it generates a .h file when
    guessing the filename for headers.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=746753

 gio/glib-compile-resources.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/gio/glib-compile-resources.c b/gio/glib-compile-resources.c
index 6bad64f..6d94dea 100644
--- a/gio/glib-compile-resources.c
+++ b/gio/glib-compile-resources.c
@@ -669,6 +669,12 @@ main (int argc, char **argv)
            base[strlen(base) - strlen (".gresource")] = 0;
          target_basename = g_strconcat (base, ".c", NULL);
        }
+      else if (generate_header)
+        {
+          if (g_str_has_suffix (base, ".gresource"))
+            base[strlen(base) - strlen (".gresource")] = 0;
+          target_basename = g_strconcat (base, ".h", NULL);
+        }
       else
        {
          if (g_str_has_suffix (base, ".gresource"))


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]