facebook / proxygen

A collection of C++ HTTP libraries including an easy to use HTTP server.
Other
8.16k stars 1.5k forks source link

Building Proxygen in Windows #471

Closed SteveSelva closed 1 year ago

SteveSelva commented 1 year ago

Is it possible to build the latest version of Proxygen in Windows?

I am encountering an error while building Proxygen.

Severity Code Description Project File Line Suppression State Error C2760 syntax error: 'ss' was unexpected here; expected ';' proxygen E:\proxygen\proxygen\lib\services\RequestWorkerThread.cpp 56
Error C2059 syntax error: ')' proxygen E:\proxygen\proxygen\lib\services\RequestWorkerThread.cpp 74

RequestWorkerThread.cpp

void RequestWorkerThread::setup() {
  CHECK(evb_);
  evb_->runImmediatelyOrRunInEventBaseThreadAndWait([&]() {
    sigset_t ss;             //Error at this line (identifier "sigset_t" is undefined) 

    // Ignore some signals
    sigemptyset(&ss);
    sigaddset(&ss, SIGHUP);
    sigaddset(&ss, SIGINT);
    sigaddset(&ss, SIGQUIT);
    sigaddset(&ss, SIGUSR1);
    sigaddset(&ss, SIGUSR2);
    sigaddset(&ss, SIGPIPE);
    sigaddset(&ss, SIGALRM);
    sigaddset(&ss, SIGTERM);
    sigaddset(&ss, SIGCHLD);
    sigaddset(&ss, SIGIO);
    PCHECK(pthread_sigmask(SIG_BLOCK, &ss, nullptr) == 0);

    currentRequestWorker_ = this;
    callback_.workerStarted(this);
  });
}

Is there any way to fix this and build Proxygen in Windows?