Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Move handling of _GNU_SOURCE into compat.h

Instead of handling #define'ing _GNU_SOURCE on linux in the Makefile,
move it into compat.h.

First, this is more intuitive and consistent with our handling of
build compatibility issues between bsd's & linux.  Second, this moves
us closer to removing a separate linux Makefile.
  • Loading branch information...
commit 80fd17e8cc3f1c9f78d86c4bc71093505df044ed 1 parent 4c8df8b
@ryanflannery authored
View
1  Makefile.linux
@@ -1,6 +1,5 @@
# Linux specific Makefile bits.
-CFLAGS+=-D_GNU_SOURCE
VPATH=players
INSTALL?=/bin/install
View
4 commands.h
@@ -17,6 +17,8 @@
#ifndef COMMANDS_H
#define COMMANDS_H
+#include "compat.h"
+
#include "enums.h"
#include "paint.h"
#include "str2argv.h"
@@ -24,8 +26,6 @@
#include "debug.h"
#include "keybindings.h"
-#include "compat.h"
-
/****************************************************************************
* Toggle-list handling stuff
***************************************************************************/
View
1  compat.h
@@ -56,6 +56,7 @@
/* Linux needs the following.. */
#if defined(__linux)
+# define _GNU_SOURCE
# define COMPAT_NEED_FPARSELN
# define COMPAT_NEED_OPTRESET
# define COMPAT_NEED_STRLCAT
View
4 e_commands.h
@@ -17,6 +17,8 @@
#ifndef E_COMMANDS_H
#define E_COMMANDS_H
+#include "compat.h"
+
#include <stdbool.h>
#include <getopt.h>
#include <string.h>
@@ -28,8 +30,6 @@
#include "medialib.h"
#include "playlist.h"
-#include "compat.h"
-
/* from vitunes.c */
extern char *vitunes_dir;
extern char *playlist_dir;
View
4 keybindings.h
@@ -17,13 +17,13 @@
#ifndef KEYBINDINGS_H
#define KEYBINDINGS_H
+#include "compat.h"
+
#include "debug.h"
#include "enums.h"
#include "paint.h"
#include "vitunes.h"
-#include "compat.h"
-
/*
* List of all actions that can be bound by keybindings.
* NOTE: Using "count" trick (see last element), so no enum should be defined.
View
4 medialib.h
@@ -25,6 +25,8 @@
#ifndef MEDIALIB_H
#define MEDIALIB_H
+#include "compat.h"
+
#include <sys/errno.h>
#include <sys/types.h>
#include <sys/stat.h>
@@ -38,8 +40,6 @@
#include "meta_info.h"
#include "playlist.h"
-#include "compat.h"
-
#define MEDIALIB_PLAYLISTS_CHUNK_SIZE 100
/* current database file-format version */
View
4 meta_info.h
@@ -17,6 +17,8 @@
#ifndef META_INFO_H
#define META_INFO_H
+#include "compat.h"
+
#include <ctype.h>
#include <limits.h>
#include <err.h>
@@ -35,8 +37,6 @@
#include "debug.h"
#include "enums.h"
-#include "compat.h"
-
/* the character-info fields. used for all meta-info that's shown */
#define MI_NUM_CINFO 8
#define MI_CINFO_ARTIST 0
View
4 paint.h
@@ -17,6 +17,8 @@
#ifndef PAINT_H
#define PAINT_H
+#include "compat.h"
+
#include <curses.h>
#include <math.h>
#include <string.h>
@@ -31,8 +33,6 @@
#include "uinterface.h"
#include "vitunes.h"
-#include "compat.h"
-
/* colors used by paint - each of these will be a number for a COLOR_PAIR */
typedef struct {
/* visual dividers of windows */
View
3  player.h
@@ -17,10 +17,11 @@
#ifndef PLAYER_H
#define PLAYER_H
+#include "compat.h"
+
#include <err.h>
#include "playlist.h"
-#include "compat.h"
#include "paint.h"
#include "debug.h"
View
2  players/mplayer.h
@@ -17,6 +17,8 @@
#ifndef MPLAYER_H
#define MPLAYER_H
+#include "../compat.h"
+
#include <sys/wait.h>
#include <sys/types.h>
View
2  players/player_utils.h
@@ -17,6 +17,8 @@
#ifndef PLAYER_UTILS_H
#define PLAYER_UTILS_H
+#include "../compat.h"
+
#include <stdbool.h>
#include <stdlib.h>
#include <string.h>
View
4 playlist.h
@@ -17,6 +17,8 @@
#ifndef PLAYLIST_H
#define PLAYLIST_H
+#include "compat.h"
+
#include <sys/stat.h>
#include <sys/types.h>
@@ -32,8 +34,6 @@
#include "debug.h"
#include "meta_info.h"
-#include "compat.h"
-
#define PLAYLIST_CHUNK_SIZE 100
#define DEFAULT_HISTORY_SIZE 100
extern int history_size;
View
4 str2argv.h
@@ -17,6 +17,8 @@
#ifndef STR2ARGV_H
#define STR2ARGV_H
+#include "compat.h"
+
#include <err.h>
#include <stdbool.h>
#include <stdio.h>
@@ -25,8 +27,6 @@
#include "debug.h"
-#include "compat.h"
-
/* hard limits on the size of an argv and each entry/token w/in an argv */
#define ARGV_MAX_ENTRIES 255
#define ARGV_MAX_TOKEN_LEN 255
View
4 uinterface.h
@@ -17,6 +17,8 @@
#ifndef UINTERFACE_H
#define UINTERFACE_H
+#include "compat.h"
+
#include <sys/ioctl.h>
#include <ctype.h>
@@ -33,8 +35,6 @@
#include "debug.h"
#include "enums.h"
-#include "compat.h"
-
/* struct & methods for a scrollable window */
typedef struct
{
View
4 vitunes.h
@@ -17,6 +17,8 @@
#ifndef VITUNES_H
#define VITUNES_H
+#include "compat.h"
+
#include <sys/time.h>
#include <getopt.h>
@@ -35,8 +37,6 @@
#include "uinterface.h"
#include "e_commands.h"
-#include "compat.h"
-
/*
* These are the various things defined in vitunes.c used elsewhere.
*/
Please sign in to comment.
Something went wrong with that request. Please try again.