pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/devel/glib2 Fix use glib with c++ compilers that defin...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/6c2a797369a7
branches:  trunk
changeset: 405738:6c2a797369a7
user:      nros <nros%pkgsrc.org@localhost>
date:      Fri Dec 06 14:36:58 2019 +0000

description:
Fix use glib with c++ compilers that define __STDC_VERSION__

Some c++ compilers define __STDC_VERSION__ but don't provide _Static_assert
This causes usage of glib to break on these compilers.

diffstat:

 devel/glib2/distinfo                     |   3 ++-
 devel/glib2/patches/patch-glib_gmacros.h |  14 ++++++++++++++
 2 files changed, 16 insertions(+), 1 deletions(-)

diffs (35 lines):

diff -r 8425cd752785 -r 6c2a797369a7 devel/glib2/distinfo
--- a/devel/glib2/distinfo      Fri Dec 06 14:31:11 2019 +0000
+++ b/devel/glib2/distinfo      Fri Dec 06 14:36:58 2019 +0000
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.261 2019/11/28 18:11:48 jperkin Exp $
+$NetBSD: distinfo,v 1.262 2019/12/06 14:36:58 nros Exp $
 
 SHA1 (glib-2.62.3.tar.xz) = a8970ea4a9fbaf3050172d63f17372ead2894798
 RMD160 (glib-2.62.3.tar.xz) = 1aca0cf7e3a64e18eeea3d928e15280062a06f55
@@ -16,6 +16,7 @@
 SHA1 (patch-glib_gatomic.c) = 875ad9c828dcf2add356d4988d14fb4f1985aef8
 SHA1 (patch-glib_gatomic.h) = 21294cac483c3379198283c54fe6e24af3e630b1
 SHA1 (patch-glib_glibconfig.h.in) = 1964b5fb15317e681dad426d4862e3f48c4274f7
+SHA1 (patch-glib_gmacros.h) = 641107ccb6b285c472ed6cb337e53e4764f8d6a8
 SHA1 (patch-glib_gmain.c) = b361e4f7fa285c1d9317468c2b1be390e8190e8b
 SHA1 (patch-glib_gtypes.h) = a659b770c55a8071a6e6afd8a9fccdf723e086e6
 SHA1 (patch-glib_meson.build) = bc429f6537c6dd5fa99137c35c0627a97d48a850
diff -r 8425cd752785 -r 6c2a797369a7 devel/glib2/patches/patch-glib_gmacros.h
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/devel/glib2/patches/patch-glib_gmacros.h  Fri Dec 06 14:36:58 2019 +0000
@@ -0,0 +1,14 @@
+$NetBSD: patch-glib_gmacros.h,v 1.1 2019/12/06 14:36:58 nros Exp $
+* on some compilers __STDC_VERSION__ is defined when using c++
+  but _Static_assert is not available
+--- glib/gmacros.h.orig        2019-12-06 12:21:18.948881370 +0000
++++ glib/gmacros.h
+@@ -734,7 +734,7 @@
+ #ifndef __GI_SCANNER__ /* The static assert macro really confuses the introspection parser */
+ #define G_PASTE_ARGS(identifier1,identifier2) identifier1 ## identifier2
+ #define G_PASTE(identifier1,identifier2)      G_PASTE_ARGS (identifier1, identifier2)
+-#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L
++#if defined(__STDC_VERSION__) && !defined(__cplusplus) && __STDC_VERSION__ >= 201112L
+ #define G_STATIC_ASSERT(expr) _Static_assert (expr, "Expression evaluates to false")
+ #elif (defined(__cplusplus) && __cplusplus >= 201103L) || \
+       (defined(__cplusplus) && defined (_MSC_VER) && (_MSC_VER >= 1600)) || \



Home | Main Index | Thread Index | Old Index