examples/CMakeLists.txt: clean up Feature Test Macro Requirements defines
authorAntonio Ospite <ao2@ao2.it>
Wed, 29 Jun 2016 17:35:21 +0000 (19:35 +0200)
committerAntonio Ospite <ao2@ao2.it>
Wed, 29 Jun 2016 17:35:21 +0000 (19:35 +0200)
Setting _POSIX_C_SOURCE to the right value enables all the needed
functionalities.

This also avoids using _DEFAULT_SOURCE explicitly to get rid of the
_BSD_SOURCE deprecation warning.

examples/CMakeLists.txt

index c563f5f..f076b19 100644 (file)
@@ -1,7 +1,5 @@
 include(CheckSymbolExists)
-add_definitions("-D_POSIX_C_SOURCE=2") # for getopt()
-add_definitions("-D_POSIX_SOURCE") # for sigaction
-add_definitions("-D_BSD_SOURCE") # for strdup
+add_definitions("-D_POSIX_C_SOURCE=200809L") # for getopt(), sigaction(), and strdup()
 
 include_directories(${CMAKE_SOURCE_DIR}/src/)