mirror of
https://github.com/kidfromjupiter/nearby.git
synced 2026-09-16 15:36:12 -04:00
Use push and pop to add back the CreateMutex Windows macro to avoid issues in Windows app code.
PiperOrigin-RevId: 530668276
This commit is contained in:
committed by
Copybara-Service
parent
ebab912fb6
commit
182ebad725
@@ -56,10 +56,6 @@
|
||||
#include "internal/platform/os_name.h"
|
||||
#include "internal/platform/payload_id.h"
|
||||
|
||||
#ifdef CreateMutex
|
||||
#undef CreateMutex
|
||||
#endif
|
||||
|
||||
namespace nearby {
|
||||
namespace api {
|
||||
|
||||
@@ -103,7 +99,12 @@ class ImplementationPlatform {
|
||||
|
||||
static std::unique_ptr<CountDownLatch> CreateCountDownLatch(
|
||||
std::int32_t count);
|
||||
|
||||
#pragma push_macro("CreateMutex")
|
||||
#undef CreateMutex
|
||||
static std::unique_ptr<Mutex> CreateMutex(Mutex::Mode mode);
|
||||
#pragma pop_macro("CreateMutex")
|
||||
|
||||
static std::unique_ptr<ConditionVariable> CreateConditionVariable(
|
||||
Mutex* mutex);
|
||||
|
||||
|
||||
@@ -66,10 +66,6 @@
|
||||
#include "internal/platform/implementation/windows/wifi_lan.h"
|
||||
#include "internal/platform/logging.h"
|
||||
|
||||
#ifdef CreateMutex
|
||||
#undef CreateMutex
|
||||
#endif
|
||||
|
||||
namespace nearby {
|
||||
namespace api {
|
||||
|
||||
@@ -183,9 +179,12 @@ std::unique_ptr<CountDownLatch> ImplementationPlatform::CreateCountDownLatch(
|
||||
return absl::make_unique<shared::CountDownLatch>(count);
|
||||
}
|
||||
|
||||
#pragma push_macro("CreateMutex")
|
||||
#undef CreateMutex
|
||||
std::unique_ptr<Mutex> ImplementationPlatform::CreateMutex(Mutex::Mode mode) {
|
||||
return absl::make_unique<windows::Mutex>(mode);
|
||||
}
|
||||
#pragma pop_macro("CreateMutex")
|
||||
|
||||
std::unique_ptr<ConditionVariable>
|
||||
ImplementationPlatform::CreateConditionVariable(Mutex* mutex) {
|
||||
|
||||
Reference in New Issue
Block a user