http://www.perlmonks.org?node_id=1008184


in reply to Re^3: win32::printer 5.16 will not install
in thread win32::printer 5.16 will not install

cpanp -z Win32::Printer

patch -p1 -i./Win32-Printer-0.9.0-formingw.diff

Win32-Printer-0.9.0-formingw.diff

diff -ruN Win32-Printer-0.9.0-7P99xa/Printer.xs Win32-Printer-0.9.0-ne +w/Printer.xs --- Win32-Printer-0.9.0-7P99xa/Printer.xs 2008-04-28 11:40:34.00000 +0000 -0700 +++ Win32-Printer-0.9.0-new/Printer.xs 2012-12-09 21:22:29.32812500 +0 -0800 @@ -24,6 +24,12 @@ #include <winspool.h> #include <commdlg.h> + +#define _int16 __int16 + + + + //------------------------------------------------------------------- +---------// LPWSTR ToWide( @@ -1334,7 +1340,7 @@ ebc.flags = flags; ebc.baw = baw; ebc.bah = bah; - __try { +//~ __try { if (emf) { brush = GetCurrentObject(hdc, OBJ_BRUSH); font = GetCurrentObject(hdc, OBJ_FONT); @@ -1352,10 +1358,10 @@ if (emf) { emf = CloseEnhMetaFile(hdc); } - } - __except (exfilt()) { - RETVAL = 64; - } +//~ } +//~ __except (exfilt()) { +//~ RETVAL = 64; +//~ } #else croak("EBbl is not supported in this build!\n"); #endif @@ -1398,7 +1404,7 @@ RETVAL = NULL; #ifdef FREE SetCurrentDirectory(dir); - __try { +//~ __try { if (Type == FIF_UNKNOWN) { Type = FreeImage_GetFIFFromFilename(BmpFile); if (Type == FIF_UNKNOWN) { @@ -1429,10 +1435,10 @@ } else { Image = 0; } - } - __except (exfilt()) { - Image = 0; - } +//~ } +//~ __except (exfilt()) { +//~ Image = 0; +//~ } #else croak("FreeImage is not supported in this build!\n"); #endif @@ -1827,7 +1833,7 @@ CODE: RETVAL = NULL; #ifdef GHOST - __try { +//~ __try { if (gsapi_new_instance(&minst, NULL) == 0) { sprintf(pdfpath, "-sOutputFile=%s", pdf); if (gsapi_init_with_args(minst, gsargc, (LPSTR *)gsargv) == 0 +) { @@ -1836,8 +1842,8 @@ } gsapi_delete_instance(minst); } - } - __except (exfilt()) { } +//~ } +//~ __except (exfilt()) { } #else croak("Ghostscript is not supported in this build!\n"); #endif