+2011-04-04 Tobias Burnus <burnus@net-b.de>
+
+ * unix.c: Adapt stat DEFINEs since MinGW64 supports LFS.
+ (fallback_access, open_internal4, compare_file_filename,
+ find_file, file_size, inquire_sequential, inquire_direct,
+ inquire_formatted): Use "struct stat" instead of gfstat_t.
+
2011-03-27 Tobias Burnus <burnus@net-b.de>
PR fortran/18918
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
+#if !defined(_FILE_OFFSET_BITS) || _FILE_OFFSET_BITS != 64
+#undef lseek
#define lseek _lseeki64
+#undef fstat
#define fstat _fstati64
+#undef stat
#define stat _stati64
-typedef struct _stati64 gfstat_t;
+#endif
#ifndef HAVE_WORKING_STAT
static uint64_t
}
#endif
-
-#else
-typedef struct stat gfstat_t;
#endif
#ifndef PATH_MAX
if (mode == F_OK)
{
- gfstat_t st;
+ struct stat st;
return stat (path, &st);
}
static stream *
fd_to_stream (int fd)
{
- gfstat_t statbuf;
+ struct stat statbuf;
unix_stream *s;
s = get_mem (sizeof (unix_stream));
compare_file_filename (gfc_unit *u, const char *name, int len)
{
char path[PATH_MAX + 1];
- gfstat_t st;
+ struct stat st;
#ifdef HAVE_WORKING_STAT
unix_stream *s;
#else
#ifdef HAVE_WORKING_STAT
-# define FIND_FILE0_DECL gfstat_t *st
+# define FIND_FILE0_DECL struct stat *st
# define FIND_FILE0_ARGS st
#else
# define FIND_FILE0_DECL uint64_t id, const char *file, gfc_charlen_type file_len
find_file (const char *file, gfc_charlen_type file_len)
{
char path[PATH_MAX + 1];
- gfstat_t st[1];
+ struct stat st[1];
gfc_unit *u;
#if defined(__MINGW32__) && !HAVE_WORKING_STAT
uint64_t id = 0ULL;
file_size (const char *file, gfc_charlen_type file_len)
{
char path[PATH_MAX + 1];
- gfstat_t statbuf;
+ struct stat statbuf;
if (unpack_filename (path, file, file_len))
return -1;
inquire_sequential (const char *string, int len)
{
char path[PATH_MAX + 1];
- gfstat_t statbuf;
+ struct stat statbuf;
if (string == NULL ||
unpack_filename (path, string, len) || stat (path, &statbuf) < 0)
inquire_direct (const char *string, int len)
{
char path[PATH_MAX + 1];
- gfstat_t statbuf;
+ struct stat statbuf;
if (string == NULL ||
unpack_filename (path, string, len) || stat (path, &statbuf) < 0)
inquire_formatted (const char *string, int len)
{
char path[PATH_MAX + 1];
- gfstat_t statbuf;
+ struct stat statbuf;
if (string == NULL ||
unpack_filename (path, string, len) || stat (path, &statbuf) < 0)