winmain.c, remove of fcn 'read' in Windows
This commit is contained in:
parent
31dca54eba
commit
78ea2e1523
|
|
@ -44,18 +44,6 @@ int win_x_vfprintf(FILE *stream, const char *format, void *arglist);
|
||||||
int win_x_vprintf(const char *format, void *arglist);
|
int win_x_vprintf(const char *format, void *arglist);
|
||||||
/* int win_x_vscanf(const char *format, void *arglist); */
|
/* int win_x_vscanf(const char *format, void *arglist); */
|
||||||
|
|
||||||
#ifdef _MSC_VER
|
|
||||||
#if _MSC_VER < 1500
|
|
||||||
/* VC++ 6.0, VC++ 2005 */
|
|
||||||
_CRTIMP int __cdecl read(int fd, void *buf, unsigned int n);
|
|
||||||
#else
|
|
||||||
/* VC++ 2008 */
|
|
||||||
_CRTIMP int __cdecl read(int fd, _Out_bytecap_(_MaxCharCount) void *buf, _In_ unsigned int n);
|
|
||||||
#endif
|
|
||||||
#else
|
|
||||||
int win_x_read(int fd, char *buf, int n);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
int win_x_getc(FILE *fp);
|
int win_x_getc(FILE *fp);
|
||||||
int win_x_getchar(void);
|
int win_x_getchar(void);
|
||||||
int win_x_putchar(const int c);
|
int win_x_putchar(const int c);
|
||||||
|
|
|
||||||
|
|
@ -1407,32 +1407,6 @@ win_x_vscanf(const char *format, void *arglist)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
int
|
|
||||||
win_x_read(int fd, char *buf, int n)
|
|
||||||
{
|
|
||||||
if (fd == 0) {
|
|
||||||
int i = 0;
|
|
||||||
int c;
|
|
||||||
char s[IOBufSize];
|
|
||||||
while (i < n) {
|
|
||||||
c = w_getch();
|
|
||||||
if (c == LF) {
|
|
||||||
// s[i++] = LF;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
if (c != CR)
|
|
||||||
s[i++] = (char)c;
|
|
||||||
}
|
|
||||||
// s[i] = SE;
|
|
||||||
buf = &s[0];
|
|
||||||
return i;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
return _read(fd, buf, n);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
int
|
int
|
||||||
win_x_getc(FILE *fp)
|
win_x_getc(FILE *fp)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue