Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix build on windows platfrom, use vs2019! #360

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ ADD_CUSTOM_COMMAND(
)


add_library(opcuaprotocol
add_library(opcuaprotocol STATIC
src/protocol/rawsize_auto.cpp
src/protocol/serialize_auto.cpp
src/protocol/deserialize_auto.cpp
Expand Down Expand Up @@ -273,7 +273,7 @@ SET(opcuacore_SOURCES
src/core/server_operations.cpp
)

add_library(opcuacore ${opcuacore_SOURCES})
add_library(opcuacore STATIC ${opcuacore_SOURCES})

if (NOT CMAKE_VERSION VERSION_LESS 2.8.12)
target_compile_options(opcuacore PUBLIC ${STATIC_LIBRARY_CXX_FLAGS})
Expand Down Expand Up @@ -329,7 +329,7 @@ endif(BUILD_TESTING)
############################################################################
if (BUILD_CLIENT)

add_library(opcuaclient
add_library(opcuaclient STATIC
src/client/binary_connection.cpp
src/client/binary_client.cpp
src/client/binary_client_addon.cpp
Expand Down Expand Up @@ -400,7 +400,7 @@ if(BUILD_SERVER)
#)
#ENDFOREACH(PART)

add_library(opcuaserver
add_library(opcuaserver STATIC
src/server/address_space_addon.cpp
src/server/address_space_internal.cpp
src/server/asio_addon.cpp
Expand Down
2 changes: 1 addition & 1 deletion include/opc/ua/protocol/utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ inline std::string ToHexDump(const char * buf, std::size_t size)
template <typename T> inline std::ostream & ToHexDump(std::ostream & os, const std::vector<T> & buf, std::size_t size)
{
std::stringstream lineEnd;
size = std::min(size, buf.size());
size = (std::min)(size, buf.size());
unsigned pos = 0;
os << "size: " << size << "(0x" << std::hex << size << ")";

Expand Down
4 changes: 2 additions & 2 deletions src/core/common/uri_facade_win.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
namespace Common
{

void Uri::Initialize(const char * uriString, std::size_t size)
void Uri::Initialize(const std::string& uriString)
{
URL_COMPONENTS url = {0};
url.dwStructSize = sizeof(url);
Expand All @@ -31,7 +31,7 @@ void Uri::Initialize(const char * uriString, std::size_t size)

// TODO msdn says do not use this function in services and in server patforms. :(
// TODO http://msdn.microsoft.com/en-us/library/windows/desktop/aa384376(v=vs.85).aspx
if (!InternetCrackUrl(uriString, size, options, &url))
if (!InternetCrackUrl(uriString.c_str(), uriString.size(), options, &url))
{
THROW_ERROR1(CannotParseUri, uriString);
}
Expand Down
1 change: 1 addition & 0 deletions src/core/socket_channel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@

#ifdef _WIN32
#include <WinSock2.h>
int close(SOCKET s) { return closesocket(s); }
#else
#include <arpa/inet.h>
#include <netinet/tcp.h>
Expand Down
1 change: 1 addition & 0 deletions src/server/tcp_server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@


#ifdef _WIN32
#define SHUT_RDWR 2
#else
#include <arpa/inet.h>
#include <netdb.h>
Expand Down