-
Notifications
You must be signed in to change notification settings - Fork 34
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
Open
ghost
wants to merge
4
commits into
dvyukov:master
Choose a base branch
from
unknown repository
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,64 +19,78 @@ | |
|
||
namespace std | ||
{ | ||
using rl::memory_order; | ||
using rl::mo_relaxed; | ||
using rl::mo_consume; | ||
using rl::mo_acquire; | ||
using rl::mo_release; | ||
using rl::mo_acq_rel; | ||
using rl::mo_seq_cst; | ||
namespace rlimp | ||
{ | ||
using namespace rl; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this codebase uses 4 spaces for indentation FWIW |
||
} | ||
|
||
using rl::atomic; | ||
using rl::atomic_thread_fence; | ||
using rl::atomic_signal_fence; | ||
# define memory_order rlimp::memory_order | ||
# define mo_relaxed rlimp::mo_relaxed | ||
# define mo_consume rlimp::mo_consume | ||
# define mo_acquire rlimp::mo_acquire | ||
# define mo_release rlimp::mo_release | ||
# define mo_acq_rel rlimp::mo_acq_rel | ||
# define mo_seq_cst rlimp::mo_seq_cst | ||
|
||
using rl::atomic_bool; | ||
using rl::atomic_address; | ||
# define atomic rlimp::atomic | ||
# define atomic_thread_fence rlimp::atomic_thread_fence | ||
# define atomic_signal_fence rlimp::atomic_signal_fence | ||
|
||
using rl::atomic_char; | ||
using rl::atomic_schar; | ||
using rl::atomic_uchar; | ||
using rl::atomic_short; | ||
using rl::atomic_ushort; | ||
using rl::atomic_int; | ||
using rl::atomic_uint; | ||
using rl::atomic_long; | ||
using rl::atomic_ulong; | ||
using rl::atomic_llong; | ||
using rl::atomic_ullong; | ||
// using rl::atomic_char16_t; | ||
// using rl::atomic_char32_t; | ||
using rl::atomic_wchar_t; | ||
# define atomic_bool rlimp::atomic_bool | ||
# define atomic_address rlimp::atomic_address | ||
|
||
// using rl::atomic_int_least8_t; | ||
// using rl::atomic_uint_least8_t; | ||
// using rl::atomic_int_least16_t; | ||
// using rl::atomic_uint_least16_t; | ||
// using rl::atomic_int_least32_t; | ||
// using rl::atomic_uint_least32_t; | ||
// using rl::atomic_int_least64_t; | ||
// using rl::atomic_uint_least64_t; | ||
// using rl::atomic_int_fast8_t; | ||
// using rl::atomic_uint_fast8_t; | ||
// using rl::atomic_int_fast16_t; | ||
// using rl::atomic_uint_fast16_t; | ||
// using rl::atomic_int_fast32_t; | ||
// using rl::atomic_uint_fast32_t; | ||
// using rl::atomic_int_fast64_t; | ||
// using rl::atomic_uint_fast64_t; | ||
using rl::atomic_intptr_t; | ||
using rl::atomic_uintptr_t; | ||
using rl::atomic_size_t; | ||
// using rl::atomic_ssize_t; | ||
using rl::atomic_ptrdiff_t; | ||
// using rl::atomic_intmax_t; | ||
// using rl::atomic_uintmax_t; | ||
# define atomic_char rlimp::atomic_char | ||
# define atomic_schar rlimp::atomic_schar | ||
# define atomic_uchar rlimp::atomic_uchar | ||
# define atomic_short rlimp::atomic_short | ||
# define atomic_ushort rlimp::atomic_ushort | ||
# define atomic_int rlimp::atomic_int | ||
# define atomic_uint rlimp::atomic_uint | ||
# define atomic_long rlimp::atomic_long | ||
# define atomic_ulong rlimp::atomic_ulong | ||
# define atomic_llong rlimp::atomic_llong | ||
# define atomic_ullong rlimp::atomic_ullong | ||
//# define atomic_char16_t rlimp::atomic_char16_t | ||
//# define atomic_char32_t rlimp::atomic_char32_t | ||
# define atomic_wchar_t rlimp::atomic_wchar_t | ||
|
||
using rl::mutex; | ||
using rl::recursive_mutex; | ||
using rl::condition_variable; | ||
using rl::condition_variable_any; | ||
//# define atomic_int_least8_t rlimp::atomic_int_least8_t | ||
//# define atomic_uint_least8_t rlimp::atomic_uint_least8_t | ||
//# define atomic_int_least16_t rlimp::atomic_int_least16_t | ||
//# define atomic_uint_least16_t rlimp::atomic_uint_least16_t | ||
//# define atomic_int_least32_t rlimp::atomic_int_least32_t | ||
//# define atomic_uint_least32_t rlimp::atomic_uint_least32_t | ||
//# define atomic_int_least64_t rlimp::atomic_int_least64_t | ||
//# define atomic_uint_least64_t rlimp::atomic_uint_least64_t | ||
//# define atomic_int_fast8_t rlimp::atomic_int_fast8_t | ||
//# define atomic_uint_fast8_t rlimp::atomic_uint_fast8_t | ||
//# define atomic_int_fast16_t rlimp::atomic_int_fast16_t | ||
//# define atomic_uint_fast16_t rlimp::atomic_uint_fast16_t | ||
//# define atomic_int_fast32_t rlimp::atomic_int_fast32_t | ||
//# define atomic_uint_fast32_t rlimp::atomic_uint_fast32_t | ||
//# define atomic_int_fast64_t rlimp::atomic_int_fast64_t | ||
//# define atomic_uint_fast64_t rlimp::atomic_uint_fast64_t | ||
# define atomic_intptr_t rlimp::atomic_intptr_t | ||
# define atomic_uintptr_t rlimp::atomic_uintptr_t | ||
# define atomic_size_t rlimp::atomic_size_t | ||
//# define atomic_ssize_t rlimp::atomic_ssize_t | ||
# define atomic_ptrdiff_t rlimp::atomic_ptrdiff_t | ||
//# 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 commentThe reason will be displayed to describe this comment to others. Learn more. Does mutex lead to the same problems? |
||
# define recursive_mutex rlimp::recursive_mutex | ||
# define condition_variable rlimp::condition_variable | ||
# define condition_variable_any rlimp::condition_variable_any | ||
} | ||
|
||
|
||
namespace rl | ||
{ | ||
namespace rlimp | ||
{ | ||
using namespace rl; | ||
} | ||
} | ||
|
||
#endif |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
examples/peterson/perterson.cpp does not build with this patch, because it uses rl::memory_order_relaxed which gets redefined into rl::rlimpl::memory_order_relaxed, add:
here to fix it.