FILE_NAME_INFO struct in 'glib/gmessages.c'

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

FILE_NAME_INFO struct in 'glib/gmessages.c'

John Emmas-2
I just tried building Glib from git master (non-meson build at the moment).

In 'config.h.win32.in' it looks like the value of _WIN32_WINNT got
increased to 0x601.  This means that when building 'glib/gmessages.c'
the struct _FILE_NAME_INFO is no longer defined. However... it's still
getting referenced in the function 'win32_is_pipe_tty()'

Similarly... HAVE_IF_NAMETOINDEX is defined to '1' in a couple of places
- which means that in 'gio/gsocket.c' the function 'if_nametoindex()' is
NOT defined.  But again it gets called in a couple of places.  It looks
like the Glib definition was maybe intended to support older versions of
MSVC (I'm using VC-8).  So does this mean that VC-8 will be getting
dropped soon?  Thanks,

John
_______________________________________________
gtk-devel-list mailing list
[hidden email]
https://mail.gnome.org/mailman/listinfo/gtk-devel-list
LRN
Reply | Threaded
Open this post in threaded view
|

Re: FILE_NAME_INFO struct in 'glib/gmessages.c'

LRN
On 9/15/2017 3:44 PM, John Emmas wrote:
> I just tried building Glib from git master (non-meson build at the moment).
>
> In 'config.h.win32.in' it looks like the value of _WIN32_WINNT got
> increased to 0x601.  This means that when building 'glib/gmessages.c'
> the struct _FILE_NAME_INFO is no longer defined. However... it's still
> getting referenced in the function 'win32_is_pipe_tty()'


In MinGW _FILE_NAME_INFO is declared in winbase.h, ifdefed under _WIN32_WINNT
>= 0x0600, whereas winbase.h is included from windows.h, which gmessages.c does
include. I'm assuming that MSVC SDK has similar header layout, so it should work.

Anyway, i'll let fanc answer this one, as he's the MSVC guy around here.

--
O< ascii ribbon - stop html email! - http://arc.pasp.de/

_______________________________________________
gtk-devel-list mailing list
[hidden email]
https://mail.gnome.org/mailman/listinfo/gtk-devel-list

0x8DADE9276759BA74.asc (3K) Download Attachment
signature.asc (836 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: FILE_NAME_INFO struct in 'glib/gmessages.c'

Gtk+ - Dev - General mailing list
In reply to this post by John Emmas-2
Hi John,

John Emmas 於 2017/9/15 下午 08:44 寫道:

> I just tried building Glib from git master (non-meson build at the
> moment).
>
> In 'config.h.win32.in' it looks like the value of _WIN32_WINNT got
> increased to 0x601.  This means that when building 'glib/gmessages.c'
> the struct _FILE_NAME_INFO is no longer defined. However... it's still
> getting referenced in the function 'win32_is_pipe_tty()'
>
> Similarly... HAVE_IF_NAMETOINDEX is defined to '1' in a couple of
> places - which means that in 'gio/gsocket.c' the function
> 'if_nametoindex()' is NOT defined.  But again it gets called in a
> couple of places.  It looks like the Glib definition was maybe
> intended to support older versions of MSVC (I'm using VC-8).  So does
> this mean that VC-8 will be getting dropped soon?  Thanks,

The items you mentioned are done as fallbacks as XP did not support
these items, hence we mimic them in the code, so yes, the plan is to
drop these *XP fallbacks* (but not necessarily *Visual Studio 2005*, at
the moment).

It has been brought up on quite a number of occasions (and over quite
some time) that XP support should have been dropped, and nowadays
Windows 7 is the oldest supported version of Windows by Microsoft, hence
the bump of _WIN32_WINNT to 0x0601.  I think it is best to do this kind
of bump early on in the cycle to reduce surprises to people.

Are you using the Windows SDK that came with your Visual Studio 2005? 
These items that you mentioned are in the Server 2008 (7.0) SDKs, which
work with Visual Studio 2005 (and the Windows 7 (7.1) SDKs does work
with 2005 as well)--I built GLib-2.54.0 with Meson-generated *config.h
files (which also had #define _WIN32_WINNT 0x0601) with Visual C++ 2008
against the Server 2008 and ran the test programs and they work better
than builds using the the older *config.h files.  Code-wise, as long as
there is no drop of the 2008~2012 projects (or things like a
sufficiently C99-compliant compiler is required), 2005 should most
probably work (with these later SDKs installed and used).

Hope this clears up things.

With blessings, and cheers!


.
_______________________________________________
gtk-devel-list mailing list
[hidden email]
https://mail.gnome.org/mailman/listinfo/gtk-devel-list
Reply | Threaded
Open this post in threaded view
|

Re: FILE_NAME_INFO struct in 'glib/gmessages.c'

John Emmas-2
On 15/09/2017 17:25, Chun-wei Fan (范君維) wrote:
>
> Are you using the Windows SDK that came with your Visual Studio 2005? 
> These items that you mentioned are in the Server 2008 (7.0) SDKs,
> which work with Visual Studio 2005 (and the Windows 7 (7.1) SDKs does
> work with 2005 as well)
>

Thanks for the quick response.

It looks like I have VS2005 installed and also the corresponding DirectX
SDK.  I can't see any other SDK's that are specific to VS2005.

I'm assuming you're referring to this SDK?

https://www.microsoft.com/en-us/download/details.aspx?id=11310

If so, it seems to depend on VS2008 SP1 so are you really sure those
SDK's would be compatible with VS2005?  StackOverflow suggests they
aren't...

https://stackoverflow.com/questions/171816/vc9-and-vc8-lib-compatibility

2005 and 2008 will use different CRT modules and you can't normally link
stuff to two different CRT libraries.   I'd be a bit surprised if
they're compatible... :-(

John
_______________________________________________
gtk-devel-list mailing list
[hidden email]
https://mail.gnome.org/mailman/listinfo/gtk-devel-list
Reply | Threaded
Open this post in threaded view
|

Re: FILE_NAME_INFO struct in 'glib/gmessages.c'

Gtk+ - Dev - General mailing list
Hi John,

John Emmas 於 2017/9/16 上午 03:00 寫道:
> It looks like I have VS2005 installed and also the corresponding
> DirectX SDK.  I can't see any other SDK's that are specific to VS2005.

This means that you are using the Windows SDK that came with your Visual
Studio 2005

> I'm assuming you're referring to this SDK?

Yes, this is the SDK I was mentioning.  It does work for Visual Studio
2005, see https://msdn.microsoft.com/en-us/windowsserver/bb986638.aspx 
under "Supported Compiler, Platform and related software".

For the Windows 7 (7.1) SDK, see
https://www.microsoft.com/en-us/download/details.aspx?id=8279&751be11f-ede8-5a0c-058c-2ee190a24fa6=True&e6b34bbe-475b-1abd-2c51-b5034bcdd6d2=True 
under "System Requirements".  I think it might be best for you to use
the 7.1 SDK.
>
> https://stackoverflow.com/questions/171816/vc9-and-vc8-lib-compatibility
>
> 2005 and 2008 will use different CRT modules and you can't normally
> link stuff to two different CRT libraries.   I'd be a bit surprised if
> they're compatible... :-(

This is true for non-Windows-system code, but note that the DLLs
provided by the system (i.e. those that is linked by the SDK) link to
msvcrt.dll, not msvcr90.dll.  Note that the SDK provides headers and
..lib's (this is the same as what MinGW/MSYS does, but from a GCC on
Windows perspective), not the system DLLs since they are already on your
system since the time you installed Windows and any applicable updates.

Hope this clears things up.

With blessings, and cheers!


.
_______________________________________________
gtk-devel-list mailing list
[hidden email]
https://mail.gnome.org/mailman/listinfo/gtk-devel-list
Reply | Threaded
Open this post in threaded view
|

Re: FILE_NAME_INFO struct in 'glib/gmessages.c'

John Emmas-2
On 16/09/2017 02:41, Chun-wei Fan (范君維) wrote:
>
> John Emmas 於 2017/9/16 上午 03:00 寫道:
>
>> I'm assuming you're referring to this SDK?
>
> Yes, this is the SDK I was mentioning.  It does work for Visual Studio
> 2005, see https://msdn.microsoft.com/en-us/windowsserver/bb986638.aspx 
> under "Supported Compiler, Platform and related software".
>

Thanks Fanc (I'm never quite sure what to call you !)

For Windows programming, I've always been wary of trying to
"mix-and-match" between different MSVC libraries (regardless of that
Microsoft says!).  So how about this for a compromise...

If the idea is to drop support for Win-XP (and yet retain support for
VS2005) we could achieve it with some quite simple changes. Only 2 or 3
files would need to get changed and it's mostly just stuff like this...

wherever we currently use this:-

         #if _WIN32_WINNT < 0x0600

we'd change it to this:-

         #if (_WIN32_WINNT < 0x0600 || (defined(_MSC_VER) && _MSC_VER <
1500))

I'd be happy to produce a full patch if you like.  I've already tried it
here with VS2005 and glib is now building fine again.  Best regards,

John
_______________________________________________
gtk-devel-list mailing list
[hidden email]
https://mail.gnome.org/mailman/listinfo/gtk-devel-list
Reply | Threaded
Open this post in threaded view
|

Re: FILE_NAME_INFO struct in 'glib/gmessages.c'

Gtk+ - Dev - General mailing list
Hi John,


John Emmas 於 2017/9/17 上午 12:05 寫道:
> For Windows programming, I've always been wary of trying to
> "mix-and-match" between different MSVC libraries (regardless of that
> Microsoft says!).  So how about this for a compromise...
>
> If the idea is to drop support for Win-XP (and yet retain support for
> VS2005) we could achieve it with some quite simple changes. Only 2 or
> 3 files would need to get changed and it's mostly just stuff like this...

Unfortunately, it is unlikely that patches of this sort can be accepted
upstream, because one of the main reasons for the drop of XP support is
to also clean up the code base, so that block you were mentioning is
likely to be dropped soon for the master branch (hence the reason "I
think it is the best to make such bumps early in the cycle", so people
can test and check their code).

Note that even when you use the SDK that comes with Visual Studio 2005,
your code still links to the various system DLLs that are already
present on your system that are either there when you installed Windows,
or installed via an update, i.e. the same DLLs that will be linked with
the Server 2008/Windows 7 SDKs.  Note also, the .lib's that link to DLLs
are essentially the ones that tell the linker "make this code call this
DLL that I am indicating here to carry out the things needed from this
library".  I think there are no separate copies of a system DLL that
link to different Microsoft CRTs.  I think your best bet is to try your
code built with Visual Studio 2005 using the Server 2008 and/or Windows
7 SDKs, and see how your code runs.  If that is not an option, I think
you will need to maintain your own private build compatibility layer
that your code will compile (and link) to (especially that you used your
own VS 2005 projects).  There are more and more projects that simply do
not (or stopped) supporting XP.

Hope this helps.

With blessings, and cheers!

.
_______________________________________________
gtk-devel-list mailing list
[hidden email]
https://mail.gnome.org/mailman/listinfo/gtk-devel-list