blob: 763d5ce539fabb8d434575d92e837789ffd485ff [file] [log] [blame]
Patrick Williams7784c422022-11-17 07:29:11 -06001From 7dc19632f3115e3f517c6bc80436fe72c1dcdeb4 Mon Sep 17 00:00:00 2001
2From: =?UTF-8?q?Marco=20Trevisan=20=28Trevi=C3=B1o=29?= <mail@3v1n0.net>
3Date: Sat, 29 Oct 2022 04:16:00 +0200
4Subject: [PATCH] glib/tests/cxx: Ensure NULL is always casted to a pointer
5 type
6
7Otherwise it may not be recognized as valid sentinel
8Upstream-Status: Backport [https://gitlab.gnome.org/GNOME/glib/-/commit/7dc19632f3115e3f517c6bc80436fe72c1dcdeb4]
9Signed-off-by: Alexander Kanavin <alex@linutronix.de>
10---
11 glib/tests/cxx.cpp | 4 ++++
12 1 file changed, 4 insertions(+)
13
14diff --git a/glib/tests/cxx.cpp b/glib/tests/cxx.cpp
15index 045457c6e2..aa5e0cb576 100644
16--- a/glib/tests/cxx.cpp
17+++ b/glib/tests/cxx.cpp
18@@ -186,7 +186,11 @@ test_steal_pointer (void)
19 int
20 main (int argc, char *argv[])
21 {
22+#if __cplusplus >= 201103L
23 g_test_init (&argc, &argv, NULL);
24+#else
25+ g_test_init (&argc, &argv, static_cast<void *>(NULL));
26+#endif
27
28 g_test_add_func ("/C++/typeof", test_typeof);
29 g_test_add_func ("/C++/atomic-pointer-compare-and-exchange", test_atomic_pointer_compare_and_exchange);
30--
31GitLab