summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2006-02-28 07:36:38 +0000
committerDaniel Stenberg <daniel@haxx.se>2006-02-28 07:36:38 +0000
commit635b8300c6e5641adef30c0495bb92876cceca5f (patch)
treef244494cbc2203f93a5e739058b04e428a9adf20
parent71ee68e97873978f1bb1f3fd63511f7c9396b965 (diff)
downloadrockbox-635b8300c6e5641adef30c0495bb92876cceca5f.tar.gz
rockbox-635b8300c6e5641adef30c0495bb92876cceca5f.zip
open the image in binary mode to work better on windows
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8864 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--tools/bmp2rb.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/tools/bmp2rb.c b/tools/bmp2rb.c
index 8de6ab2b56..03da5895b8 100644
--- a/tools/bmp2rb.c
+++ b/tools/bmp2rb.c
@@ -92,6 +92,11 @@ unsigned char brightness(struct RGBQUAD color)
92 + (unsigned int)color.rgbBlue) / 10; 92 + (unsigned int)color.rgbBlue) / 10;
93} 93}
94 94
95#ifndef O_BINARY
96#define O_BINARY 0 /* systems that don't have O_BINARY won't make a difference
97 on text and binary files */
98#endif
99
95/**************************************************************************** 100/****************************************************************************
96 * read_bmp_file() 101 * read_bmp_file()
97 * 102 *
@@ -108,7 +113,7 @@ int read_bmp_file(char* filename,
108 struct Fileheader fh; 113 struct Fileheader fh;
109 struct RGBQUAD palette[256]; 114 struct RGBQUAD palette[256];
110 115
111 int fd = open(filename, O_RDONLY); 116 int fd = open(filename, O_RDONLY| O_BINARY);
112 unsigned short data; 117 unsigned short data;
113 unsigned char *bmp; 118 unsigned char *bmp;
114 int width, height; 119 int width, height;