summaryrefslogtreecommitdiff
path: root/pkg/alsa-utils/patch/0003-Use-__func__-instead-of-__FUNCTION__.patch
diff options
context:
space:
mode:
authorMichael Forney <mforney@mforney.org>2019-07-02 00:28:05 -0700
committerMichael Forney <mforney@mforney.org>2019-07-03 00:53:07 -0700
commit55680dadfb6a5c9c5d728e67d674153af6c781e0 (patch)
tree0fba3c83bf9f07a61c392e5a023d2a25dcc7c6bf /pkg/alsa-utils/patch/0003-Use-__func__-instead-of-__FUNCTION__.patch
parenta8c0e988fb2b1a636d2828fc3b81141cc4d3c0f2 (diff)
alsa-utils: Fix a few portability issues
Diffstat (limited to 'pkg/alsa-utils/patch/0003-Use-__func__-instead-of-__FUNCTION__.patch')
-rw-r--r--pkg/alsa-utils/patch/0003-Use-__func__-instead-of-__FUNCTION__.patch65
1 files changed, 65 insertions, 0 deletions
diff --git a/pkg/alsa-utils/patch/0003-Use-__func__-instead-of-__FUNCTION__.patch b/pkg/alsa-utils/patch/0003-Use-__func__-instead-of-__FUNCTION__.patch
new file mode 100644
index 00000000..85b2d26d
--- /dev/null
+++ b/pkg/alsa-utils/patch/0003-Use-__func__-instead-of-__FUNCTION__.patch
@@ -0,0 +1,65 @@
+From a0d257af5b6e2ecdc1300263b232a7829b3e5f3e Mon Sep 17 00:00:00 2001
+From: Michael Forney <mforney@mforney.org>
+Date: Mon, 1 Jul 2019 23:44:21 -0700
+Subject: [PATCH] Use __func__ instead of __FUNCTION__
+
+They are equivalent, but __func__ is in C99. __FUNCTION__ exists only
+for backwards compatibility with old gcc versions.
+
+Signed-off-by: Michael Forney <mforney@mforney.org>
+---
+ alsactl/alsactl.h | 16 ++++++++--------
+ aplay/aplay.c | 4 ++--
+ 2 files changed, 10 insertions(+), 10 deletions(-)
+
+diff --git a/alsactl/alsactl.h b/alsactl/alsactl.h
+index 4f969ec..69b539c 100644
+--- a/alsactl/alsactl.h
++++ b/alsactl/alsactl.h
+@@ -13,15 +13,15 @@ void cerror_(const char *fcn, long line, int cond, const char *fmt, ...);
+ void dbg_(const char *fcn, long line, const char *fmt, ...);
+
+ #if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95)
+-#define info(...) do { info_(__FUNCTION__, __LINE__, __VA_ARGS__); } while (0)
+-#define error(...) do { error_(__FUNCTION__, __LINE__, __VA_ARGS__); } while (0)
+-#define cerror(cond, ...) do { cerror_(__FUNCTION__, __LINE__, (cond) != 0, __VA_ARGS__); } while (0)
+-#define dbg(...) do { dbg_(__FUNCTION__, __LINE__, __VA_ARGS__); } while (0)
++#define info(...) do { info_(__func__, __LINE__, __VA_ARGS__); } while (0)
++#define error(...) do { error_(__func__, __LINE__, __VA_ARGS__); } while (0)
++#define cerror(cond, ...) do { cerror_(__func__, __LINE__, (cond) != 0, __VA_ARGS__); } while (0)
++#define dbg(...) do { dbg_(__func__, __LINE__, __VA_ARGS__); } while (0)
+ #else
+-#define info(args...) do { info_(__FUNCTION__, __LINE__, ##args); } while (0)
+-#define error(args...) do { error_(__FUNCTION__, __LINE__, ##args); } while (0)
+-#define cerror(cond, ...) do { error_(__FUNCTION__, __LINE__, (cond) != 0, ##args); } while (0)
+-#define dbg(args...) do { dbg_(__FUNCTION__, __LINE__, ##args); } while (0)
++#define info(args...) do { info_(__func__, __LINE__, ##args); } while (0)
++#define error(args...) do { error_(__func__, __LINE__, ##args); } while (0)
++#define cerror(cond, ...) do { error_(__func__, __LINE__, (cond) != 0, ##args); } while (0)
++#define dbg(args...) do { dbg_(__func__, __LINE__, ##args); } while (0)
+ #endif
+
+ int init(const char *file, const char *cardname);
+diff --git a/aplay/aplay.c b/aplay/aplay.c
+index 33e0f77..ecfc8b8 100644
+--- a/aplay/aplay.c
++++ b/aplay/aplay.c
+@@ -184,13 +184,13 @@ static const struct fmt_capture {
+
+ #if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95)
+ #define error(...) do {\
+- fprintf(stderr, "%s: %s:%d: ", command, __FUNCTION__, __LINE__); \
++ fprintf(stderr, "%s: %s:%d: ", command, __func__, __LINE__); \
+ fprintf(stderr, __VA_ARGS__); \
+ putc('\n', stderr); \
+ } while (0)
+ #else
+ #define error(args...) do {\
+- fprintf(stderr, "%s: %s:%d: ", command, __FUNCTION__, __LINE__); \
++ fprintf(stderr, "%s: %s:%d: ", command, __func__, __LINE__); \
+ fprintf(stderr, ##args); \
+ putc('\n', stderr); \
+ } while (0)
+--
+2.22.0
+