in reply to Re^6: Read STDOUT from Win32::Job while process is running
in thread Read STDOUT from Win32::Job while process is running

Hmm ... maybe Inline::C should provide an option that allows one to place C code ahead of those inclusions. (TODO ?)

I wonder if, in this case, it wouldn't be possible to pass a -D_WIN32_WINNT=0x0500 to the compiler CCFLAGS?

After all, if CORE/win32.h did its job properly I think it would assign the actual value associated with the OS on which perl was running, not just provide a minimum supported value.

Agreed. But the whole (MS) concept of a define that you specify to say that you want at least version x.xxx, then preventing anything later than version x.xx being included, is a weird way to write header files.

As you say, the best solution to the problem that creates, would be for win32.h to define it to be "the current OS version" at compile time, but I can't find a ready source for that information amongst the MSC pre-defines.


With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.

The start of some sanity?

Replies are listed 'Best First'.
Re^8: Read STDOUT from Win32::Job while process is running
by syphilis (Archbishop) on Mar 12, 2012 at 21:56 UTC
    I wonder if, in this case, it wouldn't be possible to pass a -D_WIN32_WINNT=0x0500 to the compiler CCFLAGS?

    Yes - that works for this case. (I didn't think of doing that.)
    There are, I think, (hypothetical) situations where that approach would be found wanting - eg if the define depended upon what else is defined (#ifdef/#else/#endif), or if you need to include a header.

    I can't find a ready source for that information amongst the MSC pre-defines

    I can't either - it may not exist. The only way I know of is GetOSVersion().

    Cheers,
    Rob
      I can't either - it may not exist. The only way I know of is GetOSVersion().

      That crossed my mind too, but there's no way to get at it in time for the pre-compiler stage.

      One possibility is the ver command:

      c:\test>ver Microsoft Windows [Version 6.0.6001]

      but I can't see a way to use it.


      With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
      Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
      "Science is about questioning the status quo. Questioning authority".
      In the absence of evidence, opinion is indistinguishable from prejudice.

      The start of some sanity?