mirror of
https://github.com/valitydev/thrift.git
synced 2024-11-07 10:48:51 +00:00
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
This commit is contained in:
parent
82a6c0f259
commit
a28d819d13
10
CONTRIBUTORS
Normal file
10
CONTRIBUTORS
Normal file
@ -0,0 +1,10 @@
|
||||
----------------
|
||||
Release 20070401
|
||||
----------------
|
||||
|
||||
Kevin Ko <kevin.s.ko@gmail.com>
|
||||
-Fix for unnecessary std::string copy construction in Protocol/Exception
|
||||
|
||||
Paul Querna <pquerna@apache.org>
|
||||
-Autoconf error message fix for libevent detection
|
||||
-clock_gettime implementation for OSX
|
@ -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
|
||||
|
@ -8,7 +8,11 @@
|
||||
#include "TTransportUtils.h"
|
||||
|
||||
#include <pthread.h>
|
||||
#ifndef HAVE_CLOCK_GETTIME
|
||||
#include <time.h>
|
||||
#else
|
||||
#include <sys/time.h>
|
||||
#endif
|
||||
#include <fcntl.h>
|
||||
#include <errno.h>
|
||||
#include <unistd.h>
|
||||
@ -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 <pquerna@apache.org>
|
||||
*/
|
||||
#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_()
|
||||
|
Loading…
Reference in New Issue
Block a user