blob: 6caba016e363f9108794b4bfa2311da18bdf297b [file] [log] [blame]
diff -rupN gtest-1.6.0-p1/fused-src/gtest/gtest-all.cc gtest-1.6.0/fused-src/gtest/gtest-all.cc
--- gtest-1.6.0-p1/fused-src/gtest/gtest-all.cc 2011-04-15 12:54:57.000000000 -0700
+++ gtest-1.6.0/fused-src/gtest/gtest-all.cc 2012-11-12 17:42:37.881573135 -0800
@@ -379,7 +379,25 @@ class GTEST_API_ SingleFailureChecker {
// cpplint thinks that the header is already included, so we want to
// silence it.
+#ifdef __VXWORKS__
+# include <time.h> // NOLINT
+# include <sys/times.h> // NOLINT
+static inline int gettimeofday(struct timeval *tv, void *) {
+ struct timespec ts;
+
+ if (clock_gettime(CLOCK_REALTIME, &ts) != 0) {
+ printf("Gettimeofday error\n");
+ tv->tv_sec = 0;
+ tv->tv_usec = 0;
+ return -1;
+ }
+ tv->tv_sec = ts.tv_sec;
+ tv->tv_usec = ts.tv_nsec/1000;
+ return 0;
+}
+#else
# include <sys/time.h> // NOLINT
+#endif
# include <unistd.h> // NOLINT
#endif // GTEST_OS_LINUX
@@ -7751,6 +7769,8 @@ bool FilePath::CreateFolder() const {
delete [] unicode;
#elif GTEST_OS_WINDOWS
int result = _mkdir(pathname_.c_str());
+#elif defined(__VXWORKS__)
+ int result = mkdir(pathname_.c_str());
#else
int result = mkdir(pathname_.c_str(), 0777);
#endif // GTEST_OS_WINDOWS_MOBILE
@@ -7870,7 +7890,7 @@ void FilePath::Normalize() {
namespace testing {
namespace internal {
-#if defined(_MSC_VER) || defined(__BORLANDC__)
+#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__VXWORKS__)
// MSVC and C++Builder do not provide a definition of STDERR_FILENO.
const int kStdOutFileno = 1;
const int kStdErrFileno = 2;
diff -rupN gtest-1.6.0-p1/include/gtest/internal/gtest-port.h gtest-1.6.0/include/gtest/internal/gtest-port.h
--- gtest-1.6.0-p1/include/gtest/internal/gtest-port.h 2011-04-15 12:49:10.000000000 -0700
+++ gtest-1.6.0/include/gtest/internal/gtest-port.h 2012-11-12 17:27:33.536801263 -0800
@@ -197,6 +197,12 @@
#include <sstream> // NOLINT
#include <string> // NOLINT
+#ifdef __VXWORKS__
+int read(int fd, void *buf, size_t count);
+int write(int fd, const void *buf, size_t count);
+int close(int fd);
+#endif
+
#define GTEST_DEV_EMAIL_ "googletestframework@@googlegroups.com"
#define GTEST_FLAG_PREFIX_ "gtest_"
#define GTEST_FLAG_PREFIX_DASH_ "gtest-"