Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Compilation problems detected on macos, linux #9

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

MohamedLamineAllal
Copy link

@MohamedLamineAllal MohamedLamineAllal commented Dec 15, 2022

Fix issue: #4 and #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)

- headCmpEx() changed to not use the atomic copy operator that is set to deleted in macos  (Xcode 14). Fixing the following error:

```sh
./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

```sh
./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
```
@MohamedLamineAllal
Copy link
Author

@markcellis
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants