[Spice-devel] [PATCH spice-server] red-stream: Fix compilation on Fedora 30 for Windows using MingW

Uri Lublin uril at redhat.com
Thu Jun 13 11:44:55 UTC 2019


On 6/13/19 12:57 PM, Frediano Ziglio wrote:
>> On 6/12/19 1:53 PM, Frediano Ziglio wrote:
>>> On Windows Fedora 30 reports these errors:
>>>
>>> In file included from
>>> /usr/x86_64-w64-mingw32/sys-root/mingw/include/openssl/crypto.h:29,
>>>                    from
>>>                    /usr/x86_64-w64-mingw32/sys-root/mingw/include/openssl/bio.h:20,
>>>                    from
>>>                    /usr/x86_64-w64-mingw32/sys-root/mingw/include/openssl/err.h:21,
>>>                    from red-stream.c:31:
>>> /usr/x86_64-w64-mingw32/sys-root/mingw/include/openssl/x509.h:75:1: error:
>>> pasting "stack_st_" and "(" does not give a valid preprocessing token
>>>    DEFINE_STACK_OF(X509_NAME)
>>>    ^~~~~~~~~~~~~~~
>>> /usr/x86_64-w64-mingw32/sys-root/mingw/include/openssl/x509.h:75:17: error:
>>> expected ')' before numeric constant
>>>    DEFINE_STACK_OF(X509_NAME)
>>>                    ^~~~~~~~~
>>> ...
>>>
>>> This is due to missing X509_NAME definition by Windows headers.
>>> Incude missing header in order to make code compile again.
>>>
>>> Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
>>> ---
>>>    server/red-stream.c | 2 ++
>>>    1 file changed, 2 insertions(+)
>>>
>>> diff --git a/server/red-stream.c b/server/red-stream.c
>>> index 3057d8bbb..77fed097e 100644
>>> --- a/server/red-stream.c
>>> +++ b/server/red-stream.c
>>> @@ -24,6 +24,8 @@
>>>    #include <netdb.h>
>>>    #include <sys/socket.h>
>>>    #include <netinet/tcp.h>
>>> +#else
>>> +#include <ws2tcpip.h>
>>
>> I see X509_NAME is defined in wincrypt.h
>>
>> I did not follow the include-path but since
>> the Linux side includes network h-files it
>> makes sense the windows side will do the same.
>>
>> Uri.
>>
> 
> Windows and Unix (so Linux) include files for network are quite
> different so the #ifdef. I included this header as I noted that
> this was done in reds.c and the problem didn't happen so for
> coherence I included that specific header.
> 

Acked-by: Uri Lublin <uril at redhat.com>



More information about the Spice-devel mailing list