Den 2009-01-28 23:44 skrev Peter Rosin:
Den 2009-01-28 16:13 skrev Charles Wilson:
Peter Rosin wrote:
Maybe, here are the errors:
So, I guess these declarations should do it (untested):
int _setmode (int, int);
int _spawnv (int, const char *, const char * const *);
#ifndef _P_WAIT /* just in case */
# define _P_WAIT 0
#endif
_P_WAIT is guarded in MSVC's process.h by #ifndef _POSIX_ (as opposed to
__STRICT_ANSI__). In MinGW's process.h, it is not guarded at all (but
P_WAIT is guarded by _NO_OLDNAMES).
#ifndef _STAT_DEFINED
struct _stat
{
_dev_t st_dev; /* Equivalent to drive number 0=A 1=B
... */
_ino_t st_ino; /* Always zero ? */
_mode_t st_mode; /* See above constants */
short st_nlink; /* Number of links. */
short st_uid; /* User: Maybe significant on NT ? */
short st_gid; /* Group: Ditto */
_dev_t st_rdev; /* Seems useless (not even filled in) */
_off_t st_size; /* File size in bytes */
time_t st_atime; /* Accessed date (always 00:00 hrs local
* on FAT) */
time_t st_mtime; /* Modified time */
time_t st_ctime; /* Creation time */
};
#endif /* _STAT_DEFINED */
Something is not right here. I took a look at the pre-preocessed output
from mingw-gcc -std=c89 -E lt-foo.c, and both 'struct stat' and 'struct
_stat' were declared. Further, looking at the MinGW sys/stat.h, I can't
see where any of the compile flags we are using -- even the restrictive
ones -- would exclude those declarations.
Are you using the MSVC include files here? I thought the test case was:
I don't think I do...
I was right.
I'll get back when I have inspected some preprocessor output...
I have:
$ gcc -v
Reading specs from C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/specs
Configured with: ../gcc/configure --with-gcc --with-gnu-ld --with-gnu-as --host=mingw32 --target=mingw32 --prefix=/mingw --enable-threads --disable-nls --enable-languages=c,c++,f77,ada,objc,java
--disable-win32-registry --disable-shared --enable-sjlj-exceptions --enable-libgcj --disable-java-awt --without-x --enable-java-gc=boehm --disable-libgcj-debug --enable-interpreter
--enable-hash-synchronization --enable-libstdcxx-debug
Thread model: win32
gcc version 3.4.2 (mingw-special)
"gcc -std=c89 -E" on lt-usea.c has exactly one occurence of stat.h:
# 1 "C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/sys/stat.h" 1 3
No declaration from it though.
That file is like this:
/*
* stat.h
*
* Symbolic constants for opening and creating files, also stat, fstat and
* chmod functions.
*
* This file is part of the Mingw32 package.
*
* Contributors:
* Created by Colin Peters <co...@bird.fu.is.saga-u.ac.jp>
*
* THIS SOFTWARE IS NOT COPYRIGHTED
*
* This source code is offered for use in the public domain. You may
* use, modify or distribute it freely.
*
* This code is distributed in the hope that it will be useful but
* WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
* DISCLAIMED. This includes but is not limited to warranties of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*
* $Revision: 1.5 $
* $Author: earnie $
* $Date: 2003/02/21 21:19:52 $
*
*/
#ifndef __STRICT_ANSI__
/*stuff*/
#endif /* Not __STRICT_ANSI__ */
So, no struct _stat or anything like it for me...
Cheers,
Peter