relacy
relacy copied to clipboard
resolve std name conflict
Due to forward declarations and the structure of std includes I had compiler warning for redeclaring some atomic structures. Here is a possible solution using defines and an internal namespace in std.
What compiler are you using? And what warnings does it produce?
I had some std header included (vector, string) and on Visual Studio 2015 it was complaining about the memory_order: error C2874: using-declaration causes a multiple declaration of 'rl::memory_order'. The include hierarchy was something like: vector included xmemory which included xatomic.
On GCC (5, the current mainstream gcc compiler on ubuntu) it had a similar problem with the atomic. I have not checked that.
It was a fast search/replace and did not considered any other name conflict. I know it's not the best solution but had no better idea. The best would be to pretend that atomic, thread, mutex, etc. has already been included, but I doubt if it has a solution independent of the implementation of libstd.
Note, I had the define problem with delete too.
class Foo {
Foo(const Foo&) = delete;
}
It was a fast search/replace and did not considered any other name conflict.
So does mutex lead to the same problems or not?
Foo(const Foo&) = delete;
Just don't use this with Relacy. Define-based instrumentation sucks, it all needs to be redone to use compiler instrumentation. But I don't have time for that.
mutex was ok, did not have the problem. Unfortunatelly I forget to create a branch before push/PR. So I'll close the PR and create a new branch. Are u interested in the patch ? Shall I resend the PR from the new branch?
Unfortunatelly I forget to create a branch before push/PR. So I'll close the PR and create a new branch.
git push -f?
Are u interested in the patch ?
Yes. It fixes build for you, right? Without mutex/condvar changes it looks good to me.
Thanks