Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
riscv-gcc-1
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
riscv-gcc-1
Commits
c9828e78
Commit
c9828e78
authored
Jan 03, 2010
by
Janne Blomqvist
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
PR libfortran/42420 Large file capable stat for MingW
From-SVN: r155593
parent
f18c74a7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
10 deletions
+31
-10
libgfortran/ChangeLog
+13
-0
libgfortran/io/unix.c
+18
-10
No files found.
libgfortran/ChangeLog
View file @
c9828e78
2010-01-03 Janne Blomqvist <jb@gcc.gnu.org>
PR libfortran/42420
* io/unix.c: Defines for MINGW stat and fstat.
(gfstat_t): New typedef.
(id_from_fd): Use gfstat_t instead of struct stat.
(fd_to_stream): Likewise.
(compare_file_filename): Likewise.
(find_file): Likewise.
(file_exists): Likewise.
(inquire_sequential): Likewise.
(inquire_direct): Likewise.
(inquire_formatted): Likewise.
libgfortran/io/unix.c
View file @
c9828e78
...
...
@@ -42,13 +42,17 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
/* For mingw, we don't identify files by their inode number, but by a
64-bit identifier created from a BY_HANDLE_FILE_INFORMATION. */
#if
defined(__MINGW32__) && !HAVE_WORKING_STAT
#if
def __MINGW32__
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#define lseek _lseeki64
#define fstat _fstati64
#define stat _stati64
typedef
struct
_stati64
gfstat_t
;
#ifndef HAVE_WORKING_STAT
static
uint64_t
id_from_handle
(
HANDLE
hFile
)
{
...
...
@@ -92,6 +96,10 @@ id_from_fd (const int fd)
#endif
#else
typedef
struct
stat
gfstat_t
;
#endif
#ifndef PATH_MAX
#define PATH_MAX 1024
#endif
...
...
@@ -781,7 +789,7 @@ open_internal (char *base, int length, gfc_offset offset)
static
stream
*
fd_to_stream
(
int
fd
,
int
prot
)
{
struct
sta
t
statbuf
;
gfstat_
t
statbuf
;
unix_stream
*
s
;
s
=
get_mem
(
sizeof
(
unix_stream
));
...
...
@@ -1220,9 +1228,9 @@ int
compare_file_filename
(
gfc_unit
*
u
,
const
char
*
name
,
int
len
)
{
char
path
[
PATH_MAX
+
1
];
struct
sta
t
st1
;
gfstat_
t
st1
;
#ifdef HAVE_WORKING_STAT
struct
sta
t
st2
;
gfstat_
t
st2
;
#else
# ifdef __MINGW32__
uint64_t
id1
,
id2
;
...
...
@@ -1261,7 +1269,7 @@ compare_file_filename (gfc_unit *u, const char *name, int len)
#ifdef HAVE_WORKING_STAT
# define FIND_FILE0_DECL
struct sta
t *st
# define FIND_FILE0_DECL
gfstat_
t *st
# define FIND_FILE0_ARGS st
#else
# define FIND_FILE0_DECL uint64_t id, const char *file, gfc_charlen_type file_len
...
...
@@ -1318,7 +1326,7 @@ gfc_unit *
find_file
(
const
char
*
file
,
gfc_charlen_type
file_len
)
{
char
path
[
PATH_MAX
+
1
];
struct
sta
t
st
[
2
];
gfstat_
t
st
[
2
];
gfc_unit
*
u
;
#if defined(__MINGW32__) && !HAVE_WORKING_STAT
uint64_t
id
=
0ULL
;
...
...
@@ -1455,7 +1463,7 @@ int
file_exists
(
const
char
*
file
,
gfc_charlen_type
file_len
)
{
char
path
[
PATH_MAX
+
1
];
struct
sta
t
statbuf
;
gfstat_
t
statbuf
;
if
(
unpack_filename
(
path
,
file
,
file_len
))
return
0
;
...
...
@@ -1478,7 +1486,7 @@ const char *
inquire_sequential
(
const
char
*
string
,
int
len
)
{
char
path
[
PATH_MAX
+
1
];
struct
sta
t
statbuf
;
gfstat_
t
statbuf
;
if
(
string
==
NULL
||
unpack_filename
(
path
,
string
,
len
)
||
stat
(
path
,
&
statbuf
)
<
0
)
...
...
@@ -1502,7 +1510,7 @@ const char *
inquire_direct
(
const
char
*
string
,
int
len
)
{
char
path
[
PATH_MAX
+
1
];
struct
sta
t
statbuf
;
gfstat_
t
statbuf
;
if
(
string
==
NULL
||
unpack_filename
(
path
,
string
,
len
)
||
stat
(
path
,
&
statbuf
)
<
0
)
...
...
@@ -1526,7 +1534,7 @@ const char *
inquire_formatted
(
const
char
*
string
,
int
len
)
{
char
path
[
PATH_MAX
+
1
];
struct
sta
t
statbuf
;
gfstat_
t
statbuf
;
if
(
string
==
NULL
||
unpack_filename
(
path
,
string
,
len
)
||
stat
(
path
,
&
statbuf
)
<
0
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment