Created
July 15, 2019 21:08
-
-
Save notwa/3f6575667c430f5339df3ab6dd0103a5 to your computer and use it in GitHub Desktop.
msvcrt stuff
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* WHAT: build code against the ancient Visual Studio 6.0 msvcrt.lib */ | |
/* WHY: sizecoding; please refer to crinkler's manual.txt */ | |
/* HOW: by replacing some of VS 14.0's definitions with VS 6.0's */ | |
#define _NO_CRT_STDIO_INLINE 1 | |
struct _iobuf { | |
char *_ptr; | |
int _cnt; | |
char *_base; | |
int _flag; | |
int _file; | |
int _charbuf; | |
int _bufsiz; | |
char *_tmpfname; | |
}; | |
typedef struct _iobuf FILE; | |
#define _FILE_DEFINED | |
#include "stdio.h" | |
extern FILE *_iob; | |
#undef stdin | |
#undef stdout | |
#undef stderr | |
#define stdin (&_iob[0]) | |
#define stdout (&_iob[1]) | |
#define stderr (&_iob[2]) | |
/* your code goes here! */ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment