-
Notifications
You must be signed in to change notification settings - Fork 32
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
resolve std name conflict #2
base: master
Are you sure you want to change the base?
Conversation
using rl::mo_release; | ||
using rl::mo_acq_rel; | ||
using rl::mo_seq_cst; | ||
namespace rlimp { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
{ on new line please
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: On GCC (5, the current mainstream gcc compiler on ubuntu) it had a similar problem with the atomic. |
//# define atomic_intmax_t rlimp::atomic_intmax_t | ||
//# define atomic_uintmax_t mutex rlimp::atomic_uintmax_t | ||
|
||
# define mutex rlimp::mutex |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does mutex lead to the same problems?
It's pretty common name, so redefining it is unfortunate...
It was a fast search/replace and did not considered any other name conflict. Note, I had the define problem with delete too.
|
So does mutex lead to the same problems or not?
Just don't use this with Relacy. |
mutex was ok, did not have the problem. |
git push -f?
Yes. It fixes build for you, right? Thanks |
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.