|
From: Motiejus J. <des...@gm...> - 2012-09-24 19:58:27
|
On Mon, Sep 24, 2012 at 08:50:43PM +0100, Motiejus Jakštys wrote: > Sox couldn't compile on 32-bit mingw due to stat and fstat defintions > pointing to wrong structs. Now check where they point to and define > accordingly. Reason: it did not compile on mingw32 4.2.1: [ 1%] Building C object src/CMakeFiles/libsox.dir/formats_i.obj In file included from /home/motiejus/code/stuff/sox/src/formats_i.c:23: /usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/include/sys/stat.h:122: error: redefinition of ‘struct _stati64’ make[2]: *** [src/CMakeFiles/libsox.dir/formats_i.obj] Error 1 make[1]: *** [src/CMakeFiles/libsox.dir/all] Error 2 make: *** [all] Error 2 And when I manually removed _stati64 definition: /usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/include/sys/stat.h:173: error: conflicting types for ‘_fstati64’ /usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/include/sys/stat.h:166: error: previous declaration of ‘_fstati64’ was here /home/motiejus/code/stuff/sox/src/formats_i.c: In function ‘lsx_filelength’: /home/motiejus/code/stuff/sox/src/formats_i.c:144: warning: passing argument 2 of ‘_fstati64’ from incompatible pointer type make[2]: *** [src/CMakeFiles/libsox.dir/formats_i.obj] Error 1 make[1]: *** [src/CMakeFiles/libsox.dir/all] Error 2 make: *** [all] Error 2 If I understand correctly, it defines stat to _stat or _stati64, depending on architecture. So I just check for them with cmake. It might be overkill to do it that way. If it is, let me know. :) Regards, Motiejus Jakštys |