Skip to content

Commit

Permalink
On cygwin, define _GNU_SOURCE in pthreads-based OpenThreads
Browse files Browse the repository at this point in the history
pthread_{yield,getconcurrency,setconcurrency} are not declared in
pthread.h on cygwin with gcc 7.3.0 unless _GNU_SOURCE is defined.
  • Loading branch information
Chris White committed Aug 5, 2018
1 parent cd5c75a commit b4889a8
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/OpenThreads/pthreads/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ SET(TARGET_SRC
../common/Version.cpp
../common/Atomic.cpp
)

IF(CYGWIN) # define for pthread_{yield,getconcurrency,setconcurrency}
ADD_DEFINITIONS(-D_GNU_SOURCE)
ENDIF()

IF(ANDROID)
ADD_DEFINITIONS(-D_GNU_SOURCE)
SET(CMAKE_REQUIRED_DEFINITIONS "${CMAKE_REQUIRED_DEFINITIONS} -D_GNU_SOURCE")
Expand Down

0 comments on commit b4889a8

Please sign in to comment.