mirror of
https://github.com/wesnoth/wesnoth
synced 2025-04-29 01:05:08 +00:00
Workaround for MSVC2013's buggy atomic
This commit is contained in:
parent
fe818f8005
commit
bfc6744b03
@ -115,7 +115,12 @@ void tloadscreen::progress(const char* stage)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if(stage) {
|
if(stage) {
|
||||||
current_load->current_stage_.store(stage, std::memory_order_release);
|
current_load->current_stage_
|
||||||
|
#if defined(_MSC_VER) && _MSC_VER < 1900
|
||||||
|
= stage;
|
||||||
|
#else
|
||||||
|
.store(stage, std::memory_order_release);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -126,7 +131,12 @@ void tloadscreen::timer_callback(twindow& window)
|
|||||||
if (!worker_ || worker_->timed_join(boost::posix_time::milliseconds(0))) {
|
if (!worker_ || worker_->timed_join(boost::posix_time::milliseconds(0))) {
|
||||||
window.close();
|
window.close();
|
||||||
}
|
}
|
||||||
const char* stage = current_stage_.load(std::memory_order_acquire);
|
const char* stage = current_stage_
|
||||||
|
#if defined(_MSC_VER) && _MSC_VER < 1900
|
||||||
|
;
|
||||||
|
#else
|
||||||
|
.load(std::memory_order_acquire);
|
||||||
|
#endif
|
||||||
if (stage && (current_visible_stage_ == stages.end() || stage != current_visible_stage_->first))
|
if (stage && (current_visible_stage_ == stages.end() || stage != current_visible_stage_->first))
|
||||||
{
|
{
|
||||||
auto iter = stages.find(stage);
|
auto iter = stages.find(stage);
|
||||||
|
@ -51,7 +51,7 @@ public:
|
|||||||
/**
|
/**
|
||||||
* Hides the window.
|
* Hides the window.
|
||||||
*
|
*
|
||||||
* The hiding also destroys the window. It is save to call the function
|
* The hiding also destroys the window. It is safe to call the function
|
||||||
* when the window is not shown.
|
* when the window is not shown.
|
||||||
*/
|
*/
|
||||||
void close();
|
void close();
|
||||||
@ -79,7 +79,12 @@ private:
|
|||||||
tlabel* animation_label_;
|
tlabel* animation_label_;
|
||||||
static tloadscreen* current_load;
|
static tloadscreen* current_load;
|
||||||
|
|
||||||
|
#if defined(_MSC_VER) && _MSC_VER < 1900
|
||||||
|
// std::atomic is buggy in MSVC 2013 - doesn't work for cv types
|
||||||
|
const char* current_stage_;
|
||||||
|
#else
|
||||||
std::atomic<const char*> current_stage_;
|
std::atomic<const char*> current_stage_;
|
||||||
|
#endif
|
||||||
std::map<std::string,std::string>::const_iterator current_visible_stage_;
|
std::map<std::string,std::string>::const_iterator current_visible_stage_;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user