Commit e8ab7282 authored by zhujiashun's avatar zhujiashun

add necessary header

parent 8adbabc6
......@@ -126,14 +126,18 @@ set(DYNAMIC_LIB
${LEVELDB_LIB}
${PROTOC_LIB}
${CMAKE_THREAD_LIBS_INIT}
pthread
rt
ssl
crypto
dl
z
)
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
set(DYNAMIC_LIB ${DYNAMIC_LIB} rt)
elseif(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
set(DYNAMIC_LIB ${DYNAMIC_LIB} pthread)
endif()
# for *.so
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/output/lib)
# for *.a
......
......@@ -17,6 +17,7 @@
#include "brpc/details/hpack.h"
#include <limits> // std::numeric_limits
#include <vector>
#include "butil/containers/bounded_queue.h" // butil::BoundedQueue
#include "butil/containers/flat_map.h" // butil::FlatMap
......
......@@ -35,7 +35,10 @@ int64_t monotonic_time_ns() {
// use the RAW version does not make sense anymore.
// NOTE: Not inline to keep ABI-compatible with previous versions.
timespec now;
#ifdef __MACH__ // OS X does not have clock_gettime, use clock_get_time
#ifdef __MACH__
// OS X does not have clock_gettime, use clock_get_time.
// The value returned is a monotonically increasing value according to
// https://opensource.apple.com/source/xnu/xnu-792.13.8/osfmk/man/clock_get_time.html
clock_serv_t cclock;
mach_timespec_t mts;
host_get_clock_service(mach_host_self(), CALENDAR_CLOCK, &cclock);
......
......@@ -20,6 +20,7 @@
#define MCPACK2PB_MCPACK_SERIALIZER_H
#include <limits>
#include <vector>
#include <google/protobuf/io/zero_copy_stream.h>
#include "butil/logging.h"
#include "butil/strings/string_piece.h"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment