Commit Graph

24 Commits

Author SHA1 Message Date
Dan Winship
615b44c7ca glib-compile-resources: avoid warnings with -Wmissing-field-initializers
Initialize all the fields of the generated GStaticResource, to avoid
warnings in packages that build with -Wmissing-field-initializers.
2013-01-09 10:12:12 -05:00
Dan Winship
3ac6cfaeaa win32: prototype _glib_get_dll_directory() and _glib_get_locale_dir()
Rather than using "extern" declarations of these win32 functions
everywhere they're needed, just prototype them in glib-private.h.
(Which also fixes the fact that they weren't prototyped in the files
where they're defined.)

https://bugzilla.gnome.org/show_bug.cgi?id=688109
2012-11-15 14:19:05 -05:00
Matthias Clasen
8caf39b59b Add an option to make glib-compile-resources use G_GNUC_INTERNAL
https://bugzilla.gnome.org/show_bug.cgi?id=687742
2012-11-09 22:14:39 -05:00
Ryan Lortie
1dc774a653 Remove g_type_init() calls
Very many testcases, some GLib tools (resource compiler, etc) and
GApplication were calling g_type_init().

Remove those uses, as they are no longer required.

https://bugzilla.gnome.org/show_bug.cgi?id=686161
2012-10-16 09:39:24 -04:00
Matthias Clasen
ec82f61065 Really fix the leak
Pointed out by Josselin Mouette.
2012-09-30 19:24:13 -04:00
Matthias Clasen
7f325939ba Fix memory leaks in glib-compile resources
Based on a patch by Josselin Mouette,
https://bugzilla.gnome.org/show_bug.cgi?id=685069
2012-09-30 14:07:37 -04:00
Colin Walters
f7abd3ce13 Add g_spawn_check_exit_status()
Many (if not "almost all") programs that spawn other programs via
g_spawn_sync() or the like simply want to check whether or not the
child exited successfully, but doing so requires use of
platform-specific functionality and there's actually a fair amount of
boilerplate involved.

This new API will help drain a *lot* of mostly duplicated code in
GNOME, from gnome-session to gdm.  And we can see that some bits even
inside GLib were doing it wrong; for example checking the exit status
on Unix, but ignoring it on Windows.

https://bugzilla.gnome.org/show_bug.cgi?id=679691
2012-07-10 18:03:56 -04:00
Benjamin Otte
5ff95679b8 glib-compile-resources: Forward errors from spawned processes
We just grab stderr from gdk-pixbuf-to-csource and xmllint and include
it in the error message. It's the best we can do.
2012-06-13 18:54:54 +02:00
Christian Persch
e3cc48f289 resources: compiler: Respect absolute paths
When a <file> already has an absolute path, use it directly instead of trying to
locate it in the --sourcedir directories.

https://bugzilla.gnome.org/show_bug.cgi?id=672541
2012-03-29 17:43:43 +02:00
Jonh Wendell
feaf828a92 Fixed a typo 2012-02-25 10:18:40 -02:00
Chun-wei Fan
d4e3ae990c Bug 669538-glib-compile-resources.c: Include io.h on Windows
This is needed for close() on Windows (Visual C++ specifically) so that
no C4013 (aka Implicit declaration of ...) errors/warnings will be emitted.
2012-02-10 08:53:52 +08:00
Richard Hughes
52d0460096 Allow multiple --sourcedir options to glib-compile-resources 2012-02-09 17:24:43 +00:00
Alexander Larsson
3b8ba958f5 Fix warning to refer to to-pixdata, not xmllint 2012-02-03 15:11:23 +01:00
Christian Persch
cb1dd2143d resources: compiler: Fix entity processing of xml-stripblanks
Preserve entities instead of replacing them!

Bug #669173.
2012-02-02 23:44:40 +01:00
Christian Persch
296a2a72c6 resources: compiler: Make to-pixbuf failure fatal
Bug #669123.
2012-02-02 23:44:38 +01:00
Alexander Larsson
47aa8c43e8 resources: Add to-pixdata preprocessing option 2012-01-31 16:07:09 +01:00
Alexander Larsson
b79cfda49c Make constructor-based resource registration malloc free
We need to do this because constructors run before main() and
thus before any call to g_mem_set_vtable, making it impossible to
use that function if constructors call g_malloc.

We do this by making the constructors just register the static data
for lazy registration, doing the lazy registration when using
the global resource set.
2012-01-31 10:51:44 +01:00
Alexander Larsson
968f4e8d79 Move constructor macros to an internal header and into generated code
With this we're not longer exporting the constructor headers, which means
we're not tying ourselves to a macro that might need special tweaking on
a compiler-by-compiler basis.
2012-01-30 16:59:27 +01:00
Christian Persch
f42a5fb53b resources: compiler: Add autoselected output format
This allows simplifying the make rules.

Bug #668539.
2012-01-25 14:47:48 +01:00
Christian Persch
55d10d6bfd resources: compiler: Add dependency generator
Bug #668532.
2012-01-25 14:47:37 +01:00
Christian Persch
45783c5927 resources: compiler: Allow stripping blanks from xml data
It's hardly useful to bloat the resource data with blanks intended only
for human readability, so add a preprocessing option that uses xmllint --noblanks
to strip these.

Bug #667929.
2012-01-25 14:47:37 +01:00
Christian Persch
d8b295abb3 resources: Plug mem leaks in resource compiler
==13007== 173 bytes in 1 blocks are definitely lost in loss record 90 of 106
==13007==    at 0x402AD89: malloc (vg_replace_malloc.c:236)
==13007==    by 0x407DDBA: standard_malloc (gmem.c:85)
==13007==    by 0x407E318: g_try_malloc (gmem.c:271)
==13007==    by 0x40654DE: g_file_get_contents (gfileutils.c:756)
==13007==    by 0x804A531: main (glib-compile-resources.c:580)

==13007== 521 (56 direct, 465 indirect) bytes in 1 blocks are definitely lost in loss record 100 of 106
==13007==    at 0x402AD89: malloc (vg_replace_malloc.c:236)
==13007==    by 0x407DDBA: standard_malloc (gmem.c:85)
==13007==    by 0x407E160: g_malloc (gmem.c:159)
==13007==    by 0x4091D8D: g_slice_alloc (gslice.c:1003)
==13007==    by 0x40674A1: g_hash_table_new_full (ghash.c:676)
==13007==    by 0x804B252: gvdb_hash_table_new (gvdb-builder.c:76)
==13007==    by 0x43C66B2: (below main) (libc-start.c:226)
2012-01-18 19:43:17 +01:00
Alexander Larsson
d825828b7b resources: Skip initial underscores in resource section names
Initial underscores are used in c identifier to make them private,
for instance in Gtk+. However, we don't want to have this in the
resource section name, that just looks ugly.
2012-01-17 12:32:37 +01:00
Alexander Larsson
827657491d Initial version of glib-compile-resources
This is the basic utility to create resource files, either binary
versions or source files that can be compiled into your app.
2012-01-13 17:12:50 +01:00