forked from epics-base/epics-base
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
osdSockUnsentCount.c add MSVC version check
- Loading branch information
1 parent
fc04d12
commit d5bc04a
Showing
1 changed file
with
1 addition
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
d5bc04a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'#if defined (_WIN32) && WINVER >= _WIN32_WINNT_WIN10' is not sufficient?
Unfortunately I don't have all kinds of old Visual Studio installations available.
d5bc04a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I would prefer '&& defined(SIO_TCP_INFO)'
d5bc04a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
WINVER / _WIN32_WINNT define the target windows platform for your build, which can be different from what you are building on. I think this build failed on a Windows 2012 R2 server using the appveyor 2015 build image which includes several versions of visual studio from 2015 downwards but also includes the Windows 10 sdk. If you do not specify a target windows version in the header, it defaults to the most recent. So it looks like the build has picked up a windows 10 SDK and is targetting that, but the visual studio version is not supported by this windows sdk. I think Visual Studio 2015 is a minimum for W10, so some check along the lines of Michael's suggestion is appropriate. I don't know if this is an issue with how the things have been installed on the appveyor image, or lack of a check in the SDK headers as "this combination of sdk and visual studio is not supposed to occur"
d5bc04a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BTW the current _MSC_VER test would exclude mingw, if mingw supports this on W10 then we just need to adjust the check logic a bit.
d5bc04a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Merged version is 5e6226e which only looks for the existence of
SIO_TCP_INFO
.@dirk-zimoch As there is not yet any unit test coverage, and failures are silent, can you verify that I haven't broken anything? It would be excellent if you could create a short test program which connects to itself through localhost and shows that
epicsSocketUnsentCount()
can return 0?d5bc04a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Compiles and works on my Win10. I cannot test on older Windows Versions, not even on older Win10 where it may compile but not work because SIO_TCP_INFO is defined but the WSAIoctl call fails with an 'unsupported' error.
How to see it: var logClientDebug 2, then shut down the logServer and then send a message: errlog test
I'll write a test program.