# HG changeset patch # User Sebastien Jodogne # Date 1531134176 -7200 # Node ID 73bc0c32547cc2056abe6f8a57c024a7c5e8f8d6 # Parent 28dc5bb9a7e62997e8cbf8ac3a79d5ef4279b7a9 fix embedding openssl within a DLL diff -r 28dc5bb9a7e6 -r 73bc0c32547c Core/DicomNetworking/DicomUserConnection.cpp --- a/Core/DicomNetworking/DicomUserConnection.cpp Mon Jul 09 12:20:28 2018 +0200 +++ b/Core/DicomNetworking/DicomUserConnection.cpp Mon Jul 09 13:02:56 2018 +0200 @@ -847,7 +847,7 @@ { SetRemoteApplicationEntityTitle(parameters.GetApplicationEntityTitle()); SetRemoteHost(parameters.GetHost()); - SetRemotePort(parameters.GetPort()); + SetRemotePort(parameters.GetPortNumber()); SetRemoteManufacturer(parameters.GetManufacturer()); } @@ -1252,7 +1252,7 @@ return (localAet_ == localAet && remoteAet_ == remote.GetApplicationEntityTitle() && remoteHost_ == remote.GetHost() && - remotePort_ == remote.GetPort() && + remotePort_ == remote.GetPortNumber() && manufacturer_ == remote.GetManufacturer()); } } diff -r 28dc5bb9a7e6 -r 73bc0c32547c Core/DicomNetworking/RemoteModalityParameters.cpp --- a/Core/DicomNetworking/RemoteModalityParameters.cpp Mon Jul 09 12:20:28 2018 +0200 +++ b/Core/DicomNetworking/RemoteModalityParameters.cpp Mon Jul 09 13:02:56 2018 +0200 @@ -58,7 +58,7 @@ { SetApplicationEntityTitle(aet); SetHost(host); - SetPort(port); + SetPortNumber(port); SetManufacturer(manufacturer); } @@ -84,13 +84,13 @@ throw OrthancException(ErrorCode_ParameterOutOfRange); } - SetPort(static_cast(tmp)); + SetPortNumber(static_cast(tmp)); } catch (std::runtime_error /* error inside JsonCpp */) { try { - SetPort(boost::lexical_cast(portValue.asString())); + SetPortNumber(boost::lexical_cast(portValue.asString())); } catch (boost::bad_lexical_cast) { @@ -118,16 +118,16 @@ } } + void RemoteModalityParameters::ToJson(Json::Value& value) const { value = Json::arrayValue; value.append(GetApplicationEntityTitle()); value.append(GetHost()); - value.append(GetPort()); + value.append(GetPortNumber()); value.append(EnumerationToString(GetManufacturer())); } - void RemoteModalityParameters::Serialize(Json::Value& target) const { diff -r 28dc5bb9a7e6 -r 73bc0c32547c Core/DicomNetworking/RemoteModalityParameters.h --- a/Core/DicomNetworking/RemoteModalityParameters.h Mon Jul 09 12:20:28 2018 +0200 +++ b/Core/DicomNetworking/RemoteModalityParameters.h Mon Jul 09 13:02:56 2018 +0200 @@ -79,12 +79,12 @@ host_ = host; } - uint16_t GetPort() const + uint16_t GetPortNumber() const { return port_; } - void SetPort(uint16_t port) + void SetPortNumber(uint16_t port) { port_ = port; } diff -r 28dc5bb9a7e6 -r 73bc0c32547c Resources/CMake/OpenSslConfiguration.cmake --- a/Resources/CMake/OpenSslConfiguration.cmake Mon Jul 09 12:20:28 2018 +0200 +++ b/Resources/CMake/OpenSslConfiguration.cmake Mon Jul 09 13:02:56 2018 +0200 @@ -95,8 +95,30 @@ ${OPENSSL_SOURCES_DIR}/ssl/ssl3.h ${OPENSSL_SOURCES_DIR}/ssl/tls1.h ) - file(COPY ${header} DESTINATION ${OPENSSL_SOURCES_DIR}/include/openssl) + file(COPY ${header} DESTINATION ${OPENSSL_SOURCES_DIR}/include/openssl) endforeach() + + file(RENAME + ${OPENSSL_SOURCES_DIR}/include/openssl/e_os2.h + ${OPENSSL_SOURCES_DIR}/include/openssl/e_os2_source.h) + + # The following patch of "e_os2.h" prevents from building OpenSSL + # as a DLL under Windows. Otherwise, symbols have inconsistent + # linkage if ${OPENSSL_SOURCES} is used to create a DLL (notably + # if building an Orthanc plugin such as MySQL). + file(WRITE ${OPENSSL_SOURCES_DIR}/include/openssl/e_os2.h " +#include \"e_os2_source.h\" +#if defined(_WIN32) +# undef OPENSSL_EXPORT +# undef OPENSSL_IMPORT +# undef OPENSSL_EXTERN +# undef OPENSSL_GLOBAL +# define OPENSSL_EXPORT +# define OPENSSL_IMPORT +# define OPENSSL_EXTERN extern +# define OPENSSL_GLOBAL +#endif +") endif() add_definitions( diff -r 28dc5bb9a7e6 -r 73bc0c32547c UnitTestsSources/MultiThreadingTests.cpp --- a/UnitTestsSources/MultiThreadingTests.cpp Mon Jul 09 12:20:28 2018 +0200 +++ b/UnitTestsSources/MultiThreadingTests.cpp Mon Jul 09 13:02:56 2018 +0200 @@ -1304,7 +1304,7 @@ RemoteModalityParameters modality; modality.SetApplicationEntityTitle("REMOTE"); modality.SetHost("192.168.1.1"); - modality.SetPort(1000); + modality.SetPortNumber(1000); modality.SetManufacturer(ModalityManufacturer_StoreScp); StoreScuOperation operation("TEST", modality); @@ -1319,7 +1319,7 @@ const StoreScuOperation& tmp = dynamic_cast(*operation); ASSERT_EQ("REMOTE", tmp.GetRemoteModality().GetApplicationEntityTitle()); ASSERT_EQ("192.168.1.1", tmp.GetRemoteModality().GetHost()); - ASSERT_EQ(1000, tmp.GetRemoteModality().GetPort()); + ASSERT_EQ(1000, tmp.GetRemoteModality().GetPortNumber()); ASSERT_EQ(ModalityManufacturer_StoreScp, tmp.GetRemoteModality().GetManufacturer()); ASSERT_EQ("TEST", tmp.GetLocalAet()); } @@ -1390,7 +1390,7 @@ RemoteModalityParameters modality; modality.SetApplicationEntityTitle("REMOTE"); modality.SetHost("192.168.1.1"); - modality.SetPort(1000); + modality.SetPortNumber(1000); modality.SetManufacturer(ModalityManufacturer_StoreScp); DicomModalityStoreJob job(GetContext()); @@ -1410,7 +1410,7 @@ ASSERT_EQ("LOCAL", tmp.GetLocalAet()); ASSERT_EQ("REMOTE", tmp.GetRemoteModality().GetApplicationEntityTitle()); ASSERT_EQ("192.168.1.1", tmp.GetRemoteModality().GetHost()); - ASSERT_EQ(1000, tmp.GetRemoteModality().GetPort()); + ASSERT_EQ(1000, tmp.GetRemoteModality().GetPortNumber()); ASSERT_EQ(ModalityManufacturer_StoreScp, tmp.GetRemoteModality().GetManufacturer()); ASSERT_TRUE(tmp.HasMoveOriginator()); ASSERT_EQ("MOVESCU", tmp.GetMoveOriginatorAet());