Re: [Tinycc-devel] Outdated .def files

2021-09-18 Thread Christian Jullien
GetVersionEx is also odd as it is stuck to 8 the version it returns for
Windows 10 and 11 by default.
To make it return the right version you need to call mt tool with a manifest
file like below.


 OpenLisp by Eligis
 
 
  
   
   
   
   
   
   
   
   
   
   
  
 
 
 
  
   

   
  
 


But tcc has no mt patching tool as you know.
To let tcc toolchain working without other Microsoft VC++ tools I wrote my
on mt version and I asked the group the permission to push it but got no
reply.
The tool is here:
https://sourceforge.net/p/wintcc/svn/HEAD/tree/ports/mt/mt.c
Feel free to take it if you like. It may be part of tcc front end like "tcc
-mt" similar to "tcc -ar"

Christian 

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

Christian Jullien wrote:
> 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.

As far as I can see, "Windows 11" identifies itself as 10.0.21995(++),
that is "Windows 10" with a build number >= 21995.

And that information can be obtained simply with "GetVersion()" which
exists forever in all windoses.

While it seems that the API you just did add to the tinycc kernel32.def
already has been depreciated again:

 "VerifyVersionInfoA function (winbase.h)
  ...
  Note: This function has been deprecated for Windows 10. See 'targeting
  your applications for Windows' for more information."

And even the old GetVersionEx() was admittedly added only for the stupids:

 "The GetVersionEx function was developed because many existing
  applications err when examining the packed DWORD value returned
  by GetVersion, transposing the major and minor version numbers..."

(of course it's not the applications but the people who wrote them).

Seen that I'm inclined to think that much of the 3 times as big kernel32.def
from newer windoses that you did mention doesn't really serve a purpose
other
than to support an increasing stupidity (or at least the assumption of it)
?!?

Or otherwise that the purpose is to make people feel more stupid than they
really are:
"In time there will be a way to properly detect Windows 11, I'm sure
 Microsoft is still figuring out the most complicated way to make life
 more difficult for developers"
and
"Don't worry, they have a guy for that I'm sure."

comments from
https://www.techpowerup.com/forums/threads/gpu-z-2-40-2-vs-windows-11.283417
/

Really I don't care which scenario they want to prepare for with their OS,
but then again is is still up to us where we make TinyCC to go.

In any case saying "OUtdated .def files" means to me that you didn't really
understand anything of it.

As a fact the files were "outdated" already in their very first incarnation
when added in 2005 and haven't seen any significant changes since then.
Therefor "outdated" isn't really a category for something that never was
up-to-date nor ever even tried to be.

Btw. the easiest way to have all the functions of the windows system dll's
is just to delete the tinycc .def files on your computer.

--- grischka


___
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel


Re: [Tinycc-devel] Outdated .def files

2021-09-18 Thread grischka

Christian Jullien wrote:

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.


As far as I can see, "Windows 11" identifies itself as 10.0.21995(++),
that is "Windows 10" with a build number >= 21995.

And that information can be obtained simply with "GetVersion()" which
exists forever in all windoses.

While it seems that the API you just did add to the tinycc kernel32.def
already has been depreciated again:

"VerifyVersionInfoA function (winbase.h)
 ...
 Note: This function has been deprecated for Windows 10. See 'targeting
 your applications for Windows' for more information."

And even the old GetVersionEx() was admittedly added only for the stupids:

"The GetVersionEx function was developed because many existing
 applications err when examining the packed DWORD value returned
 by GetVersion, transposing the major and minor version numbers..."

(of course it's not the applications but the people who wrote them).

Seen that I'm inclined to think that much of the 3 times as big kernel32.def
from newer windoses that you did mention doesn't really serve a purpose other
than to support an increasing stupidity (or at least the assumption of it) ?!?

Or otherwise that the purpose is to make people feel more stupid than they
really are:
   "In time there will be a way to properly detect Windows 11, I'm sure
Microsoft is still figuring out the most complicated way to make life
more difficult for developers"
and
   "Don't worry, they have a guy for that I'm sure."

comments from
https://www.techpowerup.com/forums/threads/gpu-z-2-40-2-vs-windows-11.283417/

Really I don't care which scenario they want to prepare for with their OS,
but then again is is still up to us where we make TinyCC to go.

In any case saying "OUtdated .def files" means to me that you didn't really
understand anything of it.

As a fact the files were "outdated" already in their very first incarnation
when added in 2005 and haven't seen any significant changes since then.
Therefor "outdated" isn't really a category for something that never was
up-to-date nor ever even tried to be.

Btw. the easiest way to have all the functions of the windows system dll's
is just to delete the tinycc .def files on your computer.

--- grischka


___
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel


Re: [Tinycc-devel] Outdated .def files

2021-09-18 Thread Christian Jullien
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
choices.

C.

-Original Message-
From: grischka [mailto:gris...@gmx.de] 
Sent: Saturday, September 18, 2021 14:06
To: jull...@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
people.

-- grischka



___
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel


Re: [Tinycc-devel] Outdated .def files

2021-09-18 Thread Christian Jullien
If I use recent VC++ on Windows 10, I can limit myself to the set of API 
supported by XP and the result will (should) run on Windows XP.

If I however use specific Windows 10 API, it will hand on XP.

 

My opinion is that tcc should use a recent (latest?) kernel32.def and let the 
user decide what subset he supports.

 

In theory, _WIN32_WINNT should limit the subset an application can see by 
giving only the definitions available for a given version. I’m far from certain 
that our .h is aware of the different definitions.

A least a tcc developer will be able to supply its own declaration and use the 
associated definition in kernel32.def

 

M2c

 

From: avih [mailto:avih...@yahoo.com] 
Sent: Saturday, September 18, 2021 08:09
To: tinycc-devel@nongnu.org; jull...@eligis.com
Subject: Re: [Tinycc-devel] Outdated .def files

 

I _think_ the current win32 definitions are from Windows XP.

If we update to newer definitions, then I assume it would compile
successfully programs which use newer APIs, but the question is
what happens at runtime.

mingw has a system to define what to target (I don't recall the
specifics), so unless tcc's mingw files already have it, I think
it would need to be added, or at least considered.

- avih

On Saturday, September 18, 2021, 09:03:12 AM GMT+3, 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 ?

 

 

___
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel

___
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel


Re: [Tinycc-devel] Outdated .def files

2021-09-18 Thread avih via Tinycc-devel
 I _think_ the current win32 definitions are from Windows XP.

If we update to newer definitions, then I assume it would compile
successfully programs which use newer APIs, but the question is
what happens at runtime.

mingw has a system to define what to target (I don't recall the
specifics), so unless tcc's mingw files already have it, I think
it would need to be added, or at least considered.

- avih

 On Saturday, September 18, 2021, 09:03:12 AM GMT+3, 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 ?

  

  
___
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel
  ___
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel


[Tinycc-devel] Outdated .def files

2021-09-18 Thread Christian Jullien
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 ?

 

 



kernel32.def
Description: Binary data
___
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel