Skip to content

Commit

Permalink
Fix Linux threading compile issues.
Browse files Browse the repository at this point in the history
  • Loading branch information
g4klx committed Jun 6, 2016
1 parent eba4dde commit 277becc
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 7 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

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 = \
Expand Down
2 changes: 1 addition & 1 deletion Makefile.Pi.Adafruit
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Support for the Adafruit i2c 16 x 2 RGB LCD Pi Plate
CC = gcc
CXX = g++
CFLAGS = -g -O3 -Wall -std=c++0x -DHD44780 -DADAFRUIT_DISPLAY -I/usr/local/include
CFLAGS = -g -O3 -Wall -std=c++0x -pthread -DHD44780 -DADAFRUIT_DISPLAY -I/usr/local/include
LIBS = -lwiringPi -lwiringPiDev -lpthread
LDFLAGS = -g -L/usr/local/lib

Expand Down
2 changes: 1 addition & 1 deletion Makefile.Pi.HD44780
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

CC = gcc
CXX = g++
CFLAGS = -g -O3 -Wall -std=c++0x -DHD44780 -I/usr/local/include
CFLAGS = -g -O3 -Wall -std=c++0x -pthread -DHD44780 -I/usr/local/include
LIBS = -lwiringPi -lwiringPiDev -lpthread
LDFLAGS = -g -L/usr/local/lib

Expand Down
4 changes: 2 additions & 2 deletions Makefile.Pi.OLED
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

CC = gcc
CXX = g++
CFLAGS = -g -O3 -Wall -std=c++0x -DOLED -I/usr/local/include
LIBS = -lArduiPi_OLED
CFLAGS = -g -O3 -Wall -std=c++0x -pthread -DOLED -I/usr/local/include
LIBS = -lArduiPi_OLED -lpthread
LDFLAGS = -g -L/usr/local/lib

OBJECTS = \
Expand Down
2 changes: 2 additions & 0 deletions Thread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ void CThread::sleep(unsigned int ms)

#else

#include <unistd.h>

CThread::CThread() :
m_thread()
{
Expand Down
2 changes: 1 addition & 1 deletion Thread.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class CThread

private:
#if defined(_WIN32) || defined(_WIN64)
HANDLE m_handle;
HANDLE m_handle;
#else
pthread_t m_thread;
#endif
Expand Down

0 comments on commit 277becc

Please sign in to comment.