What steps will reproduce the problem?
1. Compile any test case using death test asserts (eq. EXPECT_EXIT())
What is the expected output? What do you see instead?
The following error occurs:
gtest-1.3.0/include/gtest/internal/gtest-death-test-internal.h", line 209:
Error: The function "close" must have a prototype.
What version of the product are you using? On what operating system?
gtest 1.3.0
uname -a
SunOS 5.10 Generic_118833-03 sun4u sparc SUNW,Sun-Fire-V890
CC -V
Sun C++ 5.8 2005/10/13
Please provide any additional information below.
unistd.h should be included explicitly.
The following patch solves this problem:
==== gtest-1.3.0/include/gtest/internal/gtest-port.h#1 - gtest-
1.3.0/include/gtest/internal/gtest-port.h ====
@@ -379,11 +379,16 @@
#if GTEST_HAS_STD_STRING && (GTEST_OS_LINUX || \
GTEST_OS_MAC || \
GTEST_OS_CYGWIN || \
(GTEST_OS_WINDOWS && _MSC_VER >= 1400))
#define GTEST_HAS_DEATH_TEST 1
#include <vector>
#endif
+#ifndef _MSC_VER
+#include <unistd.h>
+#endif
+
// Determines whether to support value-parameterized tests.
#if defined(__GNUC__) || (_MSC_VER >= 1400)
Original issue reported on code.google.com by ade...@gmail.com on 29 Jul 2009 at 2:37
Original issue reported on code.google.com by
ade...@gmail.com
on 29 Jul 2009 at 2:37