wolfssl icon indicating copy to clipboard operation
wolfssl copied to clipboard

[Bug]: syntax errors when compiling on Windows with QUIC enabled

Open farazrbx opened this issue 2 years ago • 1 comments

Contact Details

No response

Version

wolfSSL Release 5.6.6

Description

Build fails on windows using msvc with some syntax errors when quic is enabled. To fix it, I had to add #include <stdint.h> in quic.h for uint8_t And define #define STDERR_FILENO 2 in api.c

Reproduction steps

mkdir build
cd build
cmake -DWOLFSSL_QUIC=yes ..
-- Building for: Visual Studio 17 2022
-- Selecting Windows SDK version 10.0.22621.0 to target Windows 10.0.22631.
-- The C compiler identification is MSVC 19.37.32825.0
-- The ASM compiler identification is MSVC
-- Found assembler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.37.32822/bin/Hostx64/x64/cl.exe
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.37.32822/bin/Hostx64/x64/cl.exe - skipped
...

cmake --build .
```

### Relevant log output

```shell
C:\git\wolfssl-5.6.6\wolfssl\quic.h:60: error: C2143: syntax error: missing ')' before '*'
C:\git\wolfssl-5.6.6\wolfssl\quic.h:60: error: C2143: syntax error: missing ';' before '*'
C:\git\wolfssl-5.6.6\wolfssl\quic.h:60: error: C2059: syntax error: '*'
C:\git\wolfssl-5.6.6\wolfssl\quic.h:62: error: C2059: syntax error: ')'
C:\git\wolfssl-5.6.6\wolfssl\quic.h:68: error: C2143: syntax error: missing ')' before '*'
C:\git\wolfssl-5.6.6\wolfssl\quic.h:68: error: C2143: syntax error: missing '{' before '*'
...

C:\git\wolfssl-5.6.6\tests\api.c:56577: error: Use of undeclared identifier 'STDERR_FILENO'
C:\git\wolfssl-5.6.6\tests\api.c:56638: error: Use of undeclared identifier 'STDERR_FILENO'
```

farazrbx avatar Jan 10 '24 19:01 farazrbx

https://github.com/wolfSSL/wolfssl/pull/7072/files#diff-4ad5e7d88f301c016f6a46f3bbe8a9f8dc1db4f9c5bbd74e796e6f7ff36e0a9eR35

dgarske avatar Jan 10 '24 19:01 dgarske

Fixed by https://github.com/wolfSSL/wolfssl/pull/7072

farazrbx avatar Mar 01 '24 00:03 farazrbx