diff --git a/navicat-patcher/ResourceGuardCapstone.hpp b/navicat-patcher/ResourceGuardCapstone.hpp index a46f006..e7c4538 100644 --- a/navicat-patcher/ResourceGuardCapstone.hpp +++ b/navicat-patcher/ResourceGuardCapstone.hpp @@ -1,6 +1,7 @@ #pragma once #include "ResourceGuard.hpp" -#include + +#if defined(CAPSTONE_ENGINE_H) struct CapstoneHandleTraits { using HandleType = csh; @@ -10,3 +11,5 @@ struct CapstoneHandleTraits { } }; +#endif + diff --git a/navicat-patcher/ResourceGuardOpenssl.hpp b/navicat-patcher/ResourceGuardOpenssl.hpp index 9f5f067..4e64545 100644 --- a/navicat-patcher/ResourceGuardOpenssl.hpp +++ b/navicat-patcher/ResourceGuardOpenssl.hpp @@ -1,8 +1,7 @@ #pragma once #include "ResourceGuard.hpp" -#include -#include -#include + +#if defined(HEADER_BIO_H) struct OpensslBIOTraits { using HandleType = BIO*; @@ -10,21 +9,32 @@ struct OpensslBIOTraits { static constexpr auto& Releasor = BIO_free; }; + struct OpensslBIOChainTraits { using HandleType = BIO*; static inline const HandleType InvalidValue = nullptr; static constexpr auto& Releasor = BIO_free_all; }; +#endif + +#if defined(HEADER_BN_H) + struct OpensslBNTraits { using HandleType = BIGNUM*; static inline const HandleType InvalidValue = nullptr; static constexpr auto& Releasor = BN_free; }; +#endif + +#if defined(HEADER_RSA_H) + struct OpensslRSATraits { using HandleType = RSA*; static inline const HandleType InvalidValue = nullptr; static constexpr auto& Releasor = RSA_free; }; +#endif + diff --git a/navicat-patcher/ResourceGuardWin32.hpp b/navicat-patcher/ResourceGuardWin32.hpp index a527545..2987092 100644 --- a/navicat-patcher/ResourceGuardWin32.hpp +++ b/navicat-patcher/ResourceGuardWin32.hpp @@ -1,6 +1,7 @@ #pragma once #include "ResourceGuard.hpp" -#include + +#if defined(_WINDOWS_) struct GenericHandleTraits { using HandleType = HANDLE; @@ -20,3 +21,5 @@ struct MapViewTraits { static constexpr auto& Releasor = UnmapViewOfFile; }; +#endif +