fix _ALL_SOURCE logic to avoid possible redefinition of _GNU_SOURCE
authorRich Felker <dalias@aerifal.cx>
Wed, 10 Sep 2014 16:40:38 +0000 (12:40 -0400)
committerRich Felker <dalias@aerifal.cx>
Wed, 10 Sep 2014 16:40:38 +0000 (12:40 -0400)
this could be an error if _GNU_SOURCE was already defined differently
by the application.

include/features.h

index 294c61d..61ad2f5 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef _FEATURES_H
 #define _FEATURES_H
 
-#ifdef _ALL_SOURCE
+#if defined(_ALL_SOURCE) && !defined(_GNU_SOURCE)
 #define _GNU_SOURCE 1
 #endif