diff --git a/external/CMakeLists.txt b/external/CMakeLists.txt index 065e51ad5..8b20bb202 100644 --- a/external/CMakeLists.txt +++ b/external/CMakeLists.txt @@ -84,11 +84,3 @@ set(ENABLE_BORINGSSL OFF CACHE BOOL "Disable boringssl for ngtcp2") add_definitions(-D_GNU_SOURCE) add_subdirectory(ngtcp2 EXCLUDE_FROM_ALL) - -set(CPR_BUILD_TESTS OFF) -if(WIN32) - set(CPR_FORCE_WINSSL_BACKEND ON) -else() - set(CPR_FORCE_USE_SYSETM_CURL ON) -endif() -add_subdirectory(cpr EXCLUDE_FROM_ALL) diff --git a/include/lokinet/lokinet_os.h b/include/lokinet/lokinet_os.h deleted file mode 100644 index 59ce14df0..000000000 --- a/include/lokinet/lokinet_os.h +++ /dev/null @@ -1,26 +0,0 @@ -#pragma once - -/// OS specific types - -#ifdef _WIN32 - -#else -#include -#include - -#endif - -#ifdef __cplusplus -extern "C" -{ -#endif - -#ifdef _WIN32 - typedef HANDLE OS_FD_t; -#else -typedef int OS_FD_t; -#endif - -#ifdef __cplusplus -} -#endif diff --git a/include/lokinet/lokinet_udp.h b/include/lokinet/lokinet_udp.h index b6a1ca955..3ca68f31c 100644 --- a/include/lokinet/lokinet_udp.h +++ b/include/lokinet/lokinet_udp.h @@ -1,7 +1,19 @@ #pragma once #include "lokinet_context.h" -#include "lokinet_os.h" + +#ifdef _WIN32 +extern "C" +{ + struct iovec + { + void* iov_base; + size_t iov_len; + }; +} +#else +#include +#endif #ifdef __cplusplus extern "C" diff --git a/llarp/CMakeLists.txt b/llarp/CMakeLists.txt index de55720f5..279b621a4 100644 --- a/llarp/CMakeLists.txt +++ b/llarp/CMakeLists.txt @@ -247,12 +247,13 @@ target_link_libraries(liblokinet PRIVATE libunbound) if(BUILD_LIBLOKINET) include(GNUInstallDirs) add_library(lokinet-shared SHARED lokinet_shared.cpp) - set_target_properties(lokinet-shared PROPERTIES OUTPUT_NAME lokinet) target_link_libraries(lokinet-shared PUBLIC liblokinet) install(TARGETS lokinet-shared LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) if(WIN32) + set(CMAKE_SHARED_LIBRARY_PREFIX_CXX "") target_link_libraries(lokinet-shared PUBLIC ws2_32 iphlpapi -fstack-protector) endif() + set_target_properties(lokinet-shared PROPERTIES OUTPUT_NAME lokinet) add_log_tag(lokinet-shared) endif() diff --git a/llarp/lokinet_shared.cpp b/llarp/lokinet_shared.cpp index 835133e41..fbe27f089 100644 --- a/llarp/lokinet_shared.cpp +++ b/llarp/lokinet_shared.cpp @@ -12,6 +12,10 @@ #include +#ifdef _WIN32 +#define EHOSTDOWN ENETDOWN +#endif + namespace { struct Context : public llarp::Context