diff options
author | Thomas Haller <thaller@redhat.com> | 2016-02-19 01:40:02 +0100 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2016-02-19 01:42:29 +0100 |
commit | 6d5e55870a00f44ab1421b5579ef8c309a7a615d (patch) | |
tree | 7c6f6d856593766fbbbd553aa560b54d3a799be5 | |
parent | 719742513705877f60a8b1cf69f393e5f4eed30f (diff) | |
download | NetworkManager-6d5e55870a00f44ab1421b5579ef8c309a7a615d.tar.gz |
shared: fix nm_sprintf_buf() macro to allow plain string
Use non-portable gcc extension to allow for zero variadic
arguments so that you can pass a plain string as argument.
-rw-r--r-- | shared/nm-macros-internal.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/shared/nm-macros-internal.h b/shared/nm-macros-internal.h index fb8ab2ceac..348f832cd8 100644 --- a/shared/nm-macros-internal.h +++ b/shared/nm-macros-internal.h @@ -429,7 +429,7 @@ nm_decode_version (guint version, guint *major, guint *minor, guint *micro) { * It disallows a buffer size of sizeof(gpointer) to catch that. */ \ G_STATIC_ASSERT (G_N_ELEMENTS (buf) == sizeof (buf) && sizeof (buf) != sizeof (char *)); \ g_snprintf (_buf, sizeof (buf), \ - ""format"", __VA_ARGS__); \ + ""format"", ##__VA_ARGS__); \ _buf; \ }) @@ -440,7 +440,7 @@ nm_decode_version (guint version, guint *major, guint *minor, guint *micro) { G_STATIC_ASSERT (sizeof (char[MAX ((n_elements), 1)]) == (n_elements)); \ _buf = g_alloca (n_elements); \ g_snprintf (_buf, n_elements, \ - ""format"", __VA_ARGS__); \ + ""format"", ##__VA_ARGS__); \ _buf; \ }) |