Fix build issues on OSX

This commit is contained in:
Matias Fontanini
2016-06-20 13:31:15 -07:00
parent c615664f12
commit 0a58fc306b
4 changed files with 4 additions and 2 deletions

View File

@@ -33,6 +33,7 @@
#include <memory> #include <memory>
#include <iosfwd> #include <iosfwd>
#include <algorithm> #include <algorithm>
#include <vector>
#include <librdkafka/rdkafka.h> #include <librdkafka/rdkafka.h>
#include "macros.h" #include "macros.h"

View File

@@ -16,6 +16,7 @@ set(SOURCES
) )
add_library(cppkafka ${CPPKAFKA_LIBRARY_TYPE} ${SOURCES}) add_library(cppkafka ${CPPKAFKA_LIBRARY_TYPE} ${SOURCES})
target_link_libraries(cppkafka ${RDKAFKA_LIBRARY})
install( install(
TARGETS cppkafka TARGETS cppkafka

View File

@@ -171,7 +171,7 @@ void Configuration::set_socket_callback(SocketCallback callback) {
} }
void Configuration::set_default_topic_configuration(optional<TopicConfiguration> config) { void Configuration::set_default_topic_configuration(optional<TopicConfiguration> config) {
default_topic_config_ = move(config); default_topic_config_ = std::move(config);
} }
bool Configuration::has_property(const string& name) const { bool Configuration::has_property(const string& name) const {

View File

@@ -110,7 +110,7 @@ optional<MessageTimestamp> Message::get_timestamp() const {
rd_kafka_timestamp_type_t type = RD_KAFKA_TIMESTAMP_NOT_AVAILABLE; rd_kafka_timestamp_type_t type = RD_KAFKA_TIMESTAMP_NOT_AVAILABLE;
int64_t timestamp = rd_kafka_message_timestamp(handle_.get(), &type); int64_t timestamp = rd_kafka_message_timestamp(handle_.get(), &type);
if (timestamp == -1 || type == RD_KAFKA_TIMESTAMP_NOT_AVAILABLE) { if (timestamp == -1 || type == RD_KAFKA_TIMESTAMP_NOT_AVAILABLE) {
return none_t(); return {};
} }
return MessageTimestamp(timestamp, static_cast<MessageTimestamp::TimestampType>(type)); return MessageTimestamp(timestamp, static_cast<MessageTimestamp::TimestampType>(type));
} }