Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(3455)

Issue 49041: Port gtest to MinGW.

Can't Edit
Can't Publish+Mail
Start Review
Created:
15 years ago by kenton
Modified:
15 years ago
Reviewers:
Vlad, tsuna, Zhanyong Wan
CC:
chandlerc1, tsuna_google.com, googletestframework_googlegroups.com
Base URL:
http://googletest.googlecode.com/svn/trunk/
Visibility:
Public.

Description

It didn't take much to make gtest compile on MinGW: * Code using SEH doesn't work on MinGW, so I had to update the #ifdefs appropriately. (No version of GCC supports SEH so I used defined(__GNUC__) as the condition.) * MinGW defines helpful macros for posix functions which normally require a leading underscore on Windows. Unfortunately this is totally incompatible with gtest's attempt to move these functions into a namespace. For now I #undef'd them but this isn't a good long-term solution. ** UPDATE: I reverted this part of the change as Zhanyong is working on a better fix. * MinGW doesn't support pthreads. The makefiles appear to assume that all systems use pthreads. I went ahead and added the ACX_PTHREAD macro that several other Google open source projects use to the m4 directory and made the configure script use it to detect pthreads. This should have other positive effects, like handling systems where the "-pthread" compiler flag doesn't exist (but -lpthread works).

Patch Set 1 #

Total comments: 21

Patch Set 2 : Address review comments. #

Patch Set 3 : Updated to rev 242. #

Total comments: 11

Patch Set 4 : Add comment. #

Patch Set 5 : Add comment. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+401 lines, -14 lines) Patch
M Makefile.am View 1 2 1 chunk +2 lines, -2 lines 0 comments Download
M configure.ac View 1 2 2 chunks +5 lines, -0 lines 0 comments Download
M include/gtest/internal/gtest-port.h View 1 2 3 4 2 chunks +19 lines, -0 lines 0 comments Download
A m4/acx_pthread.m4 View 1 chunk +363 lines, -0 lines 0 comments Download
M src/gtest.cc View 1 2 8 chunks +12 lines, -12 lines 0 comments Download

Messages

Total messages: 10
Zhanyong Wan
Thanks for the contribution. I'll leave the autotools stuff to an expert. Chandler and Benoit, ...
15 years ago (2009-04-22 06:12:18 UTC) #1
tsuna
LGTM http://codereview.appspot.com/49041/diff/1/5 File configure.ac (right): http://codereview.appspot.com/49041/diff/1/5#newcode1 Line 1: m4_include(m4/acx_pthread.m4) This shouldn't be required. I have ...
15 years ago (2009-04-22 07:34:39 UTC) #2
Vlad
http://codereview.appspot.com/49041/diff/1/3 File include/gtest/internal/gtest-port.h (right): http://codereview.appspot.com/49041/diff/1/3#newcode334 Line 334: #define GTEST_HAS_PTHREAD (GTEST_OS_LINUX || GTEST_OS_MAC) Should use HAVE_PTHREAD ...
15 years ago (2009-04-22 07:41:41 UTC) #3
kenton
Patch updated. http://codereview.appspot.com/49041/diff/1/3 File include/gtest/internal/gtest-port.h (right): http://codereview.appspot.com/49041/diff/1/3#newcode334 Line 334: #define GTEST_HAS_PTHREAD (GTEST_OS_LINUX || GTEST_OS_MAC) On ...
15 years ago (2009-04-23 21:35:02 UTC) #4
Vlad
http://codereview.appspot.com/49041/diff/1/3 File include/gtest/internal/gtest-port.h (right): http://codereview.appspot.com/49041/diff/1/3#newcode334 Line 334: #define GTEST_HAS_PTHREAD (GTEST_OS_LINUX || GTEST_OS_MAC) On 2009/04/23 21:35:03, ...
15 years ago (2009-04-23 23:47:15 UTC) #5
kenton
I've updated this patch to rev 242 which contains a proper fix for the POSIX ...
15 years ago (2009-04-24 00:40:08 UTC) #6
Vlad
http://codereview.appspot.com/49041/diff/1/3 File include/gtest/internal/gtest-port.h (right): http://codereview.appspot.com/49041/diff/1/3#newcode334 Line 334: #define GTEST_HAS_PTHREAD (GTEST_OS_LINUX || GTEST_OS_MAC) On 2009/04/24 00:40:09, ...
15 years ago (2009-04-24 01:35:46 UTC) #7
Zhanyong Wan
http://codereview.appspot.com/49041/diff/1/3 File include/gtest/internal/gtest-port.h (right): http://codereview.appspot.com/49041/diff/1/3#newcode334 Line 334: #define GTEST_HAS_PTHREAD (GTEST_OS_LINUX || GTEST_OS_MAC) On 2009/04/24 01:35:46, ...
15 years ago (2009-04-24 17:51:01 UTC) #8
kenton
Updated patch set 5. (Ignore patch set 4 -- accidentally uploaded at the wrong time, ...
15 years ago (2009-04-24 20:32:58 UTC) #9
Zhanyong Wan
15 years ago (2009-04-24 20:59:17 UTC) #10
Looks good.  Thanks for the contribution, Kenton!
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b