From 954bc4626c0dfb059ae2ecd1e4e583b60124d699 Mon Sep 17 00:00:00 2001 From: Jonathan Naylor Date: Mon, 6 Jun 2016 19:29:23 +0100 Subject: [PATCH] Fix Linux threading compile issues. --- YSFGateway/Makefile | 12 ++++++------ YSFGateway/Thread.cpp | 2 ++ YSFGateway/Thread.h | 2 +- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/YSFGateway/Makefile b/YSFGateway/Makefile index ea5e6e7..0508eb8 100644 --- a/YSFGateway/Makefile +++ b/YSFGateway/Makefile @@ -1,19 +1,19 @@ CC = gcc CXX = g++ -CFLAGS = -g -O3 -Wall -std=c++0x -LIBS = +CFLAGS = -g -O3 -Wall -std=c++0x -pthread +LIBS = -lpthread LDFLAGS = -g OBJECTS = Network.o StopWatch.o Timer.o UDPSocket.o Utils.o YSFReflector.o -all: YSFReflector +all: YSFGateway -YSFReflector: $(OBJECTS) - $(CXX) $(OBJECTS) $(CFLAGS) $(LIBS) -o YSFReflector +YSFGateway: $(OBJECTS) + $(CXX) $(OBJECTS) $(CFLAGS) $(LIBS) -o YSFGateway %.o: %.cpp $(CXX) $(CFLAGS) -c -o $@ $< clean: - $(RM) YSFReflector *.o *.d *.bak *~ + $(RM) YSFGateway *.o *.d *.bak *~ \ No newline at end of file diff --git a/YSFGateway/Thread.cpp b/YSFGateway/Thread.cpp index 9f43374..b334436 100644 --- a/YSFGateway/Thread.cpp +++ b/YSFGateway/Thread.cpp @@ -61,6 +61,8 @@ void CThread::sleep(unsigned int ms) #else +#include + CThread::CThread() : m_thread() { diff --git a/YSFGateway/Thread.h b/YSFGateway/Thread.h index 8a6843f..352d938 100644 --- a/YSFGateway/Thread.h +++ b/YSFGateway/Thread.h @@ -41,7 +41,7 @@ public: private: #if defined(_WIN32) || defined(_WIN64) - HANDLE m_handle; + HANDLE m_handle; #else pthread_t m_thread; #endif