summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorGravatar waker <wakeroid@gmail.com>2013-08-30 20:19:26 +0200
committerGravatar waker <wakeroid@gmail.com>2013-08-30 20:19:26 +0200
commitd7f15ac7306a80fee78631d6ff2d736d125f6414 (patch)
treee1c84f28b483f489c9286087eb00763fb1259a54 /plugins
parent3ad91661619b579076f32ce6c1727c3eb176adde (diff)
moved all copies of strdupa macro to strdupa.h
Diffstat (limited to 'plugins')
-rw-r--r--plugins/converter/converter.c11
-rw-r--r--plugins/ffmpeg/ffmpeg.c1
-rw-r--r--plugins/gtkui/hotkeys.c11
-rw-r--r--plugins/gtkui/widgets.c10
4 files changed, 4 insertions, 29 deletions
diff --git a/plugins/converter/converter.c b/plugins/converter/converter.c
index d0f4b2eb..e26e7e6b 100644
--- a/plugins/converter/converter.c
+++ b/plugins/converter/converter.c
@@ -34,16 +34,7 @@
#include <unistd.h>
#include "converter.h"
#include "../../deadbeef.h"
-
-#ifndef strdupa
-# define strdupa(s) \
- ({ \
- const char *old = (s); \
- size_t len = strlen (old) + 1; \
- char *new = (char *) alloca (len); \
- (char *) memcpy (new, old, len); \
- })
-#endif
+#include "../../strdupa.h"
#ifndef __linux__
#define O_LARGEFILE 0
diff --git a/plugins/ffmpeg/ffmpeg.c b/plugins/ffmpeg/ffmpeg.c
index 160f2d33..41d75d53 100644
--- a/plugins/ffmpeg/ffmpeg.c
+++ b/plugins/ffmpeg/ffmpeg.c
@@ -24,6 +24,7 @@
#include <errno.h>
#include "../../deadbeef.h"
+#include "../../strdupa.h"
#if !FFMPEG_OLD
diff --git a/plugins/gtkui/hotkeys.c b/plugins/gtkui/hotkeys.c
index 4b7ac034..a34fb629 100644
--- a/plugins/gtkui/hotkeys.c
+++ b/plugins/gtkui/hotkeys.c
@@ -61,16 +61,7 @@ typedef struct
#include <X11/Xlib.h> // only for the KeySym type
#endif
#include "hotkeys.h"
-
-#ifndef strdupa
-# define strdupa(s) \
- ({ \
- const char *old = (s); \
- size_t len = strlen (old) + 1; \
- char *new = (char *) alloca (len); \
- (char *) memcpy (new, old, len); \
- })
-#endif
+#include "../../strdupa.h"
void
on_hotkeys_actions_cursor_changed (GtkTreeView *treeview,
diff --git a/plugins/gtkui/widgets.c b/plugins/gtkui/widgets.c
index 7318d894..e15fa0a4 100644
--- a/plugins/gtkui/widgets.c
+++ b/plugins/gtkui/widgets.c
@@ -37,19 +37,11 @@
#endif
#include "namedicons.h"
#include "hotkeys.h" // for building action treeview
+#include "../../strdupa.h"
#define min(x,y) ((x)<(y)?(x):(y))
#define max(x,y) ((x)>(y)?(x):(y))
-#ifndef strdupa
-# define strdupa(s) \
- ({ \
- const char *old = (s); \
- size_t len = strlen (old) + 1; \
- char *new = (char *) alloca (len); \
- (char *) memcpy (new, old, len); \
- })
-#endif
// utility code for parsing keyvalues
#define get_keyvalue(s,key,val) {\