Skip to content

Commit 0aa9359

Browse files
committed
Fix Windows build for new_response_types test
Test file was missed in d4808b4 which fixed the same pattern in pipe_response_example.cpp. MinGW64 has _pipe, not pipe.
1 parent 8848607 commit 0aa9359

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

test/integ/new_response_types.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,12 @@
1919
*/
2020

2121
#include <curl/curl.h>
22+
#if defined(_WIN32) && !defined(__CYGWIN__)
23+
#include <io.h>
24+
#include <fcntl.h>
25+
#else
2226
#include <unistd.h>
27+
#endif
2328
#include <cstring>
2429
#include <memory>
2530
#include <string>
@@ -66,7 +71,11 @@ class pipe_resource : public http_resource {
6671
public:
6772
shared_ptr<http_response> render_GET(const http_request&) {
6873
int pipefd[2];
74+
#if defined(_WIN32) && !defined(__CYGWIN__)
75+
if (_pipe(pipefd, 4096, _O_BINARY) != 0) {
76+
#else
6977
if (pipe(pipefd) != 0) {
78+
#endif
7079
return std::make_shared<empty_response>(500);
7180
}
7281
const char* msg = "hello from pipe";

0 commit comments

Comments
 (0)