mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 06:38:20 +00:00
binpac: Additional Windows fixes. Fixed wrong MSVC macro definition and std::filesystem invocation. Linking to libunistd library
This commit is contained in:
parent
60265b8ce7
commit
9a4e01e634
2 changed files with 4 additions and 4 deletions
|
@ -106,7 +106,7 @@ set(binpac_SRCS
|
|||
add_executable(binpac ${binpac_SRCS})
|
||||
|
||||
if ( MSVC )
|
||||
target_link_libraries(binpac PRIVATE zeek_windows)
|
||||
target_link_libraries(binpac PRIVATE libunistd)
|
||||
endif()
|
||||
|
||||
install(TARGETS binpac DESTINATION bin)
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
#include <errno.h>
|
||||
#include <string_view>
|
||||
|
||||
#ifdef MSVC
|
||||
#ifdef _MSC_VER
|
||||
#include <filesystem>
|
||||
#else
|
||||
#include <libgen.h>
|
||||
|
@ -52,8 +52,8 @@ void include_file(const char *filename);
|
|||
|
||||
std::string do_dirname(std::string_view s)
|
||||
{
|
||||
#ifdef MSVC
|
||||
return std::filesystem::path(path).parent_path().string();
|
||||
#ifdef _MSC_VER
|
||||
return std::filesystem::path(s).parent_path().string();
|
||||
#else
|
||||
std::unique_ptr<char[]> tmp{new char[s.size()+1]};
|
||||
strncpy(tmp.get(), s.data(), s.size());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue