After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 790925 - Use g_auto*
Use g_auto*
Status: RESOLVED FIXED
Product: gexiv2
Classification: Other
Component: general
unspecified
Other Linux
: Normal enhancement
: ---
Assigned To: Gexiv2 Maintainers
Gexiv2 Maintainers
Depends on:
Blocks: 788174
 
 
Reported: 2017-11-28 07:10 UTC by Umang Jain
Modified: 2018-02-05 22:23 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Add clean-up declarations for g_autoptr (2.03 KB, patch)
2017-12-24 10:57 UTC, Jens Georg
none Details | Review
Add clean-up declarations for g_autoptr (3.31 KB, patch)
2017-12-24 11:22 UTC, Jens Georg
committed Details | Review

Description Umang Jain 2017-11-28 07:10:39 UTC
We should use g_auto* instead of manually freeing resources:
https://developer.gnome.org/glib/stable/glib-Miscellaneous-Macros.html#g-auto
Comment 1 Jens Georg 2017-11-28 08:35:05 UTC
I think geiv is commonly used on Windows - not sure if that's also with MSVC, but that's a no-go then.

What I can do is prepare the macros so that you can use it, but not use it in gexiv2 itself.

For the record: I think g_auto is a massive fuck-up of refusing to use a sane language.
Comment 2 Jens Georg 2017-11-28 08:39:14 UTC
Does anyone know whether using those macros will change ABI?
Comment 3 Jens Georg 2017-12-24 10:57:19 UTC
Created attachment 365923 [details] [review]
Add clean-up declarations for g_autoptr
Comment 4 Jens Georg 2017-12-24 11:22:58 UTC
Created attachment 365924 [details] [review]
Add clean-up declarations for g_autoptr
Comment 5 Jens Georg 2018-02-05 22:00:40 UTC
Attachment 365924 [details] pushed as 1a19954 - Add clean-up declarations for g_autoptr
Comment 6 Debarshi Ray 2018-02-05 22:23:51 UTC
\m/

(In reply to Jens Georg from comment #1)
> I think geiv is commonly used on Windows - not sure if that's also with
> MSVC, but that's a no-go then.
> 
> What I can do is prepare the macros so that you can use it, but not use it
> in gexiv2 itself.

Yeah, libraries that need to be portable beyond GCC and Clang can't use g_auto* themselves but can define the clean-up functions for its less portable consumers.

> For the record: I think g_auto is a massive fuck-up of refusing to use a
> sane language.

:)

(In reply to Jens Georg from comment #2)
> Does anyone know whether using those macros will change ABI?

Just defining the clean-up functions shouldn't change ABI.