diff --git a/CMakeLists.txt b/CMakeLists.txt index e52092ca61..9af117bddd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -16,8 +16,6 @@ list(APPEND CMAKE_PREFIX_PATH ${CMAKE_BINARY_DIR}) # Windows: Configure runtime and dependencies if ( MSVC ) - cmake_policy(SET CMP0091 NEW) - # Remove existing runtime flags set(CompilerFlags CMAKE_CXX_FLAGS @@ -82,12 +80,6 @@ if ( MSVC ) find_package(ZLIB) set(ZLIB_LIBRARY ${ZLIB_LIBRARIES}) - # Set Kqueue to point at the right variable. - find_package(kqueue) - set(LIBKQUEUE_ROOT_DIR "${kqueue_INCLUDES}/../") - set(LIBKQUEUE_INCLUDE_DIRS ${kqueue_INCLUDES}) - set(LIBKQUEUE_LIBRARIES ${kqueue_LIBS}) - # Set CAres find_package(c-ares) set(HAVE_CARES true) # Disable FindCAres cmake file diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index d76a47d337..2a62e009c9 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -527,10 +527,10 @@ add_library(zeek_objs OBJECT ${zeek_SRCS}) if (ZEEK_STANDALONE) add_executable(zeek main.cc - $ - ${zeek_HEADERS} - ${bro_SUBDIR_LIBS} - ${bro_PLUGIN_LIBS} + $ + ${zeek_HEADERS} + ${bro_SUBDIR_LIBS} + ${bro_PLUGIN_LIBS} ) target_link_libraries(zeek ${bro_PLUGIN_LINK_LIBS} ${zeekdeps} ${CMAKE_THREAD_LIBS_INIT} ${CMAKE_DL_LIBS}) @@ -569,10 +569,6 @@ if (NOT ZEEK_STANDALONE OR CONAN_EXPORTED) ${CMAKE_BINARY_DIR}/zeek/src ${CMAKE_BINARY_DIR}/zeek/src/include) - if ( WIN32 ) - target_include_directories(libzeek PUBLIC ${CMAKE_SOURCE_DIR}/zeek/src/windows/usr.include) - endif() - install(TARGETS libzeek LIBRARY DESTINATION lib) endif() @@ -582,13 +578,6 @@ if ( NOT WIN32 ) InstallSymlink("${CMAKE_INSTALL_PREFIX}/bin/zeek-wrapper" "${CMAKE_INSTALL_PREFIX}/bin/bro") endif () -if ( NOT BINARY_PACKAGING_MODE ) - # Older plugins may still use `bro` in unit tests. - execute_process(COMMAND "${CMAKE_COMMAND}" -E create_symlink - "${CMAKE_CURRENT_BINARY_DIR}/../zeek-wrapper.in" - "${CMAKE_CURRENT_BINARY_DIR}/bro") -endif () - # Target to create all the autogenerated files. add_custom_target(generate_outputs_stage1) add_dependencies(generate_outputs_stage1 ${bro_ALL_GENERATED_OUTPUTS}) @@ -635,7 +624,6 @@ install(CODE " # Make sure to escape a bunch of special characters in the path before trying to use it as a # regular expression below. string(REGEX REPLACE "([][+.*()^])" "\\\\\\1" escaped_include_path "${CMAKE_CURRENT_SOURCE_DIR}/include/*") -string(REGEX REPLACE "([][+.*()^])" "\\\\\\1" escaped_windows_path "${CMAKE_CURRENT_SOURCE_DIR}/windows/*") if (WIN32) install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/windows/usr.include/ @@ -653,8 +641,6 @@ install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/ PATTERN "3rdparty/*" EXCLUDE # The "zeek -> ." symlink isn't needed in the install-tree REGEX "${escaped_include_path}$" EXCLUDE - # Windows headers are already installed if needed - REGEX "${escaped_windows_path}$" EXCLUDE # FILES_MATCHING creates empty directories: # https://gitlab.kitware.com/cmake/cmake/-/issues/17122 @@ -671,7 +657,7 @@ install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/ PATTERN "*.bif.h" PATTERN "CMakeFiles" EXCLUDE # The "include/zeek -> .." symlink isn't needed in the install-tree - REGEX "${escaped_path}$" EXCLUDE + REGEX "${escaped_include_path}$" EXCLUDE ) install(FILES diff --git a/src/DNS_Mgr.cc b/src/DNS_Mgr.cc index c256b5304d..daaf1d17e2 100644 --- a/src/DNS_Mgr.cc +++ b/src/DNS_Mgr.cc @@ -1,7 +1,5 @@ // See the file "COPYING" in the main distribution directory for copyright. -#include - #include "zeek/DNS_Mgr.h" #include "zeek/zeek-config.h" @@ -12,6 +10,7 @@ #include #include #include +#include #include #include #include diff --git a/src/DebugLogger.h b/src/DebugLogger.h index e60c1b8c3c..6b4daf73c2 100644 --- a/src/DebugLogger.h +++ b/src/DebugLogger.h @@ -13,12 +13,12 @@ #include "zeek/util.h" -#define DBG_LOG(stream, ...) \ - if ( ::zeek::detail::debug_logger.IsEnabled(stream) ) \ +#define DBG_LOG(stream, ...) \ + if ( ::zeek::detail::debug_logger.IsEnabled(stream) ) \ ::zeek::detail::debug_logger.Log(stream, __VA_ARGS__) -#define DBG_LOG_VERBOSE(stream, ...) \ - if ( ::zeek::detail::debug_logger.IsVerbose() && \ - ::zeek::detail::debug_logger.IsEnabled(stream) ) \ +#define DBG_LOG_VERBOSE(stream, ...) \ + if ( ::zeek::detail::debug_logger.IsVerbose() && \ + ::zeek::detail::debug_logger.IsEnabled(stream) ) \ ::zeek::detail::debug_logger.Log(stream, __VA_ARGS__) #define DBG_PUSH(stream) ::zeek::detail::debug_logger.PushIndent(stream) #define DBG_POP(stream) ::zeek::detail::debug_logger.PopIndent(stream) diff --git a/src/Hash.h b/src/Hash.h index 06ec01ae0b..796763d509 100644 --- a/src/Hash.h +++ b/src/Hash.h @@ -19,8 +19,8 @@ #pragma once -#include #include +#include #include "zeek/util.h" // for zeek_int_t diff --git a/src/IntrusivePtr.h b/src/IntrusivePtr.h index 2d8767cb0d..bdeb501e85 100644 --- a/src/IntrusivePtr.h +++ b/src/IntrusivePtr.h @@ -27,6 +27,12 @@ struct NewRef { }; +/** + * This has to be forward decalred and known here in order for us to be able + * cast this in the `Unref` function. + */ +class OpaqueVal; + /** * An intrusive, reference counting smart pointer implementation. Much like * @c std::shared_ptr, this smart pointer models shared ownership of an object @@ -113,7 +119,14 @@ public: ~IntrusivePtr() { if ( ptr_ ) - Unref((zeek::Obj*)ptr_); + { + // Specializing `OpaqueVal` as MSVC compiler does not detect it + // inheriting from `zeek::Obj` so we have to do that manually. + if constexpr ( std::is_same_v ) + Unref(reinterpret_cast(ptr_)); + else + Unref(ptr_); + } } void swap(IntrusivePtr& other) noexcept { std::swap(ptr_, other.ptr_); } diff --git a/src/Options.cc b/src/Options.cc index 458a52f93b..16c5dd8d1b 100644 --- a/src/Options.cc +++ b/src/Options.cc @@ -1,23 +1,21 @@ // See the file "COPYING" in the main distribution directory for copyright. -#include - #include "zeek/Options.h" #include "zeek/zeek-config.h" -#include "zeek/ScriptProfile.h" -#include "zeek/script_opt/ScriptOpt.h" - #if defined(HAVE_GETOPT_H) && ! defined(_MSC_VER) #include #endif +#include #include #include #include #include +#include "zeek/3rdparty/bsd-getopt-long.h" +#include "zeek/ScriptProfile.h" #include "zeek/logging/writers/ascii/Ascii.h" #include "zeek/script_opt/ScriptOpt.h" diff --git a/src/SerializationFormat.cc b/src/SerializationFormat.cc index b723387ceb..f8c67a3c52 100644 --- a/src/SerializationFormat.cc +++ b/src/SerializationFormat.cc @@ -325,13 +325,6 @@ bool BinarySerializationFormat::Write(uint32_t v, const char* tag) return WriteData(&v, sizeof(v)); } -#if defined(_MSC_VER) -bool BinarySerializationFormat::Write(u_long v, const char* tag) - { - return Write((uint32_t) v, tag); - } -#endif - bool BinarySerializationFormat::Write(int v, const char* tag) { DBG_LOG(DBG_SERIAL, "Write int %d [%s]", v, tag); diff --git a/src/SerializationFormat.h b/src/SerializationFormat.h index 060d0a996d..44215792bb 100644 --- a/src/SerializationFormat.h +++ b/src/SerializationFormat.h @@ -126,9 +126,6 @@ public: bool Write(int v, const char* tag) override; bool Write(uint16_t v, const char* tag) override; bool Write(uint32_t v, const char* tag) override; -#if defined(_MSC_VER) - bool Write(u_long v, const char* tag); -#endif bool Write(int64_t v, const char* tag) override; bool Write(uint64_t v, const char* tag) override; bool Write(char v, const char* tag) override; diff --git a/src/Val.cc b/src/Val.cc index 9c3db80752..fc70ef3bdb 100644 --- a/src/Val.cc +++ b/src/Val.cc @@ -3973,12 +3973,11 @@ const PortValPtr& ValManager::Port(uint32_t port_num, TransportProto port_type) port_num = 0; } - std::pair key{port_num, port_type}; - if (ports.find(key) == ports.end()) - { + if ( ports.find(key) == ports.end() ) + { ports[key] = IntrusivePtr{AdoptRef{}, new PortVal(PortVal::Mask(port_num, port_type))}; - } + } return ports[key]; } diff --git a/src/analyzer/Manager.h b/src/analyzer/Manager.h index f33241881d..3cedb549be 100644 --- a/src/analyzer/Manager.h +++ b/src/analyzer/Manager.h @@ -402,7 +402,7 @@ extern analyzer::Manager* analyzer_mgr; DBG_LOG(zeek::DBG_ANALYZER, "%s " txt, \ fmt_conn_id(conn->OrigAddr(), ntohs(conn->OrigPort()), conn->RespAddr(), \ ntohs(conn->RespPort()))); -#define DBG_ANALYZER_ARGS(conn, fmt, ...) \ +#define DBG_ANALYZER_ARGS(conn, fmt, ...) \ DBG_LOG(zeek::DBG_ANALYZER, "%s " fmt, \ fmt_conn_id(conn->OrigAddr(), ntohs(conn->OrigPort()), conn->RespAddr(), \ ntohs(conn->RespPort())), \ diff --git a/src/analyzer/protocol/dns/DNS.cc b/src/analyzer/protocol/dns/DNS.cc index fa22dabbb2..8bb0e76fd0 100644 --- a/src/analyzer/protocol/dns/DNS.cc +++ b/src/analyzer/protocol/dns/DNS.cc @@ -823,8 +823,7 @@ bool DNS_Interpreter::ParseRR_EDNS(detail::DNS_MsgInfo* msg, const u_char*& data case TYPE_TCP_KA: { - EDNS_TCP_KEEPALIVE edns_tcp_keepalive{.keepalive_timeout_omitted = true, - .keepalive_timeout = 0}; + EDNS_TCP_KEEPALIVE edns_tcp_keepalive{true, 0}; if ( option_len == 0 || option_len == 2 ) { // 0 bytes is permitted by RFC 7828, showing that the timeout value is @@ -1736,11 +1735,8 @@ bool DNS_Interpreter::ParseRR_SVCB(detail::DNS_MsgInfo* msg, const u_char*& data name_end = target_name + 1; } - SVCB_DATA svcb_data = { - .svc_priority = svc_priority, - .target_name = make_intrusive( - new String(target_name, name_end - target_name, true)), - }; + SVCB_DATA svcb_data = {svc_priority, make_intrusive(new String( + target_name, name_end - target_name, true))}; // TODO: parse svcparams // we consume all the remaining raw data (svc params) but do nothing. diff --git a/src/input/readers/CMakeLists.txt b/src/input/readers/CMakeLists.txt index c82f175f08..032a286052 100644 --- a/src/input/readers/CMakeLists.txt +++ b/src/input/readers/CMakeLists.txt @@ -5,5 +5,5 @@ add_subdirectory(binary) add_subdirectory(config) add_subdirectory(raw) if (USE_SQLITE) - add_subdirectory(sqlite) + add_subdirectory(sqlite) endif() diff --git a/src/iosource/pcap/Dumper.cc b/src/iosource/pcap/Dumper.cc index 3e7b5e32bb..24a5628fec 100644 --- a/src/iosource/pcap/Dumper.cc +++ b/src/iosource/pcap/Dumper.cc @@ -107,7 +107,7 @@ bool PcapDumper::Dump(const Packet* pkt) return false; // Reconstitute the pcap_pkthdr. - const struct pcap_pkthdr phdr = {.ts = pkt->ts, .caplen = pkt->cap_len, .len = pkt->len}; + const struct pcap_pkthdr phdr = {pkt->ts, pkt->cap_len, pkt->len}; pcap_dump((u_char*)dumper, &phdr, pkt->data); pcap_dump_flush(dumper); diff --git a/src/main.cc b/src/main.cc index aeb15627f5..2796ebf1ad 100644 --- a/src/main.cc +++ b/src/main.cc @@ -1,9 +1,9 @@ // See the file "COPYING" in the main distribution directory for copyright. -#include - #include "zeek/zeek-config.h" +#include + #include "zeek/RunState.h" #include "zeek/iosource/Manager.h" #include "zeek/supervisor/Supervisor.h" diff --git a/src/plugin/Manager.cc b/src/plugin/Manager.cc index ec0ef1530f..43eb1daee0 100644 --- a/src/plugin/Manager.cc +++ b/src/plugin/Manager.cc @@ -5,6 +5,7 @@ #include #if !defined(_MSC_VER) #include +#include #endif #include #include @@ -163,8 +164,7 @@ bool Manager::ActivateDynamicPluginInternal(const std::string& name, bool ok_if_ { #if defined(_MSC_VER) return false; -#endif - +#else errors->clear(); // caller should pass it in empty, but just to be sure dynamic_plugin_map::iterator m = dynamic_plugins.find(util::strtolower(name)); @@ -218,51 +218,30 @@ bool Manager::ActivateDynamicPluginInternal(const std::string& name, bool ok_if_ } // Load shared libraries. - string dydir = dir + "/lib"; - const char *dyext = "." HOST_ARCHITECTURE DYNAMIC_PLUGIN_SUFFIX; - DBG_LOG(DBG_PLUGINS, " Searching for shared libraries in %s with extension %s", dydir.c_str(), dyext); + string dypattern = dir + "/lib/*." + HOST_ARCHITECTURE + DYNAMIC_PLUGIN_SUFFIX; - DIR* d = opendir(dydir.c_str()); + DBG_LOG(DBG_PLUGINS, " Searching for shared libraries %s", dypattern.c_str()); - if ( ! d ) + glob_t gl; + + if ( glob(dypattern.c_str(), 0, 0, &gl) == 0 ) { - DBG_LOG(DBG_PLUGINS, "Cannot open directory %s", dydir.c_str()); - return true; - } - - struct dirent *dp; - - while ( (dp = readdir(d)) ) - { - if ( strlen(dp->d_name) >= strlen(dyext) - && zeek::util::streq(dp->d_name + strlen(dp->d_name) - strlen(dyext), dyext) ) + for ( size_t i = 0; i < gl.gl_pathc; i++ ) { - string path = dydir + "/" + dp->d_name; + const char* path = gl.gl_pathv[i]; - current_plugin = nullptr; - current_dir = dydir.c_str(); - current_sopath = path.c_str(); -#if defined(_MSC_VER) - void* hdl = LoadLibraryA(path.c_str()); -#else - void* hdl = dlopen(path.c_str(), RTLD_LAZY | RTLD_GLOBAL); -#endif - current_dir = nullptr; - current_sopath = nullptr; + current_plugin = nullptr; + current_dir = dir.c_str(); + current_sopath = path; + void* hdl = dlopen(path, RTLD_NOW | RTLD_GLOBAL); + current_dir = nullptr; + current_sopath = nullptr; if ( ! hdl ) { - const char* err = nullptr; -#if defined(_MSC_VER) - char buf[65535]; - const int flags = FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS; - if ( FormatMessageA(flags, nullptr, GetLastError(), 0, buf, sizeof(buf), nullptr ) ) - err = buf; -#else - err = dlerror(); -#endif - errors->push_back(util::fmt("cannot load plugin library %s: %s", path.c_str(), + const char* err = dlerror(); + errors->push_back(util::fmt("cannot load plugin library %s: %s", path, err ? err : "")); continue; } @@ -270,7 +249,7 @@ bool Manager::ActivateDynamicPluginInternal(const std::string& name, bool ok_if_ if ( ! current_plugin ) { errors->push_back( - util::fmt("load plugin library %s did not instantiate a plugin", path.c_str())); + util::fmt("load plugin library %s did not instantiate a plugin", path)); continue; } @@ -282,10 +261,10 @@ bool Manager::ActivateDynamicPluginInternal(const std::string& name, bool ok_if_ plugins_by_path.insert( std::make_pair(util::detail::normalize_path(dir), current_plugin)); - // We execute the pre-script initialization here; this in - // fact could be *during* script initialization if we got - // triggered via @load-plugin. - current_plugin->InitPreScript(); + // We execute the pre-script initialization here; this in + // fact could be *during* script initialization if we got + // triggered via @load-plugin. + current_plugin->InitPreScript(); // Make sure the name the plugin reports is consistent with // what we expect from its magic file. @@ -297,21 +276,20 @@ bool Manager::ActivateDynamicPluginInternal(const std::string& name, bool ok_if_ } current_plugin = nullptr; - DBG_LOG(DBG_PLUGINS, " Loaded %s", path.c_str()); + DBG_LOG(DBG_PLUGINS, " Loaded %s", path); } + globfree(&gl); + if ( ! errors->empty() ) return false; } - closedir(d); - - if ( current_plugin == nullptr ) + else { DBG_LOG(DBG_PLUGINS, " No shared library found"); } - // Add the "scripts" and "bif" directories to ZEEKPATH. std::string scripts = dir + "scripts"; @@ -353,6 +331,7 @@ bool Manager::ActivateDynamicPluginInternal(const std::string& name, bool ok_if_ m->second.clear(); return true; +#endif } void Manager::ActivateDynamicPlugin(const std::string& name) @@ -373,7 +352,10 @@ void Manager::ActivateDynamicPlugins(bool all) // Activate plugins that were specifically requested. for ( const auto& x : requested_plugins ) - plugins_to_activate.emplace(x, false); + { + if ( ! x.empty() ) + plugins_to_activate.emplace(x, false); + } // Activate plugins that our environment tells us to. vector p; diff --git a/src/supervisor/Supervisor.h b/src/supervisor/Supervisor.h index c0812dd7d4..d44afe51d5 100644 --- a/src/supervisor/Supervisor.h +++ b/src/supervisor/Supervisor.h @@ -153,7 +153,11 @@ public: // themselves trigger deprecation warnings for accessing the // "scripts" field. It can go when we remove that deprecation. NodeConfig() = default; +#ifndef _MSC_VER + // MSVC throws this error when specifing this constructor: + // error C2580: multiple versions of a defaulted special member functions are not allowed NodeConfig(NodeConfig&) = default; +#endif NodeConfig(const NodeConfig&) = default; NodeConfig(NodeConfig&&) = default; ~NodeConfig() = default; diff --git a/src/util.cc b/src/util.cc index d62b05e304..5929c59f28 100644 --- a/src/util.cc +++ b/src/util.cc @@ -43,7 +43,6 @@ #include #include #include -#include #include #include "zeek/3rdparty/ConvertUTF.h" @@ -259,16 +258,6 @@ const char* fmt_access_time(double t) time_t time = (time_t)t; struct tm ts; - if (!time) - { - // Use wall clock. - struct timeval tv = { 0 }; - if (gettimeofday(&tv, 0) < 0) - reporter->InternalError("unable to gettimeofday"); - else - time = tv.tv_sec; - } - if ( ! localtime_r(&time, &ts) ) { reporter->InternalError("unable to get time"); @@ -447,7 +436,6 @@ void init_random_seed(const char* read_file, const char* write_file, bool use_em pos += sizeof(struct timeval) / sizeof(uint32_t); // use urandom. For reasons see e.g. http://www.2uo.de/myths-about-urandom/ -#ifndef _MSC_VER #if defined(O_NONBLOCK) int fd = open("/dev/urandom", O_RDONLY | O_NONBLOCK); #elif defined(O_NDELAY) @@ -470,12 +458,6 @@ void init_random_seed(const char* read_file, const char* write_file, bool use_em errno = 0; } #endif - // C++ random device implementation in MSVC is sufficient for this purpose. - thread_local std::mt19937 gen(std::random_device{}()); - while ( pos < zeek::detail::KeyedHash::SEED_INIT_SIZE ) { - buf[pos++] = (uint32_t)gen(); - } -#endif if ( pos < zeek::detail::KeyedHash::SEED_INIT_SIZE ) reporter->FatalError("Could not read enough random data. Wanted %d, got %zu", @@ -1638,17 +1620,16 @@ const char* vfmt(const char* format, va_list al) va_copy(alc, al); int n = vsnprintf(buf, buf_len, format, al); - if ( (unsigned int)n >= buf_len ) + if ( n < 0 && buf_len < 1024 * 1024 ) { // Not enough room, grow the buffer. - buf_len = n + 32; + buf_len += 32; buf = (char*)safe_realloc(buf, buf_len); - - n = vsnprintf(buf, buf_len, format, alc); - - if ( (unsigned int)n >= buf_len ) - reporter->InternalError("confusion reformatting in fmt()"); + n = vsnprintf(buf, buf_len, format, al); } + if ( n < 0 ) + reporter->InternalError("confusion reformatting in fmt()"); + va_end(alc); return buf; } @@ -1792,7 +1773,7 @@ string zeek_prefixes() for ( const auto& prefix : zeek::detail::zeek_script_prefixes ) { if ( ! rval.empty() ) - rval.append(zeek_path_list_separator); + rval.append(path_list_separator); rval.append(prefix); } @@ -2006,7 +1987,7 @@ static string find_file_in_path(const string& filename, const string& path, string find_file(const string& filename, const string& path_set, const string& opt_ext) { vector paths; - tokenize_string(path_set, zeek_path_list_separator, &paths); + tokenize_string(path_set, path_list_separator, &paths); vector ext; if ( ! opt_ext.empty() ) @@ -2026,7 +2007,7 @@ string find_file(const string& filename, const string& path_set, const string& o string find_script_file(const string& filename, const string& path_set) { vector paths; - tokenize_string(path_set, zeek_path_list_separator, &paths); + tokenize_string(path_set, path_list_separator, &paths); vector ext = {".zeek"}; diff --git a/src/util.h b/src/util.h index c7fa0ceab5..25537f2d18 100644 --- a/src/util.h +++ b/src/util.h @@ -40,10 +40,6 @@ #endif #endif -#ifdef _MSC_VER -#include -#endif - #ifdef DEBUG #include diff --git a/src/zeek-setup.cc b/src/zeek-setup.cc index b718988b82..fbef570fca 100644 --- a/src/zeek-setup.cc +++ b/src/zeek-setup.cc @@ -52,7 +52,6 @@ #include "zeek/Traverse.h" #include "zeek/Trigger.h" #include "zeek/Var.h" - #include "zeek/analyzer/Manager.h" #include "zeek/binpac_zeek.h" #include "zeek/broker/Manager.h" @@ -67,7 +66,6 @@ #include "zeek/plugin/Manager.h" #include "zeek/script_opt/ScriptOpt.h" #include "zeek/session/Manager.h" -#include "zeek/script_opt/ScriptOpt.h" #include "zeek/supervisor/Supervisor.h" #include "zeek/telemetry/Manager.h" #include "zeek/threading/Manager.h" @@ -210,6 +208,7 @@ char version[] = VERSION; #else extern char version[]; #endif + const char* zeek::detail::command_line_policy = nullptr; vector zeek::detail::params; set requested_plugins; @@ -245,9 +244,6 @@ char** zeek::detail::zeek_argv; namespace zeek { -// Define zeek version explicitly for MSVC - - const char* zeek_version() { #ifdef DEBUG diff --git a/src/zeekygen/Target.cc b/src/zeekygen/Target.cc index eba9c81c83..5236b8b070 100644 --- a/src/zeekygen/Target.cc +++ b/src/zeekygen/Target.cc @@ -2,9 +2,7 @@ #include "zeek/zeekygen/Target.h" -#ifndef _MSC_VER #include -#endif #include #include #include @@ -492,8 +490,6 @@ vector dir_contents_recursive(string dir) scan_path[0] = dir_copy; scan_path[1] = NULL; - // Zeekygen isn't supported in Windows, due to missing FTS library. -#ifndef _MSC_VER FTS* fts = fts_open(scan_path, FTS_NOCHDIR, 0); if ( ! fts ) @@ -520,7 +516,6 @@ vector dir_contents_recursive(string dir) delete[] scan_path; delete[] dir_copy; -#endif return rval; }