GNOME Bugzilla – Bug 675510
tw_func.h contains windows-specific types
Last modified: 2013-01-19 17:42:56 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.
Attaching a patch as attachment welcome.
Created attachment 213555 [details] [review] proposed patch
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(+)