Hi all,

There is no _fsetmode() in mingw environment.

main.c: In function 'main':
main.c:777:3: warning: implicit declaration of function '_fsetmode' [-Wimplicit-function-declaration]
gcc  -o clzip carg_parser.o encoder.o decoder.o main.o
main.o:main.c:(.text.startup+0x1f7): undefined reference to `_fsetmode'
main.o:main.c:(.text.startup+0x20f): undefined reference to `_fsetmode'
d:/msys/mingw/bin/../lib/gcc/i686-w64-mingw32/4.7.1/../../../../i686-w64-mingw32/bin/ld.exe: main.o: bad reloc address 0x20f in section `.text.startup' d:/msys/mingw/bin/../lib/gcc/i686-w64-mingw32/4.7.1/../../../../i686-w64-mingw32/bin/ld.exe: final link failed: Invalid operation
collect2.exe: error: ld returned 1 exit status
make: *** [clzip] Error 1


Instead, the old method, setmode(), works.

#if defined(__OS2__)
  _fsetmode( stdin, "b" );
  _fsetmode( stdout, "b" );
#endif
#if defined(__MSVCRT__)
  setmode(STDIN_FILENO, O_BINARY);
  setmode(STDOUT_FILENO, O_BINARY);
#endif

BTW it will be nice to #define strtoll as _strtoi64, as older w32api versions will not have this defined.

#define strtoll _strtoi64

for clzip, does unistd.h is really needed? In TinyCC win32 environment, it doesn't have it. I commented they out and it builds with tcc(although the result binary is slow).

HTH,
Roy


_______________________________________________
Lzip-bug mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/lzip-bug

Reply via email to