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 675510 - tw_func.h contains windows-specific types
tw_func.h contains windows-specific types
Status: RESOLVED FIXED
Product: GIMP
Classification: Other
Component: Plugins
2.8.0
Other Mac OS
: Normal normal
: 2.8
Assigned To: GIMP Bugs
GIMP Bugs
Depends on:
Blocks:
 
 
Reported: 2012-05-05 15:47 UTC by Ludovic Rousseau
Modified: 2013-01-19 17:42 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
proposed patch (476 bytes, patch)
2012-05-06 21:02 UTC, Ludovic Rousseau
none Details | Review

Description Ludovic Rousseau 2012-05-05 15:47:14 UTC
Compilation of gimp 2.8.0 fails on my iMac with:
[...]
Making all in twain
  CC     tw_func.o
  CC     twain.o
  CC     tw_mac.o
In file included from tw_func.c:66:
tw_func.h:238: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘InitApplication’
tw_func.h:239: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘InitInstance’


This is because tw_func.h contains Windows code:
void LogLastWinError(void);
BOOL InitApplication(HINSTANCE hInstance);
BOOL InitInstance(HINSTANCE hInstance, int nCmdShow, pTW_SESSION twSession);

BOOL and HINSTANCE are _not_ defined on Mac OS X.

A very simple patch is:

--- tw_func.h.orig	2012-05-05 17:44:23.000000000 +0200
+++ tw_func.h	2012-05-05 17:44:26.000000000 +0200
@@ -234,8 +234,10 @@
 void setClientData(pTW_SESSION session, void *clientData);
 pTW_SESSION initializeTwain(void);
 
+#ifdef WIN32
 void LogLastWinError(void);
 BOOL InitApplication(HINSTANCE hInstance);
 BOOL InitInstance(HINSTANCE hInstance, int nCmdShow, pTW_SESSION twSession);
+#endif
 
 #endif /* _TW_FUNC_H */

http://git.gnome.org/ is down as I write. So I can't check if the bug is already known and fixed.
Comment 1 André Klapper 2012-05-06 20:34:54 UTC
Attaching a patch as attachment welcome.
Comment 2 Ludovic Rousseau 2012-05-06 21:02:35 UTC
Created attachment 213555 [details] [review]
proposed patch
Comment 3 Michael Natterer 2013-01-19 17:42:56 UTC
Thanks, fixed in master and gimp-2-8:

commit b31fcbc0f16bd55773e4dae37b5be386b607c4bb
Author: Ludovic Rousseau <ludovic.rousseau@gmail.com>
Date:   Sat Jan 19 18:39:15 2013 +0100

    Bug 675510 - tw_func.h contains windows-specific types
    
    Put the stuff in #ifdef G_OS_WIN32
    (cherry picked from commit 5379a2377ec4b4df240d253823a9740e529a7671)

 plug-ins/twain/tw_func.h |    2 ++
 1 file changed, 2 insertions(+)