mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 14:48:21 +00:00
introduced pthread.h include in util.h for MSVC. Squashed warnning originated from this file and also merged a few ifdefs into one place
This commit is contained in:
parent
78fb845f63
commit
71540c5eff
1 changed files with 18 additions and 22 deletions
40
src/util.h
40
src/util.h
|
@ -32,13 +32,11 @@
|
||||||
#ifdef TIME_WITH_SYS_TIME
|
#ifdef TIME_WITH_SYS_TIME
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
#include <ctime>
|
#include <ctime>
|
||||||
#else
|
#elif defined(HAVE_SYS_TIME_H)
|
||||||
#ifdef HAVE_SYS_TIME_H
|
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
#else
|
#else
|
||||||
#include <ctime>
|
#include <ctime>
|
||||||
#endif
|
#endif
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
|
|
||||||
|
@ -49,6 +47,9 @@
|
||||||
#define DEBUG_fputs fputs
|
#define DEBUG_fputs fputs
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
#ifdef MSTCPIP_ASSERT_UNDEFINED
|
||||||
|
#undef ASSERT
|
||||||
|
#endif
|
||||||
|
|
||||||
#define ASSERT(x)
|
#define ASSERT(x)
|
||||||
#define DEBUG_MSG(...)
|
#define DEBUG_MSG(...)
|
||||||
|
@ -64,6 +65,11 @@ extern HeapLeakChecker* heap_checker;
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
|
extern "C"
|
||||||
|
{
|
||||||
|
#include "zeek/3rdparty/modp_numtoa.h"
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef HAVE_LINUX
|
#ifdef HAVE_LINUX
|
||||||
#include <pthread.h>
|
#include <pthread.h>
|
||||||
#include <sys/prctl.h>
|
#include <sys/prctl.h>
|
||||||
|
@ -73,21 +79,17 @@ extern HeapLeakChecker* heap_checker;
|
||||||
#include <pthread_np.h>
|
#include <pthread_np.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(_MSC_VER)
|
#ifdef _MSC_VER
|
||||||
|
#include <pthread.h>
|
||||||
|
#include <filesystem>
|
||||||
|
namespace zeek { namespace filesystem = std::filesystem; }
|
||||||
inline constexpr std::string_view path_list_separator = ";";
|
inline constexpr std::string_view path_list_separator = ";";
|
||||||
#else
|
#else
|
||||||
inline constexpr std::string_view path_list_separator = ":";
|
// Expose ghc::filesystem as zeek::filesystem until we can
|
||||||
#endif
|
// switch to std::filesystem on all platforms.
|
||||||
|
|
||||||
extern "C"
|
|
||||||
{
|
|
||||||
#include "zeek/3rdparty/modp_numtoa.h"
|
|
||||||
}
|
|
||||||
|
|
||||||
#if defined(_MSC_VER)
|
|
||||||
#include <filesystem>
|
|
||||||
#else
|
|
||||||
#include "zeek/3rdparty/ghc/filesystem.hpp"
|
#include "zeek/3rdparty/ghc/filesystem.hpp"
|
||||||
|
namespace zeek { namespace filesystem = ghc::filesystem; }
|
||||||
|
inline constexpr std::string_view path_list_separator = ":";
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
using zeek_int_t = int64_t;
|
using zeek_int_t = int64_t;
|
||||||
|
@ -108,13 +110,7 @@ namespace zeek
|
||||||
class ODesc;
|
class ODesc;
|
||||||
class RecordVal;
|
class RecordVal;
|
||||||
|
|
||||||
// Expose ghc::filesystem as zeek::filesystem until we can
|
|
||||||
// switch to std::filesystem on all platforms.
|
|
||||||
#if defined(_MSC_VER)
|
|
||||||
namespace filesystem = std::filesystem;
|
|
||||||
#else
|
|
||||||
namespace filesystem = ghc::filesystem;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
namespace util
|
namespace util
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue