Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
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
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
0a26d420
Commit
0a26d420
authored
Oct 15, 2001
by
Francois Gouget
Committed by
Alexandre Julliard
Oct 15, 2001
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
The _IOXXX macros conflict with system headers on Solaris. Prefix
them.
parent
3ed8cc57
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
41 additions
and
30 deletions
+41
-30
file.c
dlls/msvcrt/file.c
+22
-22
stdio.h
include/msvcrt/stdio.h
+19
-8
No files found.
dlls/msvcrt/file.c
View file @
0a26d420
...
...
@@ -148,7 +148,7 @@ static MSVCRT_FILE* msvcrt_alloc_fp(int fd)
{
MSVCRT_files
[
fd
]
->
_file
=
fd
;
MSVCRT_files
[
fd
]
->
_flag
=
MSVCRT_flags
[
fd
];
MSVCRT_files
[
fd
]
->
_flag
&=
~
_IOAPPEND
;
/* mask out, see above */
MSVCRT_files
[
fd
]
->
_flag
&=
~
MSVCRT_
_IOAPPEND
;
/* mask out, see above */
}
}
TRACE
(
":got FILE* (%p)
\n
"
,
MSVCRT_files
[
fd
]);
...
...
@@ -162,11 +162,11 @@ void msvcrt_init_io(void)
int
i
;
memset
(
MSVCRT__iob
,
0
,
3
*
sizeof
(
MSVCRT_FILE
));
MSVCRT_handles
[
0
]
=
GetStdHandle
(
STD_INPUT_HANDLE
);
MSVCRT_flags
[
0
]
=
MSVCRT__iob
[
0
].
_flag
=
_IOREAD
;
MSVCRT_flags
[
0
]
=
MSVCRT__iob
[
0
].
_flag
=
MSVCRT_
_IOREAD
;
MSVCRT_handles
[
1
]
=
GetStdHandle
(
STD_OUTPUT_HANDLE
);
MSVCRT_flags
[
1
]
=
MSVCRT__iob
[
1
].
_flag
=
_IOWRT
;
MSVCRT_flags
[
1
]
=
MSVCRT__iob
[
1
].
_flag
=
MSVCRT_
_IOWRT
;
MSVCRT_handles
[
2
]
=
GetStdHandle
(
STD_ERROR_HANDLE
);
MSVCRT_flags
[
2
]
=
MSVCRT__iob
[
2
].
_flag
=
_IOWRT
;
MSVCRT_flags
[
2
]
=
MSVCRT__iob
[
2
].
_flag
=
MSVCRT_
_IOWRT
;
TRACE
(
":handles (%d)(%d)(%d)
\n
"
,
MSVCRT_handles
[
0
],
MSVCRT_handles
[
1
],
MSVCRT_handles
[
2
]);
...
...
@@ -376,7 +376,7 @@ int _eof(int fd)
* will be set by the read()/write() functions.
*/
if
(
MSVCRT_files
[
fd
])
return
MSVCRT_files
[
fd
]
->
_flag
&
_IOEOF
;
return
MSVCRT_files
[
fd
]
->
_flag
&
MSVCRT_
_IOEOF
;
/* Otherwise we do it the hard way */
curpos
=
SetFilePointer
(
hand
,
0
,
NULL
,
SEEK_CUR
);
...
...
@@ -433,7 +433,7 @@ LONG _lseek(int fd, LONG offset, int whence)
if
((
ret
=
SetFilePointer
(
hand
,
offset
,
NULL
,
whence
))
!=
0xffffffff
)
{
if
(
MSVCRT_files
[
fd
])
MSVCRT_files
[
fd
]
->
_flag
&=
~
_IOEOF
;
MSVCRT_files
[
fd
]
->
_flag
&=
~
MSVCRT_
_IOEOF
;
/* FIXME: What if we seek _to_ EOF - is EOF set? */
return
ret
;
}
...
...
@@ -444,7 +444,7 @@ LONG _lseek(int fd, LONG offset, int whence)
case
ERROR_NEGATIVE_SEEK
:
case
ERROR_SEEK_ON_DEVICE
:
MSVCRT__set_errno
(
GetLastError
());
MSVCRT_files
[
fd
]
->
_flag
|=
_IOERR
;
MSVCRT_files
[
fd
]
->
_flag
|=
MSVCRT_
_IOERR
;
break
;
default:
break
;
...
...
@@ -459,7 +459,7 @@ void MSVCRT_rewind(MSVCRT_FILE* file)
{
TRACE
(
":file (%p) fd (%d)
\n
"
,
file
,
file
->
_file
);
_lseek
(
file
->
_file
,
0
,
SEEK_SET
);
file
->
_flag
&=
~
(
_IOEOF
|
_IOERR
);
file
->
_flag
&=
~
(
MSVCRT__IOEOF
|
MSVCRT_
_IOERR
);
}
/*********************************************************************
...
...
@@ -530,7 +530,7 @@ int _flushall(void)
{
if
(
_commit
(
i
)
==
-
1
)
if
(
MSVCRT_files
[
i
])
MSVCRT_files
[
i
]
->
_flag
|=
_IOERR
;
MSVCRT_files
[
i
]
->
_flag
|=
MSVCRT_
_IOERR
;
num_flushed
++
;
}
...
...
@@ -732,15 +732,15 @@ int _open(const char *path,int flags,...)
{
case
_O_RDONLY
:
access
|=
GENERIC_READ
;
ioflag
|=
_IOREAD
;
ioflag
|=
MSVCRT_
_IOREAD
;
break
;
case
_O_WRONLY
:
access
|=
GENERIC_WRITE
;
ioflag
|=
_IOWRT
;
ioflag
|=
MSVCRT_
_IOWRT
;
break
;
case
_O_RDWR
:
access
|=
GENERIC_WRITE
|
GENERIC_READ
;
ioflag
|=
_IORW
;
ioflag
|=
MSVCRT_
_IORW
;
break
;
}
...
...
@@ -761,7 +761,7 @@ int _open(const char *path,int flags,...)
creation
=
OPEN_EXISTING
;
}
if
(
flags
&
_O_APPEND
)
ioflag
|=
_IOAPPEND
;
ioflag
|=
MSVCRT_
_IOAPPEND
;
flags
|=
_O_BINARY
;
/* FIXME: Default to text */
...
...
@@ -800,7 +800,7 @@ int _open(const char *path,int flags,...)
{
if
(
flags
&
_O_TEMPORARY
)
MSVCRT_tempfiles
[
fd
]
=
_strdup
(
path
);
if
(
ioflag
&
_IOAPPEND
)
if
(
ioflag
&
MSVCRT_
_IOAPPEND
)
_lseek
(
fd
,
0
,
FILE_END
);
}
...
...
@@ -905,13 +905,13 @@ int _read(int fd, void *buf, unsigned int count)
if
(
num_read
!=
count
&&
MSVCRT_files
[
fd
])
{
TRACE
(
":EOF
\n
"
);
MSVCRT_files
[
fd
]
->
_flag
|=
_IOEOF
;
MSVCRT_files
[
fd
]
->
_flag
|=
MSVCRT_
_IOEOF
;
}
return
num_read
;
}
TRACE
(
":failed-last error (%ld)
\n
"
,
GetLastError
());
if
(
MSVCRT_files
[
fd
])
MSVCRT_files
[
fd
]
->
_flag
|=
_IOERR
;
MSVCRT_files
[
fd
]
->
_flag
|=
MSVCRT_
_IOERR
;
return
-
1
;
}
...
...
@@ -1158,7 +1158,7 @@ int _write(int fd, const void* buf, unsigned int count)
return
-
1
;
/* If appending, go to EOF */
if
(
MSVCRT_flags
[
fd
]
&
_IOAPPEND
)
if
(
MSVCRT_flags
[
fd
]
&
MSVCRT_
_IOAPPEND
)
_lseek
(
fd
,
0
,
FILE_END
);
/* Set _cnt to 0 so optimised binaries will call our implementation
...
...
@@ -1173,7 +1173,7 @@ int _write(int fd, const void* buf, unsigned int count)
TRACE
(
":failed-last error (%ld)
\n
"
,
GetLastError
());
if
(
MSVCRT_files
[
fd
])
MSVCRT_files
[
fd
]
->
_flag
|=
_IOERR
;
MSVCRT_files
[
fd
]
->
_flag
|=
MSVCRT_
_IOERR
;
return
-
1
;
}
...
...
@@ -1192,7 +1192,7 @@ int _putw(int val, MSVCRT_FILE* file)
void
MSVCRT_clearerr
(
MSVCRT_FILE
*
file
)
{
TRACE
(
":file (%p) fd (%d)
\n
"
,
file
,
file
->
_file
);
file
->
_flag
&=
~
(
_IOERR
|
_IOEOF
);
file
->
_flag
&=
~
(
MSVCRT__IOERR
|
MSVCRT_
_IOEOF
);
}
/*********************************************************************
...
...
@@ -1202,7 +1202,7 @@ int MSVCRT_fclose(MSVCRT_FILE* file)
{
int
r
;
r
=
_close
(
file
->
_file
);
return
((
r
==
MSVCRT_EOF
)
||
(
file
->
_flag
&
_IOERR
)
?
MSVCRT_EOF
:
0
);
return
((
r
==
MSVCRT_EOF
)
||
(
file
->
_flag
&
MSVCRT_
_IOERR
)
?
MSVCRT_EOF
:
0
);
}
/*********************************************************************
...
...
@@ -1210,7 +1210,7 @@ int MSVCRT_fclose(MSVCRT_FILE* file)
*/
int
MSVCRT_feof
(
MSVCRT_FILE
*
file
)
{
return
file
->
_flag
&
_IOEOF
;
return
file
->
_flag
&
MSVCRT_
_IOEOF
;
}
/*********************************************************************
...
...
@@ -1218,7 +1218,7 @@ int MSVCRT_feof(MSVCRT_FILE* file)
*/
int
MSVCRT_ferror
(
MSVCRT_FILE
*
file
)
{
return
file
->
_flag
&
_IOERR
;
return
file
->
_flag
&
MSVCRT_
_IOERR
;
}
/*********************************************************************
...
...
include/msvcrt/stdio.h
View file @
0a26d420
...
...
@@ -15,14 +15,25 @@
/* file._flag flags */
#define _IOREAD 0x0001
#define _IOWRT 0x0002
#define _IOMYBUF 0x0008
#define _IOEOF 0x0010
#define _IOERR 0x0020
#define _IOSTRG 0x0040
#define _IORW 0x0080
#define _IOAPPEND 0x0200
#ifndef USE_MSVCRT_PREFIX
#define _IOREAD 0x0001
#define _IOWRT 0x0002
#define _IOMYBUF 0x0008
#define _IOEOF 0x0010
#define _IOERR 0x0020
#define _IOSTRG 0x0040
#define _IORW 0x0080
#define _IOAPPEND 0x0200
#else
#define MSVCRT__IOREAD 0x0001
#define MSVCRT__IOWRT 0x0002
#define MSVCRT__IOMYBUF 0x0008
#define MSVCRT__IOEOF 0x0010
#define MSVCRT__IOERR 0x0020
#define MSVCRT__IOSTRG 0x0040
#define MSVCRT__IORW 0x0080
#define MSVCRT__IOAPPEND 0x0200
#endif
/* USE_MSVCRT_PREFIX */
#ifndef USE_MSVCRT_PREFIX
...
...
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