]> git.alsa-project.org Git - alsa-utils.git/commitdiff
Use __func__ instead of __FUNCTION__
authorMichael Forney <mforney@mforney.org>
Wed, 5 Feb 2020 08:12:18 +0000 (00:12 -0800)
committerTakashi Iwai <tiwai@suse.de>
Mon, 10 Feb 2020 11:38:28 +0000 (12:38 +0100)
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>
Reviewd-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
alsactl/alsactl.h
aplay/aplay.c

index 4f969ec2a4bc01cfdf992be5621ef29e512b0eb2..69b539ca6be04f22ccfe138c5ea9c8d1e315a6f2 100644 (file)
@@ -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);
index 1a887e412aae062c6607df1918657eceea57d2fa..908093c45c9046aaba5c2303462da82cc7c99b81 100644 (file)
@@ -186,13 +186,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)