On Mon, 28 Dec 2009, Pedro Alves wrote:
>> btw, feel free to mention any improvements about the port (see the README >> file, about the optimization flags, for example) > >> From said README: > >> 7) Compilation >> >> * Version: svn 22-Jul-2008 >> * Architecture: mingw32ce >> * CPPFLAGS: -D_WIN32_WCE=0x0400 -DNO_ERRNO_H >> * CFLAGS: -O3 -Wall -mms-bitfields > > Is the explicit "-mms-bitfields" really needed? I > thought mingw32ce defaulted to -ms-bitfields? How can we know that ? > Any reason -D_WIN32_WCE=0x0400 (or -D_WIN32_WCE=0x0300, I think > it builds fine) isn't set in zutil.h instead of > on the command line? Hmm, i don't know, i never thought about it. I'll check that >> * LDFLAGS: --enable-auto-import -s > > Same for --enable-auto-import. same question :-) > Any reason you don't use win32/Makefile.gcc instead of heavily patching the > top Makefile? BTW, I think used to just run: > > make CC=arm-mingw32ce-gcc AR="arm-mingw32ce-ar rc" > RANLIB="arm-mingw32ce-ranlib" CFLAGS="-DNO_ERRNO_H -g3 -O0" > > on the top Makefile. the Makefile.gcc compiles also the binaries (I compile only the library). It is cleaner too. I plan to provide a Makefile for Windows CE only, in a subdir of zlib > I also see that you set -D_WIN32_IE=0x0400 in the Makefile. I wish > people would stop doing that. _WIN32_IE is not meant for CE > usage. If you do need it, it's a bug in the w32api headers that > needs fixing (to expose functions/macros under _WIN32_WCE). Then, this should be removed from: http://cegcc.sourceforge.net/docs/details.html I'll remove it >> * Porting issues: > >> - does not use the errno system, but zlib implement some dummy >> errno variable for the compilation on Windows CE. > > Hmmm. Is there any plan to use GetLastError instead? dummy errno > variables are evil. IMO, the need for NO_ERRNO_H should be cleaned > away. About GetLastError, i didn't plan to use it. I'll check that too. I'll try to use it. Indeed, using dummy errno is not good. > I spotted one thing extra thing should be tweaked: > > >grep "fd < 0" * > gzio.c: s->file = fd < 0 ? F_OPEN(path, fmode) : (FILE*)fdopen(fd, fmode); > gzio.c: if (fd < 0) return (gzFile)Z_NULL; > > Should be changed to check for explicit -1, like: > > s->file = fd == -1 ? F_OPEN(path, fmode) : (FILE*)fdopen(fd, fmode); > > This is because file descriptors in Windows CE are really > handles in desguise, and they can really end up negative > without that being an error. I'll ask Marc about that. There should be no problem. >> - gzio.c and zutil.h have been modified accordingly >> >> Note that there is a patch that needs to be improved in order to be in the >> next release of zlib. It is known. > > Let me know if I can help with that. (What needs improving specifically?) iirc, the patch about the define is not correct for a generic use. I removed the define, but actually, i should include stddef.h is _WIN32_WCE is not defined or __MINGW32CE__ is defined thank you for your comments ! Vincent Torri ------------------------------------------------------------------------------ This SF.Net email is sponsored by the Verizon Developer Community Take advantage of Verizon's best-in-class app development support A streamlined, 14 day to market process makes app distribution fast and easy Join now and get one step closer to millions of Verizon customers http://p.sf.net/sfu/verizon-dev2dev _______________________________________________ Cegcc-devel mailing list Cegcc-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/cegcc-devel