From a28d819d1345f9c14adfd0fd2b2b0f8f73fcc9f7 Mon Sep 17 00:00:00 2001 From: Mark Slee Date: Wed, 4 Apr 2007 22:11:17 +0000 Subject: [PATCH] Build fixes and clock_get_time copy from paul querna Reviewed By: mcslee git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665085 13f79535-47bb-0310-9956-ffa450edef68 --- CONTRIBUTORS | 10 ++++++++++ lib/cpp/bootstrap.sh | 6 +++++- lib/cpp/src/transport/TFileTransport.cpp | 24 ++++++++++++++++++++++++ 3 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 CONTRIBUTORS diff --git a/CONTRIBUTORS b/CONTRIBUTORS new file mode 100644 index 00000000..cd5901f2 --- /dev/null +++ b/CONTRIBUTORS @@ -0,0 +1,10 @@ +---------------- +Release 20070401 +---------------- + +Kevin Ko +-Fix for unnecessary std::string copy construction in Protocol/Exception + +Paul Querna +-Autoconf error message fix for libevent detection +-clock_gettime implementation for OSX diff --git a/lib/cpp/bootstrap.sh b/lib/cpp/bootstrap.sh index 34df69d9..431e35a3 100755 --- a/lib/cpp/bootstrap.sh +++ b/lib/cpp/bootstrap.sh @@ -4,7 +4,11 @@ autoscan autoheader aclocal -I ./aclocal -libtoolize --automake +if glibtoolize --version 1 >/dev/null 2>/dev/null; then + libtoolize --automake +elif glibtoolize --version 1 >/dev/null 2>/dev/null; then + glibtoolize --automake +fi touch NEWS README AUTHORS ChangeLog autoconf automake -ac diff --git a/lib/cpp/src/transport/TFileTransport.cpp b/lib/cpp/src/transport/TFileTransport.cpp index 001783fc..3b18d0ea 100644 --- a/lib/cpp/src/transport/TFileTransport.cpp +++ b/lib/cpp/src/transport/TFileTransport.cpp @@ -8,7 +8,11 @@ #include "TTransportUtils.h" #include +#ifndef HAVE_CLOCK_GETTIME +#include +#else #include +#endif #include #include #include @@ -21,6 +25,26 @@ using boost::shared_ptr; using namespace std; using namespace facebook::thrift::protocol; +#ifndef HAVE_CLOCK_GETTIME +/** + * Fake clock_gettime for systems like darwin + * + * @author Paul Querna + */ +#define CLOCK_REALTIME 0 +static int clock_gettime(int clk_id /*ignored*/, struct timespec *tp) { + struct timeval now; + + int rv = gettimeofday(&now, NULL); + if (rv != 0) { + return rv; + } + + tp->tv_sec = now.tv_sec; + tp->tv_nsec = now.tv_usec * 1000; + return 0; +} +#endif TFileTransport::TFileTransport(string path) : readState_() -- 2.17.1