blob: 6caba016e363f9108794b4bfa2311da18bdf297b [file] [log] [blame]
brians343bc112013-02-10 01:53:46 +00001diff -rupN gtest-1.6.0-p1/fused-src/gtest/gtest-all.cc gtest-1.6.0/fused-src/gtest/gtest-all.cc
2--- gtest-1.6.0-p1/fused-src/gtest/gtest-all.cc 2011-04-15 12:54:57.000000000 -0700
3+++ gtest-1.6.0/fused-src/gtest/gtest-all.cc 2012-11-12 17:42:37.881573135 -0800
4@@ -379,7 +379,25 @@ class GTEST_API_ SingleFailureChecker {
5
6 // cpplint thinks that the header is already included, so we want to
7 // silence it.
8+#ifdef __VXWORKS__
9+# include <time.h> // NOLINT
10+# include <sys/times.h> // NOLINT
11+static inline int gettimeofday(struct timeval *tv, void *) {
12+ struct timespec ts;
13+
14+ if (clock_gettime(CLOCK_REALTIME, &ts) != 0) {
15+ printf("Gettimeofday error\n");
16+ tv->tv_sec = 0;
17+ tv->tv_usec = 0;
18+ return -1;
19+ }
20+ tv->tv_sec = ts.tv_sec;
21+ tv->tv_usec = ts.tv_nsec/1000;
22+ return 0;
23+}
24+#else
25 # include <sys/time.h> // NOLINT
26+#endif
27 # include <unistd.h> // NOLINT
28
29 #endif // GTEST_OS_LINUX
30@@ -7751,6 +7769,8 @@ bool FilePath::CreateFolder() const {
31 delete [] unicode;
32 #elif GTEST_OS_WINDOWS
33 int result = _mkdir(pathname_.c_str());
34+#elif defined(__VXWORKS__)
35+ int result = mkdir(pathname_.c_str());
36 #else
37 int result = mkdir(pathname_.c_str(), 0777);
38 #endif // GTEST_OS_WINDOWS_MOBILE
39@@ -7870,7 +7890,7 @@ void FilePath::Normalize() {
40 namespace testing {
41 namespace internal {
42
43-#if defined(_MSC_VER) || defined(__BORLANDC__)
44+#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__VXWORKS__)
45 // MSVC and C++Builder do not provide a definition of STDERR_FILENO.
46 const int kStdOutFileno = 1;
47 const int kStdErrFileno = 2;
48diff -rupN gtest-1.6.0-p1/include/gtest/internal/gtest-port.h gtest-1.6.0/include/gtest/internal/gtest-port.h
49--- gtest-1.6.0-p1/include/gtest/internal/gtest-port.h 2011-04-15 12:49:10.000000000 -0700
50+++ gtest-1.6.0/include/gtest/internal/gtest-port.h 2012-11-12 17:27:33.536801263 -0800
51@@ -197,6 +197,12 @@
52 #include <sstream> // NOLINT
53 #include <string> // NOLINT
54
55+#ifdef __VXWORKS__
56+int read(int fd, void *buf, size_t count);
57+int write(int fd, const void *buf, size_t count);
58+int close(int fd);
59+#endif
60+
61 #define GTEST_DEV_EMAIL_ "googletestframework@@googlegroups.com"
62 #define GTEST_FLAG_PREFIX_ "gtest_"
63 #define GTEST_FLAG_PREFIX_DASH_ "gtest-"