Author Topic: daily msvc  (Read 210 times)

Offline TimoVJL

  • Global Moderator
  • Member
  • *****
  • Posts: 1657
daily msvc
« on: February 18, 2018, 09:55:32 am »

And also an example using miniz to unpack the compilers only.

Commandline options for testing with PellesC include files ;)
Code: [Select]
cl.exe -c -GS- -Zl -wd4103 -Dinline=_inline -Drestrict=__restrictx64:
Code: [Select]
cl.exe -c -GS- -Zl -wd4103 -Dinline=_inline -Drestrict=__restrict -D__POCC_TARGET__=3
An alternate WinAPI fSDK© - Frankie's SDK for PellesC
useful Add-In SrcFileCcl Add-In

A tiny startup code to use msvcrt.dll and PellesC stdio.h
Code: [Select]
// msvcrt_main_poc
#ifndef _DLL
#error("use runtime DLL -MD")

#pragma comment(lib, "msvcrt.lib")
#if _MSC_VER >= 17
# ifdef _WIN64
#  pragma comment(linker,"/subsystem:console,5.2")
# else
#  pragma comment(linker,"/subsystem:console,5.1")
# endif

typedef struct _iobuf {
char *_ptr;
int _cnt;
char *_base;
int _flag;
int _file;
int _charbuf;
int _bufsiz;
char *_tmpfname;

__declspec(dllimport) extern MSFILE * __cdecl __iob_func();

#ifdef _M_X64
MSFILE * __imp___stdin;
MSFILE * __imp___stdout;
MSFILE * __imp___stderr;
MSFILE * _imp____stdin;
MSFILE * _imp____stdout;
MSFILE * _imp____stderr;

void __cdecl mainCRTStartup(void)
__declspec(dllimport) int __cdecl __getmainargs(int*, char***, char***, int, void*);
__declspec(dllimport) void __cdecl exit(int status);
int __cdecl main(int argc, char **argv);

int    argc;
char** argv;
char** env;
int    sinfo = 0;
#ifdef _M_X64
__imp___stdin = &__iob_func()[0];
__imp___stdout = &__iob_func()[1];
__imp___stderr = &__iob_func()[2];
_imp____stdin = &__iob_func()[0];
_imp____stdout = &__iob_func()[1];
_imp____stderr = &__iob_func()[2];

« Last Edit: March 11, 2018, 08:34:42 pm by TimoVJL »
May the source be with you