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 767164 - Use compiler directives to export the symbols for libgdkpixbuf
Use compiler directives to export the symbols for libgdkpixbuf
Status: RESOLVED FIXED
Product: gdk-pixbuf
Classification: Platform
Component: general
unspecified
Other Windows
: Normal normal
: ---
Assigned To: gdk-pixbuf-maint
gdk-pixbuf-maint
Depends on:
Blocks:
 
 
Reported: 2016-06-02 13:00 UTC by Fan, Chun-wei
Modified: 2016-06-14 05:23 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Fix index for 2.36 api additions (940 bytes, patch)
2016-06-02 13:01 UTC, Fan, Chun-wei
committed Details | Review
Decorate symbols with GDK_PIXBUF_AVAILABLE_IN*/GDK_PIXBUF_DEPRECATED_IN* (52.94 KB, patch)
2016-06-02 13:06 UTC, Fan, Chun-wei
committed Details | Review
Use compiler directives to export symbols (29.39 KB, patch)
2016-06-02 13:12 UTC, Fan, Chun-wei
committed Details | Review
Fix version number variable export (2.12 KB, patch)
2016-06-13 07:55 UTC, Fan, Chun-wei
committed Details | Review

Description Fan, Chun-wei 2016-06-02 13:00:37 UTC
Hi,

Currently, the GdkPixbuf library makes use of .symbols files to control the export of symbols, like what GLib and GTK+ used to do in the past.  As GLib and GTK+ (and some others) now make use of compiler directives to export symbols when possible, I thought it would make sense to do the same here.  This should reduce maintenance overhead a bit.

With blessings, thank you!
Comment 1 Fan, Chun-wei 2016-06-02 13:01:47 UTC
Created attachment 328950 [details] [review]
Fix index for 2.36 api additions

Hi,

First up is to fix the typo that occurred when the index for 2.36 was added...
Comment 2 Fan, Chun-wei 2016-06-02 13:06:34 UTC
Created attachment 328953 [details] [review]
Decorate symbols with GDK_PIXBUF_AVAILABLE_IN*/GDK_PIXBUF_DEPRECATED_IN*

Hi,

This adds a new public header gdk-pixbuf-macros.h which will define the macros for the stable releases, for symbol availability as well as deprecations.  This also decorates all the function symbols in the public headers with such macros (or replace G_DEPRECATEED_IN* with the corresponding GDK_PIXBUF_DEPRECATED_IN* macros).

This also makes the availability macros available in the docs...
Comment 3 Fan, Chun-wei 2016-06-02 13:12:22 UTC
Created attachment 328954 [details] [review]
Use compiler directives to export symbols

Hi,

The last patch does the goal of this patch series: export the symbols using compiler directives, which is determined at configure time.

Also update the Visual Studio projects so that we don't need to generate the .def file from the projects and use __declspec(dllexport) to accomplish the same purpose.

Only the enumeration template source needs to be updated as the other sources have config.h included first-of-all.

We can now say goodbye to gdk-pixbuf.symbols and abicheck.sh, as they won't be needed anymore, which should clean things up a bit in gdk-pixbuf/Makefile.am.

With blessings, thank you!
Comment 4 Matthias Clasen 2016-06-06 13:11:07 UTC
Review of attachment 328950 [details] [review]:

sure. thanks for catching that
Comment 5 Matthias Clasen 2016-06-06 13:17:13 UTC
Review of attachment 328953 [details] [review]:

Looks good to me
Comment 6 Matthias Clasen 2016-06-06 13:19:01 UTC
Review of attachment 328954 [details] [review]:

The Makefile.am and configure.ac parts look fine to me. I'll trust you on the win32-buildsystem parts
Comment 7 Fan, Chun-wei 2016-06-07 08:44:10 UTC
Hi Matthias,

Thanks for the reviews, I have pushed the patches as:
-328950: f0312dd
-328953: 0c47922
-328954: 6855a2d

With blessings, thank you!
Comment 8 Ting-Wei Lan 2016-06-12 17:55:15 UTC
Attachment 328954 [details] breaks applications using version number variables:

$ gimp
gimp: symbol lookup error: gimp: undefined symbol: gdk_pixbuf_micro_version

A simple test program:

$ cat gdk-pixbuf-version.c 
#include <stdio.h>
#include <gdk-pixbuf/gdk-pixbuf.h>

int main (int argc, char *argv[]) { 
    printf ("%u.%u.%u\n",
            gdk_pixbuf_major_version,
            gdk_pixbuf_minor_version,
            gdk_pixbuf_micro_version);
}

$ cc -g gdk-pixbuf-version.c -o gdk-pixbuf-version `pkg-config --cflags --libs gdk-pixbuf-2.0`
/tmp/ccnNTP7Y.o: In function `main':
gdk-pixbuf-version.c:5: undefined reference to `gdk_pixbuf_micro_version'
gdk-pixbuf-version.c:5: undefined reference to `gdk_pixbuf_minor_version'
gdk-pixbuf-version.c:5: undefined reference to `gdk_pixbuf_major_version'
collect2: error: ld returned 1 exit status
Comment 9 Fan, Chun-wei 2016-06-13 07:55:35 UTC
Created attachment 329666 [details] [review]
Fix version number variable export

Hi Ting-wei,

Can you check whether this patch fixes this issue for you?  Sorry about this.

With blessings, thank you!
---
端午節快樂,啊,不好意思,漏掉這部份了...:P
Comment 10 Ting-Wei Lan 2016-06-13 10:56:24 UTC
Yes, attachment 329666 [details] [review] works for me.

---
端午節連假過完了!
Comment 11 Fan, Chun-wei 2016-06-14 05:23:03 UTC
Hi Ting-wei,

I have pushed the patch as 630bc277-thanks for the feedback.

With blessings, thank you!