chiark / gitweb /
Remove or indent #define GNU_SOURCE
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Mon, 11 Mar 2013 22:03:13 +0000 (18:03 -0400)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Mon, 11 Mar 2013 22:03:13 +0000 (18:03 -0400)
It is only needed in files designed to be usable in standalone
compilation. In those files the #ifdefinery is indented. When
compiling in-tree, GNU_SOURCE is always defined, so remove one
definition.

src/libsystemd-daemon/sd-daemon.c
src/readahead/sd-readahead.c
src/udev/cdrom_id/cdrom_id.c

index 80aadf7adfc7c6da21acb7d3bd64cb6f74b6e0cc..5b92e2e3dbc908535053cb5056b06998affe0e1d 100644 (file)
@@ -25,7 +25,7 @@
 ***/
 
 #ifndef _GNU_SOURCE
-#define _GNU_SOURCE
+#  define _GNU_SOURCE
 #endif
 
 #include <sys/types.h>
@@ -33,9 +33,9 @@
 #include <sys/socket.h>
 #include <sys/un.h>
 #ifdef __BIONIC__
-#include <linux/fcntl.h>
+#  include <linux/fcntl.h>
 #else
-#include <sys/fcntl.h>
+#  include <sys/fcntl.h>
 #endif
 #include <netinet/in.h>
 #include <stdlib.h>
 #include <limits.h>
 
 #if defined(__linux__)
-#include <mqueue.h>
+#  include <mqueue.h>
 #endif
 
 #include "sd-daemon.h"
 
 #if (__GNUC__ >= 4)
-#ifdef SD_EXPORT_SYMBOLS
+#  ifdef SD_EXPORT_SYMBOLS
 /* Export symbols */
-#define _sd_export_ __attribute__ ((visibility("default")))
-#else
+#    define _sd_export_ __attribute__ ((visibility("default")))
+#  else
 /* Don't export the symbols */
-#define _sd_export_ __attribute__ ((visibility("hidden")))
-#endif
+#    define _sd_export_ __attribute__ ((visibility("hidden")))
+#  endif
 #else
-#define _sd_export_
+#  define _sd_export_
 #endif
 
 _sd_export_ int sd_listen_fds(int unset_environment) {
index d48cd768079e74166f716283368ae7795765af72..4a096eed427779c3b326c3bef08daa903d5dc419 100644 (file)
@@ -25,7 +25,7 @@
 ***/
 
 #ifndef _GNU_SOURCE
-#define _GNU_SOURCE
+#  define _GNU_SOURCE
 #endif
 
 #include <unistd.h>
 #include "sd-readahead.h"
 
 #if (__GNUC__ >= 4)
-#ifdef SD_EXPORT_SYMBOLS
+#  ifdef SD_EXPORT_SYMBOLS
 /* Export symbols */
-#define _sd_export_ __attribute__ ((visibility("default")))
-#else
+#    define _sd_export_ __attribute__ ((visibility("default")))
+#  else
 /* Don't export the symbols */
-#define _sd_export_ __attribute__ ((visibility("hidden")))
-#endif
+#    define _sd_export_ __attribute__ ((visibility("hidden")))
+#  endif
 #else
-#define _sd_export_
+#  define _sd_export_
 #endif
 
 static int touch(const char *path) {
index b659cc31ee202b5f1f0d4a356a575930ccf84efb..1ad045923630aa6b59017986250d4f69850f7cd4 100644 (file)
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-#ifndef _GNU_SOURCE
-#define _GNU_SOURCE 1
-#endif
-
 #include <stdio.h>
 #include <stddef.h>
 #include <stdlib.h>