| Server IP : 82.208.35.60 / Your IP : 216.73.216.238 Web Server : Apache/2.4.55 (FreeBSD) OpenSSL/1.1.1q-freebsd PHP/7.3.31 System : FreeBSD server7.d2m.cz 12.4-RELEASE-p9 FreeBSD 12.4-RELEASE-p9 GENERIC amd64 User : studiokobylisy_cz ( 1008) PHP Version : 7.3.31 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /usr/ports/graphics/epsonscan2/files/ |
Upload File : |
--- src/CommonUtility/utils/ESAnyCastUtils.h.orig 2021-11-25 00:56:55 UTC
+++ src/CommonUtility/utils/ESAnyCastUtils.h
@@ -141,7 +141,11 @@ const T* SafeAnyDataCPtr( const ESAny& anyIn )
template< typename T >
T* SafeAnyDataPtr_WithLog( ESAny& anyIn, ES_CHAR_CPTR lpszFile = __ES_FILE__, const int nLine = __LINE__ )
{
- if( anyIn.empty() || (anyIn.type() != typeid(T)) ){
+ // XXX changed to a string comparison of the type name here because, on FreeBSD, the hash_code()s for anyIn.type() and typeid(T) are differing for T = ESDictionary
+ // even though the names of the types are the same!
+ // It should work as it was. It is not efficient now. Why are the type hash_code()s different on FreeBSD??
+ // was: if( anyIn.empty() || (anyIn.type() != typeid(T)) ){
+ if( anyIn.empty() || ES_CMN_FUNCS::STRING::ToESString(anyIn.type().name()).compare(ES_CMN_FUNCS::STRING::ToESString(typeid(T).name())) != 0 ){
if(anyIn.empty()){
ES_Warning_Log3( __ES_FUNCTION__, lpszFile, nLine, ES_STRING("Boost Any Cast Warning Empty!!"));
} else {
@@ -167,7 +171,11 @@ T* SafeAnyDataPtr_WithLog( ESAny& anyIn, ES_CHAR_CPTR
template< typename T >
const T* SafeAnyDataCPtr_WithLog( const ESAny& anyIn, ES_CHAR_CPTR lpszFile = __ES_FILE__, const int nLine = __LINE__ )
{
- if( anyIn.empty() || (anyIn.type() != typeid(T)) ){
+ // XXX changed to a string comparison of the type name here because, on FreeBSD, the hash_code()s for anyIn.type() and typeid(T) are differing for T = ESDictionary
+ // even though the names of the types are the same!
+ // It should work as it was. It is not efficient now. Why are the type hash_code()s different on FreeBSD??
+ // was: if( anyIn.empty() || (anyIn.type() != typeid(T)) ){
+ if( anyIn.empty() || ES_CMN_FUNCS::STRING::ToESString(anyIn.type().name()).compare(ES_CMN_FUNCS::STRING::ToESString(typeid(T).name())) != 0 ){
if(anyIn.empty()){
ES_Warning_Log3( __ES_FUNCTION__, lpszFile, nLine, ES_STRING("Boost Any Cast Warning Empty!!"));
} else {