simdb icon indicating copy to clipboard operation
simdb copied to clipboard

fix: Compilation problems detected on macos, linux

Open MohamedLamineAllal opened this issue 2 years ago • 2 comments
trafficstars

Fix issue: https://github.com/LiveAsynchronousVisualizedArchitecture/simdb/issues/4 and https://github.com/LiveAsynchronousVisualizedArchitecture/simdb/issues/8

  • headCmpEx() changed to not use the atomic copy operator that is set to deleted in macos (Xcode 14). Fixing the following error:
./simdb.hpp:554:41: error: copying parameter of type 'std::atomic<u64>' (aka 'atomic<unsigned long long>') invokes deleted constructor
    }while( !headCmpEx( &curHead.asInt, nxtHead.asInt) );
  • changing decltype(f(vi)) to decltype(f(VerIdx())) in runMatch to fix the following error
./simdb.hpp:1349:99: error: use of undeclared identifier 'vi'
  bool      runMatch(const void *const key, u32 klen, u32 hash, FUNC f, T defaultRet = decltype(f(vi))() )       const

The example is tested and works perfectly. My platform (Macos m1, Xcode14)

MohamedLamineAllal avatar Dec 15 '22 09:12 MohamedLamineAllal

@LiveAsynchronousVisualizedArchitecture

MohamedLamineAllal avatar Dec 15 '22 09:12 MohamedLamineAllal

It would also be good if you could get this to also work with Visual C++ 20. I'll get errors unless I define:

/D _SILENCE_CXX17_CODECVT_HEADER_DEPRECATION_WARNING

markcellis avatar Feb 19 '23 11:02 markcellis