1. 修复windows无法编译的问题

This commit is contained in:
coffee 2023-08-06 10:23:40 +08:00
parent 2c646bcbcb
commit d74bfa4b7a
4 changed files with 20 additions and 4 deletions

View File

@ -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)

View File

@ -10,6 +10,9 @@
#include <memory>
#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();

View File

@ -119,6 +119,8 @@ typedef enum {
} eHDFunc ;
HD_API const char * DLL_CALL Version();
/**
* @brief CreateProtocol Create protocol. default init.
* @return IHDProtocol

View File

@ -3,6 +3,7 @@
#ifndef __HXML_H__
#define __HXML_H__
#include <HDSDK.h>
#include <tinyxml2.h>
#include <exception>
@ -62,14 +63,14 @@ template<> struct priority_tag<0> {};
struct to_xml_fn
{
template<typename BasicXmlType, typename T>
template<typename BasicXmlType, typename T,
typename = std::void_t<decltype(to_xml(std::declval<BasicXmlType&>(), std::declval<T>()))>>
auto operator()(BasicXmlType& j, T&& val) const
noexcept(noexcept(to_xml(j, std::forward<T>(val))))
-> decltype(to_xml(j, std::forward<T>(val)), void())
{
return call(j, std::forward<T>(val), priority_tag<1>{});
}
private:
template<typename BasicXmlType, typename T>
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<detail::from_xml_fn>::valu
}
#endif