mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-05-23 05:42:29 +00:00
Make Cosmopolitan ANSI C89 compatible
You can now use cosmopolitan.h with an ANSI C89 compiler like MSVC. The Cosmopolitan codebase itself won't support being compiled that way. But you can build objects that link against Cosmopolitan using any compiler and you can furthermore use tools like IntelliSense that can't even GNU See also #40
This commit is contained in:
parent
46085797b6
commit
a8d7195777
34 changed files with 262 additions and 9561 deletions
|
@ -10,19 +10,19 @@ COSMOPOLITAN_C_START_
|
|||
╚────────────────────────────────────────────────────────────────────────────│*/
|
||||
|
||||
typedef struct FILE {
|
||||
uint8_t bufmode; // 0x00 _IOFBF, etc. (ignored if fd=-1)
|
||||
bool noclose; // 0x01 for fake dup()
|
||||
uint32_t iomode; // 0x04 O_RDONLY, etc. (ignored if fd=-1)
|
||||
int32_t state; // 0x08 0=OK, -1=EOF, >0=errno
|
||||
int fd; // 0x0c ≥0=fd, -1=closed|buffer
|
||||
uint32_t beg; // 0x10
|
||||
uint32_t end; // 0x14
|
||||
uint8_t *buf; // 0x18
|
||||
uint32_t size; // 0x20
|
||||
uint32_t nofree; // 0x24
|
||||
int (*reader)(struct FILE *); // 0x28
|
||||
int (*writer)(struct FILE *); // 0x30
|
||||
int pid; // 0x34
|
||||
uint8_t bufmode; /* 0x00 _IOFBF, etc. (ignored if fd=-1) */
|
||||
bool noclose; /* 0x01 for fake dup() */
|
||||
uint32_t iomode; /* 0x04 O_RDONLY, etc. (ignored if fd=-1) */
|
||||
int32_t state; /* 0x08 0=OK, -1=EOF, >0=errno */
|
||||
int fd; /* 0x0c ≥0=fd, -1=closed|buffer */
|
||||
uint32_t beg; /* 0x10 */
|
||||
uint32_t end; /* 0x14 */
|
||||
uint8_t *buf; /* 0x18 */
|
||||
uint32_t size; /* 0x20 */
|
||||
uint32_t nofree; /* 0x24 */
|
||||
int (*reader)(struct FILE *); /* 0x28 */
|
||||
int (*writer)(struct FILE *); /* 0x30 */
|
||||
int pid; /* 0x34 */
|
||||
} FILE;
|
||||
|
||||
extern FILE *stdin;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue