oatpp / oatpp-libressl

oatpp secure ConnectionProvider based on libressl
https://oatpp.io/
Apache License 2.0
4 stars 9 forks source link

'SIGPIPE': undeclared identifier on Windows #14

Closed ktnr closed 3 years ago

ktnr commented 3 years ago

I get the following build error on Windows:

>------ Build started: Project: CMakeLists, Configuration: Debug ------
  [1/2] Building CXX object test\CMakeFiles\module-tests.dir\oatpp-libressl\tests.cpp.obj
  FAILED: test/CMakeFiles/module-tests.dir/oatpp-libressl/tests.cpp.obj 
  C:\PROGRA~2\MIB055~1\2019\COMMUN~1\VC\Tools\MSVC\1428~1.293\bin\Hostx64\x64\cl.exe  /nologo /TP -DCERT_CRT_PATH=\"C:/Users/Leo/Source/Repos/oatpp-libressl/test/../utility/cert/test_cert.crt\" -DCERT_PEM_PATH=\"C:/Users/Leo/Source/Repos/oatpp-libressl/test/../utility/cert/test_key.pem\" -I..\..\..\test -I..\..\..\src -I"C:\Program Files (x86)\oatpp\include\oatpp-1.2.5\oatpp" -IC:\Users\Leo\Source\Repos\libressl-3.2.4\out\install\x64-Release\include /DWIN32 /D_WINDOWS /W3 /GR /EHsc /MDd /Zi /Ob0 /Od /RTC1 /showIncludes /Fotest\CMakeFiles\module-tests.dir\oatpp-libressl\tests.cpp.obj /Fdtest\CMakeFiles\module-tests.dir\ /FS -c ..\..\..\test\oatpp-libressl\tests.cpp
C:\Users\Leo\Source\Repos\oatpp-libressl\test\oatpp-libressl\tests.cpp(24): error C2065: 'SIGPIPE': undeclared identifier
  ninja: build stopped: subcommand failed.

Build failed.

SIGPIPE does not seem to be available on Windows: https://github.com/facebook/buck/issues/1645 These guys just skipped it if they detect windows. I have no idea about networking, is it ok to just add some #ifdef _WIN32?

When std::signal(SIGPIPE, SIG_IGN); in test.cpp is commented out, the build succeeds.

lganzzzo commented 3 years ago

Hey @ktnr ,

Yes, there is no sigpipe on Windows. Its good to just commend it out or to add ifdefs.

Also, feel free to send a PR.

FYI there is an oatpp-openssl available since v 1.2.5.

Regards, Leonid