From 9cb1bb0fb24be404734aeaf0f53e745cbea88355 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Thu, 27 May 2021 13:29:54 +0200 Subject: Add g_prefix_error_literal() Because sometimes you don't want a lone "%s", and you don't want the compiler yelling at you about format strings that don't have any format in them. Closes #663 --- glib/gerror.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'glib/gerror.h') diff --git a/glib/gerror.h b/glib/gerror.h index 6431d5b6c..bc9c03a91 100644 --- a/glib/gerror.h +++ b/glib/gerror.h @@ -244,6 +244,11 @@ void g_prefix_error (GError **err, const gchar *format, ...) G_GNUC_PRINTF (2, 3); +/* if (err) prefix the string to the ->message */ +GLIB_AVAILABLE_IN_2_70 +void g_prefix_error_literal (GError **err, + const gchar *prefix); + /* g_propagate_error then g_error_prefix on dest */ GLIB_AVAILABLE_IN_ALL void g_propagate_prefixed_error (GError **dest, -- cgit v1.2.1