# HG changeset patch # User bsmith@81767d24-ef19-dc11-ae90-00e081727c95 # Date 1337163129 0 # Node ID 4314ee3dbeb1ae04791ac3d007de8dafb6857fb4 # Parent 03a76c4185a8fd82149f128a5b1808efe8fd0b04 Fixes for GBM unable to open files when compiled with GCC/Watcom on OS/2. diff -r 03a76c4185a8 -r 4314ee3dbeb1 os2/dw.c --- a/os2/dw.c Wed May 16 08:56:19 2012 +0000 +++ b/os2/dw.c Wed May 16 10:12:09 2012 +0000 @@ -6746,6 +6746,13 @@ WinSendMsg(handle, WM_SETICON, (MPARAM)hptr, 0); } +/* GBM seems to be compiled with VisualAge which defines O_BINARY and O_RDONLY + * as follows... but other compilers (GCC and Watcom at least) define them + * differently... so we add defines that are compatible with VAC here. + */ +#define GBM_O_BINARY 0x00008000 +#define GBM_O_RDONLY 0x00000004 + /* Internal function to load a bitmap from a file and return handles * to the bitmap, presentation space etc. */ @@ -6768,8 +6775,13 @@ ULONG byteswidth; /* Try to open the file */ - if((fd = _gbm_io_open(file, O_RDONLY|O_BINARY)) == -1) + if((fd = _gbm_io_open(file, GBM_O_RDONLY|GBM_O_BINARY)) == -1) + { +#ifdef DEBUG + dw_debug("Failed to open file %s\n", file); +#endif return 0; + } /* guess the source file type from the source filename */ _gbm_query_n_filetypes(&ft);