On Sun, 18 Oct 2015, Nikolay Sivov wrote:
On 18.10.2015 22:20, Martin Storsjo wrote:
+EXTRADEFS = -D_MT -D_MSVCR_VER=140 -DVCRUNTIME
Is it not enough to have MSVCR_VER only? E.g. is it possible to have MSVCR_VER defined to 140 and undefined VCRUNTIME at the same time?
Yes - that combo is used for building ucrtbase.dll at the moment.
- case DLL_PROCESS_ATTACH:
+// msvcrt_init_exception(hinstDLL);
- if(!msvcrt_init_tls()) {
Debug leftovers?
Ah, yes.
I guess calling this might be necessary later, once/if the functions that are in cpp.c are hooked up for building in vcruntime140. I currently didn't need those functions, so I didn't try to disentangle them from the rest of the msvcrt internal state yet. But it shouldn't be left here, indeed.
diff --git a/dlls/msvcrt/main-vcruntime.c b/dlls/msvcrt/main-vcruntime.c new file mode 100644 index 0000000..ccbe6a9 --- /dev/null +++ b/dlls/msvcrt/main-vcruntime.c
This looks like a workaround to me. Will it work to duplicate this in vcruntime140 or consolidate it in some way making it usable from msvcrt and vcruntime*?
I'm not quite sure I understand your question completely.
If it's about the duplication of code; I guess one could keep the normal main.c and either split it into multiple files and just include some of them here, and disable parts of it with ifdefs (since this DLL shouldn't have most of the normal msvcrt internal state). If it's about the source file being in the msvcrt directory even though it's not used by the normal msvcrt, I guess that can be moved to the vcruntime140 directory as well.
// Martin