[glib/gio-thumbnail-sizes: 4/14] gio-launch-desktop: Fix the G_STATIC_ASSERT expressions for clang
- From: Marco Trevisan <marcotrevi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib/gio-thumbnail-sizes: 4/14] gio-launch-desktop: Fix the G_STATIC_ASSERT expressions for clang
- Date: Tue, 11 Oct 2022 18:54:49 +0000 (UTC)
commit 3723fda3d41eb92bf6041a7d4d3313bee30ee169
Author: Kjell Ahlstedt <kjellahlstedt gmail com>
Date: Thu Sep 15 12:55:18 2022 +0200
gio-launch-desktop: Fix the G_STATIC_ASSERT expressions for clang
The clang compiler requires the static_assert expression to be an integral
constant expression. `"text"` is not, but `sizeof "text"` is.
Fixes #2740
gio/gio-launch-desktop.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/gio/gio-launch-desktop.c b/gio/gio-launch-desktop.c
index 26b9ae1a14..47717b9873 100644
--- a/gio/gio-launch-desktop.c
+++ b/gio/gio-launch-desktop.c
@@ -121,8 +121,8 @@ journal_stream_fd (const char *identifier,
/* Arbitrary large size for the sending buffer, from systemd */
int large_buffer_size = 8 * 1024 * 1024;
- G_STATIC_ASSERT (LOG_EMERG == 0 && "Linux ABI defines LOG_EMERG");
- G_STATIC_ASSERT (LOG_DEBUG == 7 && "Linux ABI defines LOG_DEBUG");
+ G_STATIC_ASSERT (LOG_EMERG == 0 && sizeof "Linux ABI defines LOG_EMERG");
+ G_STATIC_ASSERT (LOG_DEBUG == 7 && sizeof "Linux ABI defines LOG_DEBUG");
fd = socket (AF_UNIX, SOCK_STREAM | SOCK_CLOEXEC, 0);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]