common.h: use __func__ instead of __FUNCTION__

For increased portability.

The former is in C99, the latter is from gcc.
This commit is contained in:
Kelvin M. Klann 2023-06-17 15:09:35 -03:00
parent 1989a0f46a
commit e06c3e99d8

View file

@ -32,12 +32,16 @@
#include <ctype.h>
#include <assert.h>
#if !defined(__func__) && defined(__FUNCTION__)
#define __func__ __FUNCTION__
#endif
// dbus proxy path used by firejail and firemon
#define XDG_DBUS_PROXY_PATH "/usr/bin/xdg-dbus-proxy"
#define errExit(msg) do { \
char msgout[500]; \
snprintf(msgout, 500, "Error %s: %s:%d %s", msg, __FILE__, __LINE__, __FUNCTION__); \
snprintf(msgout, 500, "Error %s: %s:%d %s", msg, __FILE__, __LINE__, __func__); \
perror(msgout); \
exit(1); \
} while (0)