1. 修复windows无法编译的问题
This commit is contained in:
parent
2c646bcbcb
commit
d74bfa4b7a
@ -35,4 +35,5 @@ endif()
|
|||||||
target_include_directories(HDSDK PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
|
target_include_directories(HDSDK PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
|
||||||
target_link_libraries(HDSDK PRIVATE -static-libgcc -static-libstdc++)
|
target_link_libraries(HDSDK PRIVATE -static-libgcc -static-libstdc++)
|
||||||
set_target_properties(HDSDK PROPERTIES LINK_FLAGS "-nodefaultlibs")
|
set_target_properties(HDSDK PROPERTIES LINK_FLAGS "-nodefaultlibs")
|
||||||
|
set(CMAKE_EXE_LINKER_FLAGS "/NODEFAULTLIB")
|
||||||
add_definitions(-DUSE_HD_LIB)
|
add_definitions(-DUSE_HD_LIB)
|
||||||
|
|||||||
@ -10,6 +10,9 @@
|
|||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
||||||
|
|
||||||
|
#define VERSION "1.0.0.0"
|
||||||
|
|
||||||
|
|
||||||
#define MD5_LENGHT (32)
|
#define MD5_LENGHT (32)
|
||||||
#define XML_MAX (9200)
|
#define XML_MAX (9200)
|
||||||
#define LOCAL_TCP_VERSION (0x1000009)
|
#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()
|
IHDProtocol CreateProtocol()
|
||||||
{
|
{
|
||||||
return new hd::HDSDKPrivate();
|
return new hd::HDSDKPrivate();
|
||||||
|
|||||||
@ -119,6 +119,8 @@ typedef enum {
|
|||||||
} eHDFunc ;
|
} eHDFunc ;
|
||||||
|
|
||||||
|
|
||||||
|
HD_API const char * DLL_CALL Version();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief CreateProtocol Create protocol. default init.
|
* @brief CreateProtocol Create protocol. default init.
|
||||||
* @return IHDProtocol
|
* @return IHDProtocol
|
||||||
|
|||||||
11
SDK/HXml.h
11
SDK/HXml.h
@ -3,6 +3,7 @@
|
|||||||
#ifndef __HXML_H__
|
#ifndef __HXML_H__
|
||||||
#define __HXML_H__
|
#define __HXML_H__
|
||||||
|
|
||||||
|
|
||||||
#include <HDSDK.h>
|
#include <HDSDK.h>
|
||||||
#include <tinyxml2.h>
|
#include <tinyxml2.h>
|
||||||
#include <exception>
|
#include <exception>
|
||||||
@ -62,14 +63,14 @@ template<> struct priority_tag<0> {};
|
|||||||
|
|
||||||
struct to_xml_fn
|
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
|
auto operator()(BasicXmlType& j, T&& val) const
|
||||||
noexcept(noexcept(to_xml(j, std::forward<T>(val))))
|
noexcept(noexcept(to_xml(j, std::forward<T>(val))))
|
||||||
-> decltype(to_xml(j, std::forward<T>(val)), void())
|
-> decltype(to_xml(j, std::forward<T>(val)), void())
|
||||||
{
|
{
|
||||||
return call(j, std::forward<T>(val), priority_tag<1>{});
|
return call(j, std::forward<T>(val), priority_tag<1>{});
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
template<typename BasicXmlType, typename T>
|
template<typename BasicXmlType, typename T>
|
||||||
auto call(BasicXmlType& j, T&& val, priority_tag<1>) const
|
auto call(BasicXmlType& j, T&& val, priority_tag<1>) const
|
||||||
@ -131,6 +132,7 @@ private:
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef H_LINUX
|
||||||
namespace
|
namespace
|
||||||
{
|
{
|
||||||
|
|
||||||
@ -140,6 +142,7 @@ constexpr const auto& from_xml = detail::static_const<detail::from_xml_fn>::valu
|
|||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user