From 4668c291e2d268b9708464e4c19aceaddd14523b Mon Sep 17 00:00:00 2001 From: Matt Arsenault Date: Tue, 30 Jun 2020 18:31:15 -0400 Subject: [PATCH] Fix -Wunused-private-field Change-Id: Ib60e8dc2625c0c5e10fa109e452af0bc6174e763 [ROCm/clr commit: 51f4aa305b240dbbb80c4c16cafbba9a62d3424e] --- projects/clr/rocclr/thread/semaphore.hpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/projects/clr/rocclr/thread/semaphore.hpp b/projects/clr/rocclr/thread/semaphore.hpp index 623399556d..c76ce36e2e 100644 --- a/projects/clr/rocclr/thread/semaphore.hpp +++ b/projects/clr/rocclr/thread/semaphore.hpp @@ -50,14 +50,16 @@ class Semaphore : public HeapObject { static constexpr size_t state_size = sizeof(std::atomic_int) + alignof(std::atomic_int); + union { #ifdef _WIN32 - void* handle_; //!< The semaphore object's handle. - char padding_[64 - state_size - sizeof(handle_)]; + void* handle_; //!< The semaphore object's handle. #else // !_WIN32 - sem_t sem_; //!< The semaphore object's identifier. - char padding_[64 - state_size - sizeof(sem_)]; + sem_t sem_; //!< The semaphore object's identifier. #endif /*!_WIN32*/ + char padding_[64 - state_size]; + }; + public: Semaphore(); ~Semaphore();