[glib: 2/7] glib-typeof: Define glib_typeof on on older C++ standard versions
- From: Philip Withnall <pwithnall src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib: 2/7] glib-typeof: Define glib_typeof on on older C++ standard versions
- Date: Wed, 12 Oct 2022 09:56:27 +0000 (UTC)
commit d050ad8a3c8bdb95a3e90b31205c753645bc831d
Author: Damjan Jovanovic <damjan jov gmail com>
Date: Mon Aug 22 17:18:23 2022 +0200
glib-typeof: Define glib_typeof on on older C++ standard versions
When using an older C++ versions, the glib_typeof() macro is never
defined, as the C++ definition depends on __cplusplus >= 201103L, while the C
definition, which would work, depends on !defined(__cplusplus).
Allow old C++ versions to use the C macro definition for glib_typeof().
glib/glib-typeof.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/glib/glib-typeof.h b/glib/glib-typeof.h
index f00e2495df..ffc2a45c5c 100644
--- a/glib/glib-typeof.h
+++ b/glib/glib-typeof.h
@@ -34,7 +34,7 @@
* This symbol is private.
*/
#undef glib_typeof
-#if !defined(__cplusplus) && (G_GNUC_CHECK_VERSION(4, 8) || defined(__clang__))
+#if (!defined(__cplusplus) || __cplusplus < 201103L) && (G_GNUC_CHECK_VERSION(4, 8) || defined(__clang__))
#define glib_typeof(t) __typeof__ (t)
#elif defined(__cplusplus) && __cplusplus >= 201103L && GLIB_VERSION_MIN_REQUIRED >= GLIB_VERSION_2_68
/* C++11 decltype() is close enough for our usage */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]