Compile Zeek with MSVC

Allow Zeek to be embedded in another project
This commit is contained in:
Elad Solomon 2021-06-27 17:12:56 +00:00 committed by Tomer Lev
parent 2bd4af7477
commit 3a80b79497
53 changed files with 724 additions and 153 deletions

View file

@ -2,7 +2,9 @@
#pragma once
#include "zeek/Pipe.h"
#if ! defined(_MSC_VER)
#include "Pipe.h"
#endif
namespace zeek::detail
{
@ -22,7 +24,12 @@ public:
* @return a file descriptor that will become ready if the flare has been
* Fire()'d and not yet Extinguished()'d.
*/
int FD() const { return pipe.ReadFD(); }
int FD() const
#if ! defined(_MSC_VER)
{ return pipe.ReadFD(); }
#else
{ return recvfd; }
#endif
/**
* Put the object in the "ready" state.
@ -41,7 +48,11 @@ public:
int Extinguish(bool signal_safe = false);
private:
#if ! defined(_MSC_VER)
Pipe pipe;
#else
int sendfd, recvfd;
#endif
};
} // namespace zeek::detail