ucrtbase: Fix FILE _flag values.

This commit is contained in:
Shengdun Wang 2024-06-12 13:01:31 +02:00 committed by Alexandre Julliard
parent 90e59859ce
commit 1163e39937
3 changed files with 11 additions and 1 deletions

View file

@ -34,6 +34,14 @@ typedef struct _iobuf
int _bufsiz; int _bufsiz;
char* _tmpfname; char* _tmpfname;
} FILE; } FILE;
#define _IOREAD 0x0001
#define _IOWRT 0x0002
#define _IORW 0x0004
#define _IOEOF 0x0008
#define _IOERR 0x0010
#define _IOMYBUF 0x0040
#define _IOSTRG 0x1000
#endif #endif
#endif #endif

View file

@ -110,7 +110,7 @@ static void test_iobuf_layout(void)
ok(!(fp.iobuf->_flag & 0x40), "fp.iobuf->_flag = %x\n", fp.iobuf->_flag); ok(!(fp.iobuf->_flag & 0x40), "fp.iobuf->_flag = %x\n", fp.iobuf->_flag);
r = fprintf(fp.f, "%s", "init"); r = fprintf(fp.f, "%s", "init");
ok(r == 4, "fprintf returned %d\n", r); ok(r == 4, "fprintf returned %d\n", r);
todo_wine ok(fp.iobuf->_flag & 0x40, "fp.iobuf->_flag = %x\n", fp.iobuf->_flag); ok(fp.iobuf->_flag & 0x40, "fp.iobuf->_flag = %x\n", fp.iobuf->_flag);
ok(fp.iobuf->_cnt + 4 == fp.iobuf->_bufsiz, "_cnt = %d, _bufsiz = %d\n", ok(fp.iobuf->_cnt + 4 == fp.iobuf->_bufsiz, "_cnt = %d, _bufsiz = %d\n",
fp.iobuf->_cnt, fp.iobuf->_bufsiz); fp.iobuf->_cnt, fp.iobuf->_bufsiz);

View file

@ -11,6 +11,7 @@
#include <corecrt_wstdio.h> #include <corecrt_wstdio.h>
/* file._flag flags */ /* file._flag flags */
#ifndef _UCRT
#define _IOREAD 0x0001 #define _IOREAD 0x0001
#define _IOWRT 0x0002 #define _IOWRT 0x0002
#define _IOMYBUF 0x0008 #define _IOMYBUF 0x0008
@ -18,6 +19,7 @@
#define _IOERR 0x0020 #define _IOERR 0x0020
#define _IOSTRG 0x0040 #define _IOSTRG 0x0040
#define _IORW 0x0080 #define _IORW 0x0080
#endif
#define STDIN_FILENO 0 #define STDIN_FILENO 0
#define STDOUT_FILENO 1 #define STDOUT_FILENO 1