Commit 3dfaaa98 authored by Jacob Gladish's avatar Jacob Gladish

Fixed build on Linux

parent b74fa4c7
......@@ -84,7 +84,8 @@ int32_t AdapterLib::MockAdapter::EnumDevices(
shared_ptr<Bridge::IAdapterIoRequest>* req)
{
if (req)
*req = NULL;
req->reset();
deviceList.clear();
std::copy(m_devices.begin(), m_devices.end(), std::back_inserter(deviceList));
......@@ -98,7 +99,7 @@ int32_t AdapterLib::MockAdapter::GetProperty(
shared_ptr<Bridge::IAdapterIoRequest>* req)
{
if (req)
*req = NULL;
req->reset();
shared_ptr<MockAdapterProperty> mockAdapterProperty = dynamic_pointer_cast<MockAdapterProperty>(prop);
if (!mockAdapterProperty)
......@@ -123,7 +124,7 @@ int32_t AdapterLib::MockAdapter::SetProperty(
shared_ptr<Bridge::IAdapterIoRequest>* req)
{
if (req)
*req = NULL;
req ->reset();
shared_ptr<MockAdapterProperty> mockAdapterProperty = dynamic_pointer_cast<MockAdapterProperty>(prop);
if (!mockAdapterProperty)
......@@ -150,7 +151,7 @@ int32_t AdapterLib::MockAdapter::GetPropertyValue(
shared_ptr<Bridge::IAdapterIoRequest>* req)
{
if (req)
*req = NULL;
req->reset();
shared_ptr<MockAdapterProperty> mockAdapterProperty = dynamic_pointer_cast<MockAdapterProperty>(prop);
if (!mockAdapterProperty)
......@@ -172,7 +173,7 @@ int32_t AdapterLib::MockAdapter::SetPropertyValue(
shared_ptr<Bridge::IAdapterIoRequest>* req)
{
if (req)
*req = NULL;
req->reset();
shared_ptr<MockAdapterProperty> mockAdapterProperty = dynamic_pointer_cast<MockAdapterProperty>(prop);
if (!mockAdapterProperty)
......
......@@ -61,7 +61,7 @@ int32_t MockAdapterDevice::DispatchMethod(
shared_ptr<Bridge::IAdapterIoRequest>* req)
{
if (req)
*req = NULL;
req->reset();
int32_t st = ER_OK;
if (method->GetName() == kDeviceResetMethod)
......
......@@ -3,6 +3,7 @@
#include <string>
#include <sstream>
#include <string.h>
#include <strings.h>
#include <libxml/tree.h>
......
......@@ -12,8 +12,13 @@ namespace Common
{
uuid_t uuid;
uuid_generate_random(uuid);
#ifdef __linux__
char* s;
#else
uuid_string_t s;
#endif
uuid_unparse(uuid, s);
return Guid(std::string(s));
......
......@@ -7,6 +7,11 @@
#include <sys/time.h>
#include <time.h>
#ifdef __linux__
#include <unistd.h>
#include <sys/syscall.h>
#endif
#include <map>
namespace
......@@ -55,7 +60,7 @@ namespace
pthread_t GetCurrentThreadId() { return pthread_self(); }
#else
#define ThreadId_FMT "%d"
int32_t GetCurrentThreadId() { return syscall(SYS_gettid); }
int32_t GetCurrentThreadId() { return syscall(__NR_gettid); }
#endif
}
......
......@@ -3,6 +3,7 @@
#include <stdint.h>
#include <stdlib.h>
#include <string>
#include <string.h>
namespace Common
{
......
......@@ -13,10 +13,11 @@ SRCS=DeviceProviders/AllJoynProvider.cpp \
LIBXML_INC=/usr/include/libxml2
ALLJOYN_INSTALL_DIR=/Users/jgladi200/Work/alljoyn/alljoyn-15.04.00-src/build/darwin/x86/debug/dist/cpp
#ALLJOYN_INSTALL_DIR=/Users/jgladi200/Work/alljoyn/alljoyn-15.04.00-src/build/darwin/x86/debug/dist/cpp
ALLJOYN_INSTALL_DIR=/home/gladish/work/alljoyn-15.09.00-src/build/linux/x86_64/debug/dist/cpp/
CXXFLAGS=-D QCC_OS_GROUP_POSIX -Wall -Wextra -g -std=c++0x -I. -I$(ALLJOYN_INSTALL_DIR)/inc -I$(LIBXML_INC)
LDFLAGS=-L $(ALLJOYN_INSTALL_DIR)/lib -lalljoyn -lcrypto -lxml2
LDFLAGS=-L $(ALLJOYN_INSTALL_DIR)/lib -lalljoyn -lcrypto -lxml2 -pthread -luuid
DEV_PROVIDER_OBJS=$(patsubst %.cpp, %.o,$(SRCS))
OBJS=$(DEV_PROVIDER_OBJS)
......
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