Liste des Groupes | Revenir à cl c |
On 02/07/2024 14:27, Michael S wrote:On Tue, 2 Jul 2024 12:22:53 +0100Well, both tcc and mcc (my product) import msvcrt, not that runtime
bart <bc@freeuk.com> wrote:>
Both make use of msvcrt.dll. I don't consider it a dependency since
it has always been part of Windows. (I first starting using it in
1990s, from my other language, before I knew much about C, as it
had a simpler file API than Windows.)
>
Lots of other applications use it too. Including older gcc binaries
and applications compiled with those.
>
On Windows 11, probably 10 too, msvcrt.dll's printf routines
support %zu, and so does Tcc.
Not really.
DLL that supports newer feature has different name -
VCRUNTIME140.dll And choice of DLL version is not directly related
to the version of Windows.
file, and printf/zu works.
You can test it directly using the program below if you like.
If you think that the OS craftily substitutues vcruntime140.dll in
place of msvcrt.dll, then copy "c:\windows\system32\msvcrt.dll" to
"fred.dll", to a folder where it can be found. Then change "msvcrt"
beflow to "fred".
If %zu it doesn't work, then maybe your copy is old.
---------------------------
#include <windows.h>
#include <stdlib.h>
int main(void) {
int (*PRINTF)(const char*, ...);
HINSTANCE libinst;
libinst=LoadLibrary("msvcrt");
if (libinst==NULL) exit(1);
PRINTF=GetProcAddress(libinst, "printf");
if (PRINTF==NULL) exit(1);
PRINTF("sizeof void* = %zu\n", sizeof(void*));
}
---------------------------
Les messages affichés proviennent d'usenet.