Skip to content

Commit

Permalink
Avoid using both Win32Waiter and PthreadWaiter on MinGW,
Browse files Browse the repository at this point in the history
and use StdcppWaiter instead.

There are various flavors of MinGW, some of which support pthread,
and some of which support Win32. Instead of figuring out which
platform is being used, just use the generic implementation.

PiperOrigin-RevId: 580565507
Change-Id: Ia85fd7496f1e6ebdeadb95202f0039e844826118
  • Loading branch information
derekmauro authored and copybara-github committed Nov 8, 2023
1 parent 8aff21b commit 2f77684
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions absl/synchronization/internal/pthread_waiter.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#ifndef ABSL_SYNCHRONIZATION_INTERNAL_PTHREAD_WAITER_H_
#define ABSL_SYNCHRONIZATION_INTERNAL_PTHREAD_WAITER_H_

#ifndef _WIN32
#if !defined(_WIN32) && !defined(__MINGW32__)
#include <pthread.h>

#include "absl/base/config.h"
Expand Down Expand Up @@ -55,6 +55,6 @@ class PthreadWaiter : public WaiterCrtp<PthreadWaiter> {
ABSL_NAMESPACE_END
} // namespace absl

#endif // ndef _WIN32
#endif // !defined(_WIN32) && !defined(__MINGW32__)

#endif // ABSL_SYNCHRONIZATION_INTERNAL_PTHREAD_WAITER_H_
6 changes: 4 additions & 2 deletions absl/synchronization/internal/win32_waiter.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
#include <sdkddkver.h>
#endif

#if defined(_WIN32) && _WIN32_WINNT >= _WIN32_WINNT_VISTA
#if defined(_WIN32) && !defined(__MINGW32__) && \
_WIN32_WINNT >= _WIN32_WINNT_VISTA

#include "absl/base/config.h"
#include "absl/synchronization/internal/kernel_timeout.h"
Expand Down Expand Up @@ -65,6 +66,7 @@ class Win32Waiter : public WaiterCrtp<Win32Waiter> {
ABSL_NAMESPACE_END
} // namespace absl

#endif // defined(_WIN32) && _WIN32_WINNT >= _WIN32_WINNT_VISTA
#endif // defined(_WIN32) && !defined(__MINGW32__) &&
// _WIN32_WINNT >= _WIN32_WINNT_VISTA

#endif // ABSL_SYNCHRONIZATION_INTERNAL_WIN32_WAITER_H_

0 comments on commit 2f77684

Please sign in to comment.