Skip to content

Instantly share code, notes, and snippets.

@notwa
Created July 15, 2019 21:08
Show Gist options
  • Save notwa/3f6575667c430f5339df3ab6dd0103a5 to your computer and use it in GitHub Desktop.
Save notwa/3f6575667c430f5339df3ab6dd0103a5 to your computer and use it in GitHub Desktop.
msvcrt stuff
/* 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