use _GNU_SOURCE instead of _POSIX_C_SOURCE

CMakeLists.txt update to add compile flags and require pthread
This commit is contained in:
Jason Lee 2019-02-20 17:19:33 -07:00
parent 5658b2faa4
commit 0bf30ca72f
2 changed files with 7 additions and 1 deletions

View File

@ -1,6 +1,12 @@
cmake_minimum_required(VERSION 3.0.0)
project(C-Thread-Pool LANGUAGES C)
# define the DEBUG macro when building in debug mode
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DTHPOOL_DEBUG -Wall -Wextra")
# require pthreads to be available
find_package(Threads REQUIRED)
install(FILES thpool.h DESTINATION include/C-Thread-Pool)
add_library(thpool_static STATIC thpool.c)

View File

@ -8,7 +8,7 @@
*
********************************/
#define _POSIX_C_SOURCE 200809L
#define _GNU_SOURCE
#include <unistd.h>
#include <signal.h>
#include <stdio.h>