]> git.draconx.ca Git - gob-dx.git/commit
Use G_DEFINE_xxx type macros in output files.
authorNick Bowler <nbowler@draconx.ca>
Sun, 9 Feb 2020 01:04:26 +0000 (20:04 -0500)
committerNick Bowler <nbowler@draconx.ca>
Sun, 9 Feb 2020 01:20:26 +0000 (20:20 -0500)
commitc3ec2de25a739b8afec1d19a950ba5bc399c1dcb
tree681197e0941ba6ad86ca962cf9c40c75e3b27ce7
parent9b591a326d98245379213aecaf39d1f44f4ff5a7
Use G_DEFINE_xxx type macros in output files.

The G_DEFINE_TYPE_EXTENDED and G_DEFINE_DYNAMIC_TYPE_EXTENDED can be
used to produce the default get_type implementations.  They produce
almost identical code to what we already generate in GOB, except that
we can now automatically pick up any improvements made in GLib.  For
example, with modern GLib the G_DEFINE_TYPE_EXTENDED will produce a
thread-safe get_type implementation which is a nice bonus.

These macros do not support the "prealloc" attribute so setting this
in gob will no longer do anything.  According to the documentation, this
has been a no-op in GLib itself since 2.10, and it appears to just be
for performance tuning anyway, so I doubt anyone cares.

The generated output will fall back to the original method when these
macros are not available.
src/main.c