From d74bfa4b7a3fd2e61ece6d1d2a9c94882cee9a0a Mon Sep 17 00:00:00 2001 From: coffee Date: Sun, 6 Aug 2023 10:23:40 +0800 Subject: [PATCH] =?UTF-8?q?1.=20=E4=BF=AE=E5=A4=8Dwindows=E6=97=A0?= =?UTF-8?q?=E6=B3=95=E7=BC=96=E8=AF=91=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Protocol/CMakeLists.txt | 1 + Protocol/HDSDK.cpp | 10 ++++++++++ Protocol/HDSDK.h | 2 ++ SDK/HXml.h | 11 +++++++---- 4 files changed, 20 insertions(+), 4 deletions(-) diff --git a/Protocol/CMakeLists.txt b/Protocol/CMakeLists.txt index 4f019d4..c1a3024 100644 --- a/Protocol/CMakeLists.txt +++ b/Protocol/CMakeLists.txt @@ -35,4 +35,5 @@ endif() target_include_directories(HDSDK PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) target_link_libraries(HDSDK PRIVATE -static-libgcc -static-libstdc++) set_target_properties(HDSDK PROPERTIES LINK_FLAGS "-nodefaultlibs") +set(CMAKE_EXE_LINKER_FLAGS "/NODEFAULTLIB") add_definitions(-DUSE_HD_LIB) diff --git a/Protocol/HDSDK.cpp b/Protocol/HDSDK.cpp index 446d89b..224fbbb 100644 --- a/Protocol/HDSDK.cpp +++ b/Protocol/HDSDK.cpp @@ -10,6 +10,9 @@ #include +#define VERSION "1.0.0.0" + + #define MD5_LENGHT (32) #define XML_MAX (9200) #define LOCAL_TCP_VERSION (0x1000009) @@ -756,6 +759,13 @@ int HDSDKPrivate::SendFile(hint64 index, hint64 size, int status, char *buff, in } + +const char *Version() +{ + return VERSION; +} + + IHDProtocol CreateProtocol() { return new hd::HDSDKPrivate(); diff --git a/Protocol/HDSDK.h b/Protocol/HDSDK.h index d1d5f38..53b9179 100644 --- a/Protocol/HDSDK.h +++ b/Protocol/HDSDK.h @@ -119,6 +119,8 @@ typedef enum { } eHDFunc ; +HD_API const char * DLL_CALL Version(); + /** * @brief CreateProtocol Create protocol. default init. * @return IHDProtocol diff --git a/SDK/HXml.h b/SDK/HXml.h index 706e847..521be0a 100644 --- a/SDK/HXml.h +++ b/SDK/HXml.h @@ -3,6 +3,7 @@ #ifndef __HXML_H__ #define __HXML_H__ + #include #include #include @@ -62,14 +63,14 @@ template<> struct priority_tag<0> {}; struct to_xml_fn { - template + template(), std::declval()))>> auto operator()(BasicXmlType& j, T&& val) const - noexcept(noexcept(to_xml(j, std::forward(val)))) - -> decltype(to_xml(j, std::forward(val)), void()) + noexcept(noexcept(to_xml(j, std::forward(val)))) + -> decltype(to_xml(j, std::forward(val)), void()) { return call(j, std::forward(val), priority_tag<1>{}); } - private: template auto call(BasicXmlType& j, T&& val, priority_tag<1>) const @@ -131,6 +132,7 @@ private: } +#ifdef H_LINUX namespace { @@ -140,6 +142,7 @@ constexpr const auto& from_xml = detail::static_const::valu } +#endif