Skip to content
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

gtest: Fix compilation on MinGW with pthread /googletest#621 #3604

Merged
merged 1 commit into from
Jun 8, 2018

Conversation

stoffu
Copy link
Contributor

@stoffu stoffu commented Apr 11, 2018

Compile errors on Windows were reported by @iDunk5400 in #3245 (comment), but somehow the problem was never addressed since then.

In file included from C:/msys64/home/monero/tests/gtest/include/gtest/internal/gtest-internal.h:40:0,
                 from C:/msys64/home/monero/tests/gtest/include/gtest/gtest.h:58,
                 from C:/msys64/home/monero/tests/gtest/src/gtest-all.cc:39:
C:/msys64/home/monero/tests/gtest/include/gtest/internal/gtest-port.h:1782:3: error: 'AutoHandle' does not name a type; did you mean 'mutable'?
   AutoHandle thread_;
   ^~~~~~~~~~
   mutable
In file included from C:/msys64/home/monero/tests/gtest/src/gtest-all.cc:43:0:
C:/msys64/home/monero/tests/gtest/src/gtest-death-test.cc:637:3: error: 'AutoHandle' does not name a type; did you mean 'LocalHandle'?
   AutoHandle write_handle_;
   ^~~~~~~~~~
   LocalHandle
C:/msys64/home/monero/tests/gtest/src/gtest-death-test.cc:639:3: error: 'AutoHandle' does not name a type; did you mean 'LocalHandle'?
   AutoHandle child_handle_;
   ^~~~~~~~~~
   LocalHandle
C:/msys64/home/monero/tests/gtest/src/gtest-death-test.cc:644:3: error: 'AutoHandle' does not name a type; did you mean 'LocalHandle'?
   AutoHandle event_handle_;
   ^~~~~~~~~~
   LocalHandle
C:/msys64/home/monero/tests/gtest/src/gtest-death-test.cc: In member function 'virtual int testing::internal::WindowsDeathTest::Wait()':
C:/msys64/home/monero/tests/gtest/src/gtest-death-test.cc:656:36: error: 'child_handle_' was not declared in this scope
   const HANDLE wait_handles[2] = { child_handle_.Get(), event_handle_.Get() };
                                    ^~~~~~~~~~~~~
C:/msys64/home/monero/tests/gtest/src/gtest-death-test.cc:656:36: note: suggested alternative: 'wait_handles'
   const HANDLE wait_handles[2] = { child_handle_.Get(), event_handle_.Get() };
                                    ^~~~~~~~~~~~~
                                    wait_handles

...

As a quick workaround, I've applied the un-merged upstream patch google/googletest#621 (deemed as duplicate of google/googletest#721). But it seems that the vendored gtest codebase is periodically updated by @fluffypony, so maybe this patch is not the right way to handle this issue.

@luigi1111 luigi1111 merged commit 54d9fff into monero-project:master Jun 8, 2018
luigi1111 added a commit that referenced this pull request Jun 8, 2018
 54d9fff gtest: Fix compilation on MinGW with pthread /googletest#621 (stoffu)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants