Re: w32api.h

2021-12-14 Thread Hans-Bernhard Bröker

Am 14.12.2021 um 18:45 schrieb robhic...@gmx.com:

Hi Cygwin,



I'm compiling a non Cygwin code using  ./config, make, make install.


How exactly are you using "./config"?  Is it a normal GNU autoconf 
./configure script?  If so, you should probably have made that point to 
the mingw cross-compilers distributed with cygwin, e.g.


./configure --host=i686-w64-mingw32

Other configuration script generators (hopefully) have similar wayss of 
pointing them at a compiler target other than the native one.  For a 
non-Cygwin project expecting Windows API headers, a MingW cross 
compilation like the above is a whole lot more likely to just work than 
a mash-up Cygwin-with-Windows-headers-on-top one.



The make output  says  /include/w32api  file or directory not found.


Make output is most likely just a symptom here.  The problem happened 
during configuration.  It probably tried to locate those files in 
$(some_prefix)/include/w32api, but didn't find any prefix that applied. 
 So now $(some_prefix) evaluates to an empty string.



I also notice that w32api.h defines every version of windows but stops at
windows8.

[...]

Is it permissible to add



#define windows10  0X0603


Well, there's no law forbidding it ;-)

But it's fragile (may be overwritten by any update of the package it 
came from), and would be somewhat beside the point.  Those definitions, 
like it says in the comment right above them, are just a gimmick for the 
user to make selecting a target version slightly easier.  You can just 
as easily set your WINVER to 0x0603 directly, instead of relying on your 
locally patched version of a standard header file, where that local 
change will probably be updated away the very week you completely forget 
about that tweak you made, many moons ago.  And it wouldn't work for 
anyone else you passed your sources to, either, because they would be 
lacking that local modification.


--
Problem reports:  https://cygwin.com/problems.html
FAQ:  https://cygwin.com/faq/
Documentation:https://cygwin.com/docs.html
Unsubscribe info: https://cygwin.com/ml/#unsubscribe-simple


Re: w32api.h

2021-12-14 Thread Marco Atzeri

On 14.12.2021 18:45, robhic...@gmx.com wrote:

Hi Cygwin,



I'm compiling a non Cygwin code using  ./config, make, make install.



The make output  says  /include/w32api  file or directory not found.


probably you can at configure stage set the
prefix of include directory as "/usr"



I'm guessing /include is not a standard directory, so I copied the
/usr/include/w32api to /include/w32api/, the warning goes way.


a simple link was also probably enough

  mkdir /include
  ln -s /usr/include/w32api to /include/w32api

but checking the prefix is better.



I also notice that w32api.h defines every version of windows but stops at
windows8.

#define WindowsVista 0x0600

#define Windows7   0x0601

#define Windows8   0x0602


Is it permissible to add

#define windows10  0X0603


what is your scope ?
If the original headers are not using that definition
adding it make no difference

By the way
https://docs.microsoft.com/en-us/cpp/porting/modifying-winver-and-win32-winnt?view=msvc-170

reports a different value:

--
#define _WIN32_WINNT_WIN7   0x0601 // Windows 7
#define _WIN32_WINNT_WIN8   0x0602 // Windows 8
#define _WIN32_WINNT_WINBLUE0x0603 // Windows 8.1
#define _WIN32_WINNT_WINTHRESHOLD   0x0A00 // Windows 10
#define _WIN32_WINNT_WIN10  0x0A00 // Windows 10
--

Regards
Marco


--
Problem reports:  https://cygwin.com/problems.html
FAQ:  https://cygwin.com/faq/
Documentation:https://cygwin.com/docs.html
Unsubscribe info: https://cygwin.com/ml/#unsubscribe-simple