[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Tinycc-devel] Outdated .def files

From: Christian Jullien
Subject: Re: [Tinycc-devel] Outdated .def files
Date: Sat, 18 Sep 2021 14:36:43 +0200

Hi Grischka,

I fact I processed differently. I was very disappointed to see that my code
compiled by tcc reported "Windows 10" on "Windows 11" because kernel32.def
lacks the few API I recently added for this purpose.
Right after this push, I generated a kernel32.def from my Windows 10 machine
to see what are the differences from the version in tcc repo.
Diff is quite large as the latest kernel32.def is 3x times bigger.

Now the right question is. If I need xx function present in Windows yy and
not already in kernel32.def what should I do?
An easy, but very egoist, solution is to generate new versions of .def form
Windows yy kernel32.dll and use it **locally** to compile my project.
But other people will have to do the same for their own projects.

I have the impression that if you use a kernel32.def from a recent Windows
version you can still dynamic link with kernel32.dll as long as you only use
functions from this specific version.
Hence, an old kernel32.def prevents to use more recent API while a very
recent kernel32.def allows to use any version (but you may experience error
at runtime if the function you use is not present in kernel32.dll).

The most portable solution is of course to query function xx using
LoadLibrary/GetProcAddress but is it very tedious if you have a large number
of functions you want to use esp. if you target Windows versions all having
xx function. 

There is no good solution but, IMHO, an updated kernel32.def gives more


-----Original Message-----
From: grischka [mailto:grishka@gmx.de] 
Sent: Saturday, September 18, 2021 14:06
To: jullien@eligis.com; tinycc-devel@nongnu.org
Subject: Re: [Tinycc-devel] Outdated .def files

Christian Jullien wrote:
> Hi,
> If I regenerate a kernel32.def out of kernel32.dll on my Windows 10 21H1
> machine it is 3x times bigger that the one that currently comes with
> tcc. (see enclosed)
> It means many kernel32 API are not directly available for tcc.
> It is probably the same with other .def files
> What do you advice ?

Hi Christian,

didn't you already give the answer by your last commit that adds
3 functions to the kernel.def that we currently have.

You would not have done that if you wanted to replace it all together
with a newer version.

Not at least since you recently did promise not to touch the push button
until you actually did find the solution suited to stay for a decent
while without further intervention from either yourself or from other

-- grischka

reply via email to

[Prev in Thread] Current Thread [Next in Thread]