Signed-off-by: Jacek Caban jacek@codeweavers.com ---
Those are very minimalistic, but Wine is very minimalistic about used features, so it should be enough for our needs. We can extend it to support more features like DLL-aware atexit() or global constructors if needed.
After experimenting, I think that crt importlib seems the best place for this and it's what MSVC does. mingw instead has separated object files with entry point implementation that are linked into modules. Both this solution and having them in winecrt0 (which would be another possibility) introduces problematic dependency on msvcrt importlib. This can be done, but leads to some unpleasant problems with supporting multiple runtimes. Having it in crt importlibs will allow easy customisations.
dlls/msvcrt/Makefile.in | 5 ++++ dlls/msvcrt/crt_gccmain.c | 31 ++++++++++++++++++++ dlls/msvcrt/crt_main.c | 59 +++++++++++++++++++++++++++++++++++++ dlls/msvcrt/crt_winmain.c | 58 ++++++++++++++++++++++++++++++++++++ dlls/msvcrt/crt_wmain.c | 59 +++++++++++++++++++++++++++++++++++++ dlls/msvcrt/crt_wwinmain.c | 60 ++++++++++++++++++++++++++++++++++++++ 6 files changed, 272 insertions(+) create mode 100644 dlls/msvcrt/crt_gccmain.c create mode 100644 dlls/msvcrt/crt_main.c create mode 100644 dlls/msvcrt/crt_winmain.c create mode 100644 dlls/msvcrt/crt_wmain.c create mode 100644 dlls/msvcrt/crt_wwinmain.c