From d65f4c92e8ed405937a7bac3248d24fa6b40eb6f Mon Sep 17 00:00:00 2001 From: Christopher Wellons Date: Tue, 23 Jan 2018 08:27:30 -0500 Subject: Use _POSIX_C_SOURCE, drop _BSD_SOURCE, _GNU_SOURCE (#5, #12) The only need for _BSD_SOURCE is a single use of the trivial, but non-standard, strdup(). The only need for _GNU_SOURCE is for getline(). This function was standardized by POSIX 10 years ago, so you only need to ask for it with _POSIX_C_SOURCE. Also added time.h which is only included by luck from the removed feature test macros. This is better than PR #5 because _DEFAULT_SOURCE isn't needed at all. --- kilo.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kilo.c b/kilo.c index 9490a77..5405e45 100644 --- a/kilo.c +++ b/kilo.c @@ -34,8 +34,7 @@ #define KILO_VERSION "0.0.1" -#define _BSD_SOURCE -#define _GNU_SOURCE +#define _POSIX_C_SOURCE 200809L #include #include @@ -44,6 +43,7 @@ #include #include #include +#include #include #include #include -- cgit v1.2.3