]> git.ipfire.org Git - thirdparty/dbus.git/commitdiff
dbus-spawn-win: use `_DBUS_FUNCTION_NAME` instead of `__FUNCTION__`
authorBarnabás Pőcze <pobrn@protonmail.com>
Thu, 4 May 2023 14:37:57 +0000 (16:37 +0200)
committerSimon McVittie <smcv@collabora.com>
Mon, 5 Jun 2023 18:58:49 +0000 (19:58 +0100)
dbus-internals.h already defines a macro which expands to the name
of the current function based on C standard version, etc. So use
that instead of hard-coding `__FUNCTION__`.

Signed-off-by: Barnabás Pőcze <pobrn@protonmail.com>
dbus/dbus-spawn-win.c

index 61961901d28f2c7491ae53fb30ff8e86daac9cc7..598ffabb572cfccb3fc22b8cbcf5ccc08e705554 100644 (file)
@@ -5,7 +5,7 @@
 #if !defined(SPAWN_DEBUG) || defined(_MSC_VER)
 #define PING()
 #else
-#define PING() fprintf (stderr, "%s:%s:%d\n", __FILE__, __FUNCTION__, __LINE__); fflush (stderr)
+#define PING() fprintf (stderr, "%s:%s:%d\n", __FILE__, _DBUS_FUNCTION_NAME, __LINE__); fflush (stderr)
 #endif
 
 #include <stdio.h>
@@ -105,7 +105,7 @@ _dbus_babysitter_new (void)
 
   old_refcount = _dbus_atomic_inc (&sitter->refcount);
 
-  _dbus_babysitter_trace_ref (sitter, old_refcount, old_refcount+1, __FUNCTION__);
+  _dbus_babysitter_trace_ref (sitter, old_refcount, old_refcount+1, _DBUS_FUNCTION_NAME);
 
   sitter->child_handle = NULL;
 
@@ -139,7 +139,7 @@ _dbus_babysitter_ref (DBusBabysitter *sitter)
 
   old_refcount = _dbus_atomic_inc (&sitter->refcount);
   _dbus_assert (old_refcount > 0);
-  _dbus_babysitter_trace_ref (sitter, old_refcount, old_refcount+1, __FUNCTION__);
+  _dbus_babysitter_trace_ref (sitter, old_refcount, old_refcount+1, _DBUS_FUNCTION_NAME);
 
   return sitter;
 }
@@ -180,7 +180,7 @@ _dbus_babysitter_unref (DBusBabysitter *sitter)
 
   old_refcount = _dbus_atomic_dec (&sitter->refcount);
   _dbus_assert (old_refcount > 0);
-  _dbus_babysitter_trace_ref (sitter, old_refcount, old_refcount-1, __FUNCTION__);
+  _dbus_babysitter_trace_ref (sitter, old_refcount, old_refcount-1, _DBUS_FUNCTION_NAME);
 
   if (old_refcount == 1)
     {