summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLars-Dominik Braun <lars@6xq.net>2015-08-10 11:20:29 +0200
committerLars-Dominik Braun <lars@6xq.net>2015-08-10 11:20:29 +0200
commitbfe0583a1264e2b1467942ec33e1fa773d450d9b (patch)
treeaa7347636eddb765fec8c8b7af11456f7ce209c2 /src
parent3a196f51581ffca2d2a902e83a9b69ac4702316c (diff)
downloadpianobar-bfe0583a1264e2b1467942ec33e1fa773d450d9b.tar.gz
pianobar-bfe0583a1264e2b1467942ec33e1fa773d450d9b.tar.bz2
pianobar-bfe0583a1264e2b1467942ec33e1fa773d450d9b.zip
Move feature test macros to config.h
I removed most of the *BSD-related stuff, because I can’t test these. If this breaks your build, send me a patch please.
Diffstat (limited to 'src')
-rw-r--r--src/config.h3
-rw-r--r--src/libpiano/config.h1
-rw-r--r--src/libpiano/piano.c6
-rw-r--r--src/libpiano/piano.h2
-rw-r--r--src/libpiano/request.c5
-rw-r--r--src/libpiano/response.c5
-rw-r--r--src/main.c7
-rw-r--r--src/player.c4
-rw-r--r--src/player.h1
-rw-r--r--src/settings.c6
-rw-r--r--src/ui.c6
-rw-r--r--src/ui_act.c2
12 files changed, 14 insertions, 34 deletions
diff --git a/src/config.h b/src/config.h
index bc1f2a1..788455c 100644
--- a/src/config.h
+++ b/src/config.h
@@ -6,6 +6,9 @@
#define VERSION "2014.09.28-dev"
+/* glibc feature test macros, define _before_ including other files */
+#define _POSIX_C_SOURCE 200809L
+
/* ffmpeg/libav quirks detection
* ffmpeg’s micro versions always start at 100, that’s how we can distinguish
* ffmpeg and libav */
diff --git a/src/libpiano/config.h b/src/libpiano/config.h
deleted file mode 100644
index febad25..0000000
--- a/src/libpiano/config.h
+++ /dev/null
@@ -1 +0,0 @@
-#define PACKAGE "libpiano"
diff --git a/src/libpiano/piano.c b/src/libpiano/piano.c
index b519f49..72502f7 100644
--- a/src/libpiano/piano.c
+++ b/src/libpiano/piano.c
@@ -21,10 +21,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
-#ifndef __FreeBSD__
-#define _BSD_SOURCE /* required by strdup() */
-#define _DARWIN_C_SOURCE /* strdup() on OS X */
-#endif
+#include "../config.h"
#include <stdio.h>
#include <string.h>
@@ -34,7 +31,6 @@ THE SOFTWARE.
#include "piano_private.h"
#include "piano.h"
-#include "config.h"
/* initialize piano handle
* @param piano handle
diff --git a/src/libpiano/piano.h b/src/libpiano/piano.h
index f0ba4cf..1a84d4a 100644
--- a/src/libpiano/piano.h
+++ b/src/libpiano/piano.h
@@ -24,6 +24,8 @@ THE SOFTWARE.
#ifndef SRC_LIBPIANO_PIANO_H_MFBT13PN
#define SRC_LIBPIANO_PIANO_H_MFBT13PN
+#include "../config.h"
+
#include <stdbool.h>
#ifdef __FreeBSD__
#define _GCRYPT_IN_LIBGCRYPT
diff --git a/src/libpiano/request.c b/src/libpiano/request.c
index 95ac2d0..02b4b43 100644
--- a/src/libpiano/request.c
+++ b/src/libpiano/request.c
@@ -21,10 +21,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
-#ifndef __FreeBSD__
-#define _BSD_SOURCE /* required by strdup() */
-#define _DARWIN_C_SOURCE /* strdup() on OS X */
-#endif
+#include "../config.h"
#include <curl/curl.h>
#include <json.h>
diff --git a/src/libpiano/response.c b/src/libpiano/response.c
index 542ef00..7f0cee0 100644
--- a/src/libpiano/response.c
+++ b/src/libpiano/response.c
@@ -21,10 +21,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
-#ifndef __FreeBSD__
-#define _BSD_SOURCE /* required by strdup() */
-#define _DARWIN_C_SOURCE /* strdup() on OS X */
-#endif
+#include "../config.h"
#include <json.h>
#include <string.h>
diff --git a/src/main.c b/src/main.c
index 59230e0..b113f4e 100644
--- a/src/main.c
+++ b/src/main.c
@@ -21,11 +21,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
-#ifndef __FreeBSD__
-#define _POSIX_C_SOURCE 1 /* fileno() */
-#define _BSD_SOURCE /* strdup() */
-#define _DARWIN_C_SOURCE /* strdup() on OS X */
-#endif
+#include "config.h"
/* system includes */
#include <stdlib.h>
@@ -56,7 +52,6 @@ THE SOFTWARE.
#include "main.h"
#include "terminal.h"
-#include "config.h"
#include "ui.h"
#include "ui_dispatch.h"
#include "ui_readline.h"
diff --git a/src/player.c b/src/player.c
index 856b555..0ba0f36 100644
--- a/src/player.c
+++ b/src/player.c
@@ -23,6 +23,8 @@ THE SOFTWARE.
/* receive/play audio stream */
+#include "config.h"
+
#include <unistd.h>
#include <string.h>
#include <math.h>
@@ -31,8 +33,6 @@ THE SOFTWARE.
#include <assert.h>
#include <arpa/inet.h>
-#include "config.h"
-
#include <libavcodec/avcodec.h>
#include <libavutil/avutil.h>
#include <libavfilter/avfilter.h>
diff --git a/src/player.h b/src/player.h
index b97f5b2..e4d9f5b 100644
--- a/src/player.h
+++ b/src/player.h
@@ -38,7 +38,6 @@ THE SOFTWARE.
#include <piano.h>
#include "settings.h"
-#include "config.h"
typedef struct {
/* protected by pauseMutex */
diff --git a/src/settings.c b/src/settings.c
index 334ee5a..11a2982 100644
--- a/src/settings.c
+++ b/src/settings.c
@@ -23,11 +23,7 @@ THE SOFTWARE.
/* application settings */
-#ifndef __FreeBSD__
-#define _POSIX_C_SOURCE 1 /* PATH_MAX */
-#define _BSD_SOURCE /* strdup() */
-#define _DARWIN_C_SOURCE /* strdup() on OS X */
-#endif
+#include "config.h"
#include <string.h>
#include <stdlib.h>
diff --git a/src/ui.c b/src/ui.c
index 91eb005..779dbf8 100644
--- a/src/ui.c
+++ b/src/ui.c
@@ -23,11 +23,7 @@ THE SOFTWARE.
/* everything that interacts with the user */
-#ifndef __FreeBSD__
-#define _POSIX_C_SOURCE 1 /* fileno() */
-#define _BSD_SOURCE /* strdup() */
-#define _DARWIN_C_SOURCE /* strdup() on OS X */
-#endif
+#include "config.h"
#include <stdio.h>
#include <stdarg.h>
diff --git a/src/ui_act.c b/src/ui_act.c
index 2555367..e8452e6 100644
--- a/src/ui_act.c
+++ b/src/ui_act.c
@@ -23,7 +23,7 @@ THE SOFTWARE.
/* functions responding to user's keystrokes */
-#define _BSD_SOURCE
+#include "config.h"
#include <string.h>
#include <unistd.h>