comparison os2/dw.c @ 1733:4314ee3dbeb1

Fixes for GBM unable to open files when compiled with GCC/Watcom on OS/2.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Wed, 16 May 2012 10:12:09 +0000
parents b39c137cc6f5
children 43accf95bdc3
comparison
equal deleted inserted replaced
1732:03a76c4185a8 1733:4314ee3dbeb1
6744 { 6744 {
6745 HPOINTER hptr = icon < 65536 ? WinLoadPointer(HWND_DESKTOP,NULLHANDLE,icon) : (HPOINTER)icon; 6745 HPOINTER hptr = icon < 65536 ? WinLoadPointer(HWND_DESKTOP,NULLHANDLE,icon) : (HPOINTER)icon;
6746 WinSendMsg(handle, WM_SETICON, (MPARAM)hptr, 0); 6746 WinSendMsg(handle, WM_SETICON, (MPARAM)hptr, 0);
6747 } 6747 }
6748 6748
6749 /* GBM seems to be compiled with VisualAge which defines O_BINARY and O_RDONLY
6750 * as follows... but other compilers (GCC and Watcom at least) define them
6751 * differently... so we add defines that are compatible with VAC here.
6752 */
6753 #define GBM_O_BINARY 0x00008000
6754 #define GBM_O_RDONLY 0x00000004
6755
6749 /* Internal function to load a bitmap from a file and return handles 6756 /* Internal function to load a bitmap from a file and return handles
6750 * to the bitmap, presentation space etc. 6757 * to the bitmap, presentation space etc.
6751 */ 6758 */
6752 int _load_bitmap_file(char *file, HWND handle, HBITMAP *hbm, HDC *hdc, HPS *hps, unsigned long *width, unsigned long *height, int *depth) 6759 int _load_bitmap_file(char *file, HWND handle, HBITMAP *hbm, HDC *hdc, HPS *hps, unsigned long *width, unsigned long *height, int *depth)
6753 { 6760 {
6766 GBM gbm; 6773 GBM gbm;
6767 GBMRGB *gbmrgb; 6774 GBMRGB *gbmrgb;
6768 ULONG byteswidth; 6775 ULONG byteswidth;
6769 6776
6770 /* Try to open the file */ 6777 /* Try to open the file */
6771 if((fd = _gbm_io_open(file, O_RDONLY|O_BINARY)) == -1) 6778 if((fd = _gbm_io_open(file, GBM_O_RDONLY|GBM_O_BINARY)) == -1)
6779 {
6780 #ifdef DEBUG
6781 dw_debug("Failed to open file %s\n", file);
6782 #endif
6772 return 0; 6783 return 0;
6784 }
6773 6785
6774 /* guess the source file type from the source filename */ 6786 /* guess the source file type from the source filename */
6775 _gbm_query_n_filetypes(&ft); 6787 _gbm_query_n_filetypes(&ft);
6776 6788
6777 for(z=0;z<ft;z++) 6789 for(z=0;z<ft;z++)