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