timovjl,
Your code works fine :
#include <stdio.h>
#define MSVCRT
// msvcrt-supp.h
#ifdef MSVCRT
typedef struct FAKEFILE {
char fake[0x20];
} FAKEFILE;
__declspec(dllimport) extern FAKEFILE _iob[];
#undef stdin
#define stdin (FILE*)(&_iob[0])
#undef stdout
#define stdout (FILE*)(&_iob[1])
#undef stderr
#define stderr (FILE*)(&_iob[2])
#pragma lib "msvcrt.lib"
#endif
int main(int argc, char **argv)
{
int size = sizeof(FILE);
fprintf(stdout, "stdout = %X\n",stdout);
fprintf(stderr, "stderr = %X\n",stderr);
return 0;
}
stdout = 77C4FCA0
stderr = 77C4FCC0