Skip to content

Commit bf3319d

Browse files
authored
Merge pull request steve-m#10 from librtlsdr/PThreadsFix
Bug Fix for some Broken MinGW PThreads sources
2 parents 13a070b + 3cda64c commit bf3319d

5 files changed

Lines changed: 22 additions & 1 deletion

File tree

CMakeLists.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,14 @@ if(CMAKE_COMPILER_IS_GNUCC AND NOT WIN32)
5757
add_definitions(-fvisibility=hidden)
5858
endif()
5959

60+
#########################################################################
61+
# Bug Fix
62+
#########################################################################
63+
OPTION(NEED_PTHREADS_WORKARROUND "PThreads Workarround for timespec")
64+
IF (DEFINED NEED_PTHREADS_WORKARROUND)
65+
ADD_DEFINITIONS(-DNEED_PTHREADS_WORKARROUND)
66+
ENDIF()
67+
6068
########################################################################
6169
# Find build dependencies
6270
########################################################################

src/rtl_adsb.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,10 @@
3636
#include <io.h>
3737
#include "getopt/getopt.h"
3838
#endif
39-
39+
40+
#ifdef NEED_PTHREADS_WORKARROUND
41+
#define HAVE_STRUCT_TIMESPEC
42+
#endif
4043
#include <pthread.h>
4144
#include <libusb.h>
4245

src/rtl_fm.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,10 @@
6969
#define _USE_MATH_DEFINES
7070
#endif
7171

72+
#ifdef NEED_PTHREADS_WORKARROUND
73+
#define HAVE_STRUCT_TIMESPEC
74+
#endif
75+
7276
#include <math.h>
7377
#include <pthread.h>
7478
#include <libusb.h>

src/rtl_power.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,9 @@
6060
#endif
6161

6262
#include <math.h>
63+
#ifdef NEED_PTHREADS_WORKARROUND
64+
#define HAVE_STRUCT_TIMESPEC
65+
#endif
6366
#include <pthread.h>
6467
#include <libusb.h>
6568

src/rtl_tcp.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@
3737
#include "getopt/getopt.h"
3838
#endif
3939

40+
#ifdef NEED_PTHREADS_WORKARROUND
41+
#define HAVE_STRUCT_TIMESPEC
42+
#endif
4043
#include <pthread.h>
4144

4245
#include "rtl-sdr.h"

0 commit comments

Comments
 (0)