GNOME Bugzilla – Bug 339739
gtk/gtkprintoperation-win32.c: 3 compile error
Last modified: 2006-06-11 20:00:28 UTC
Please describe the problem: 1. IPrintDialogCallback is already declared in CommDlg.h. 2. win32_status is declared at the middle of a block. 3. page_setup is doubly. Steps to reproduce: 1. compile by old compiler Actual results: Following messages are displayed. (Visual C++ 6.0) gtkprintoperation-win32.c(64) : error C2011: 'IPrintDialogCallback' : 'struct' type redefinition C:\Program Files\Microsoft Platform SDK\Include\CommDlg.h(890) : see declaration of 'IPrintDialogCallback' gtkprintoperation-win32.c(65) : error C2011: 'IPrintDialogCallbackVtbl' : 'struct' type redefinition C:\Program Files\Microsoft Platform SDK\Include\CommDlg.h(891) : see declaration of 'IPrintDialogCallbackVtbl' gtkprintoperation-win32.c(522) : error C2275: 'DWORD' : illegal use of this type as an expression C:\Program Files\Microsoft Platform SDK\Include\WinDef.h(151) : see declaration of 'DWORD' gtkprintoperation-win32.c(522) : error C2146: syntax error : missing ';' before identifier 'win32_status' gtkprintoperation-win32.c(522) : error C2144: syntax error : '<Unknown>' should be preceded by '<Unknown>' gtkprintoperation-win32.c(522) : error C2144: syntax error : '<Unknown>' should be preceded by '<Unknown>' gtkprintoperation-win32.c(522) : error C2143: syntax error : missing ';' before 'identifier' gtkprintoperation-win32.c(522) : error C2065: 'win32_status' : undeclared identifier gtkprintoperation-win32.c(820) : error C2146: syntax error : missing ')' before identifier 'printdlgex' gtkprintoperation-win32.c(820) : error C2144: syntax error : '<Unknown>' should be preceded by '<Unknown>' gtkprintoperation-win32.c(820) : error C2144: syntax error : '<Unknown>' should be preceded by '<Unknown>' gtkprintoperation-win32.c(820) : error C2143: syntax error : missing ')' before 'identifier' gtkprintoperation-win32.c(820) : error C2081: 'LPPRINTDLGEXW' : name informal parameter list illegal gtkprintoperation-win32.c(820) : error C2061: syntax error : identifier 'printdlgex' gtkprintoperation-win32.c(820) : error C2059: syntax error : ';' gtkprintoperation-win32.c(820) : error C2059: syntax error : ')' gtkprintoperation-win32.c(821) : error C2449: found '{' at file scope (missing function header?) gtkprintoperation-win32.c(859) : error C2059: syntax error : '}' gtkprintoperation-win32.c(1105) : error C2146: syntax error : missing ')' before identifier 'printdlgex' gtkprintoperation-win32.c(1105) : error C2144: syntax error : '<Unknown>' should be preceded by '<Unknown>' gtkprintoperation-win32.c(1105) : error C2144: syntax error : '<Unknown>' should be preceded by '<Unknown>' gtkprintoperation-win32.c(1105) : error C2143: syntax error : missing ')' before 'identifier' gtkprintoperation-win32.c(1105) : error C2081: 'LPPRINTDLGEXW' : name in formal parameter list illegal gtkprintoperation-win32.c(1105) : error C2061: syntax error : identifier 'printdlgex' gtkprintoperation-win32.c(1105) : error C2059: syntax error : ';' gtkprintoperation-win32.c(1105) : error C2059: syntax error : ')' gtkprintoperation-win32.c(1106) : error C2449: found '{' at file scope (missing function header?) gtkprintoperation-win32.c(1155) : error C2059: syntax error : '}' gtkprintoperation-win32.c(1167) : error C2065: 'callback' : undeclared identifier gtkprintoperation-win32.c(1167) : error C2059: syntax error : ')' gtkprintoperation-win32.c(1168) : error C2223: left of '->ref_count' must point to struct/union gtkprintoperation-win32.c(1168) : error C4033: 'iprintdialogcallback_addref' must return a value gtkprintoperation-win32.c(1171) : error C2143: syntax error : missing '{' before '__stdcall' gtkprintoperation-win32.c(1174) : error C2059: syntax error : ')' gtkprintoperation-win32.c(1175) : error C2143: syntax error : missing ';' before 'type' gtkprintoperation-win32.c(1177) : error C2065: 'ref_count' : undeclared identifier gtkprintoperation-win32.c(1222) : error C2059: syntax error : ')' gtkprintoperation-win32.c(1224) : error C2223: left of '->set_hwnd' must point to struct/union gtkprintoperation-win32.c(1227) : error C2223: left of '->set_hwnd' must point to struct/union gtkprintoperation-win32.c(1243) : error C2061: syntax error : identifier 'ipdc_vtbl' gtkprintoperation-win32.c(1243) : error C2059: syntax error : ';' gtkprintoperation-win32.c(1243) : error C2513: '/*global*/ ' : no variable declared before '=' gtkprintoperation-win32.c(1257) : error C2059: syntax error : ')' gtkprintoperation-win32.c(1258) : error C2223: left of '->iPrintDialogCallback' must point to struct/union gtkprintoperation-win32.c(1258) : error C2065: 'ipdc_vtbl' : undeclaredidentifier gtkprintoperation-win32.c(1259) : error C2223: left of '->ref_count' must point to struct/union gtkprintoperation-win32.c(1260) : error C2223: left of '->set_hwnd' must point to struct/union gtkprintoperation-win32.c(1262) : error C2223: left of '->iPrintDialogCallback' must point to struct/union gtkprintoperation-win32.c(1262) : error C4033: 'print_callback_new' must return a value gtkprintoperation-win32.c(1266) : error C2061: syntax error : identifier '_gtk_print_operation_platform_backend_run_dialog' gtkprintoperation-win32.c(1266) : error C2059: syntax error : ';' gtkprintoperation-win32.c(1266) : error C2059: syntax error : 'type' gtkprintoperation-win32.c(1517) : error C4013: 'devmode_from_settings' undefined; assuming extern returning int gtkprintoperation-win32.c(1517) : error C4047: '=' : 'HGLOBAL' differs in levels of indirection from 'int' gtkprintoperation-win32.c(1621) : error C2082: redefinition of formal parameter 'page_setup' Expected results: 1. The 2nd declaration in gtkprintoperation-win32.c have to be disable. 2. The declaration have to be moved to top of block. 3. Delete page_setup. Does this happen every time? Other information:
Created attachment 64283 [details] [review] patch for gtkprintoperation-win32.c
Created attachment 67085 [details] [review] patch for gtkprintoperation-win32.c (Revision 1.11) Following messages are displayed. (Visual C++ 2005) gtkprintoperation-win32.c(75) : error C2011: 'IPrintDialogCallback' : 'struct' type redefinition C:\Program Files\Microsoft Platform SDK\include\commdlg.h(890) : see declaration of 'IPrintDialogCallback' gtkprintoperation-win32.c(76) : error C2011: 'IPrintDialogCallbackVtbl' : 'struct' type redefinition C:\Program Files\Microsoft Platform SDK\include\commdlg.h(891) : see declaration of 'IPrintDialogCallbackVtbl' gtk\gtk\gtkprintoperation-win32.c(540) : error C2275: 'DWORD' : illegal use of this type as an expression C:\Program Files\Microsoft Platform SDK\include\windef.h(151) : see declaration of 'DWORD' gtkprintoperation-win32.c(540) : error C2146: syntax error : missing ';' before identifier 'win32_status' gtkprintoperation-win32.c(540) : error C2065: 'win32_status' : undeclared identifier gtkprintoperation-win32.c(1723) : error C4013: 'close' undefined; assuming extern returning int
Thanks. Patch applied.