git: 1d042b735977 - main - graphics/libavif: unbreak build with Clang 13

From: Jan Beich <jbeich_at_FreeBSD.org>
Date: Wed, 10 Nov 2021 19:06:48 UTC
The branch main has been updated by jbeich:

URL: https://cgit.FreeBSD.org/ports/commit/?id=1d042b735977c6d3c5b163cf9e49651be06da63f

commit 1d042b735977c6d3c5b163cf9e49651be06da63f
Author:     Jan Beich <jbeich@FreeBSD.org>
AuthorDate: 2021-11-10 13:37:52 +0000
Commit:     Jan Beich <jbeich@FreeBSD.org>
CommitDate: 2021-11-10 19:06:01 +0000

    graphics/libavif: unbreak build with Clang 13
    
    In file included from /wrkdirs/usr/ports/graphics/libavif/work/libavif-0.9.2/contrib/gdk-pixbuf/loader.c:9:
    In file included from /usr/local/include/gdk-pixbuf-2.0/gdk-pixbuf/gdk-pixbuf-io.h:35:
    In file included from /usr/local/include/glib-2.0/glib.h:30:
    In file included from /usr/local/include/glib-2.0/glib/galloca.h:32:
    /usr/local/include/glib-2.0/glib/gtypes.h:458:24: error: identifier '_GLIB_CHECKED_ADD_U32' is reserved because it starts with '_' followed by a capital letter [-Werror,-Wreserved-identifier]
    static inline gboolean _GLIB_CHECKED_ADD_U32 (guint32 *dest, guint32 a, guint32 b) {
                           ^
    /usr/local/include/glib-2.0/glib/gtypes.h:460:24: error: identifier '_GLIB_CHECKED_MUL_U32' is reserved because it starts with '_' followed by a capital letter [-Werror,-Wreserved-identifier]
    static inline gboolean _GLIB_CHECKED_MUL_U32 (guint32 *dest, guint32 a, guint32 b) {
                           ^
    /usr/local/include/glib-2.0/glib/gtypes.h:462:24: error: identifier '_GLIB_CHECKED_ADD_U64' is reserved because it starts with '_' followed by a capital letter [-Werror,-Wreserved-identifier]
    static inline gboolean _GLIB_CHECKED_ADD_U64 (guint64 *dest, guint64 a, guint64 b) {
                           ^
    /usr/local/include/glib-2.0/glib/gtypes.h:463:3: warning: '_Static_assert' is a C11 extension [-Wc11-extensions]
      G_STATIC_ASSERT(sizeof (unsigned long long) == sizeof (guint64));
      ^
    /usr/local/include/glib-2.0/glib/gmacros.h:819:31: note: expanded from macro 'G_STATIC_ASSERT'
     #define G_STATIC_ASSERT(expr) _Static_assert (expr, "Expression evaluates to false")
                                   ^
    In file included from /wrkdirs/usr/ports/graphics/libavif/work/libavif-0.9.2/contrib/gdk-pixbuf/loader.c:9:
    In file included from /usr/local/include/gdk-pixbuf-2.0/gdk-pixbuf/gdk-pixbuf-io.h:35:
    In file included from /usr/local/include/glib-2.0/glib.h:30:
    In file included from /usr/local/include/glib-2.0/glib/galloca.h:32:
    /usr/local/include/glib-2.0/glib/gtypes.h:465:24: error: identifier '_GLIB_CHECKED_MUL_U64' is reserved because it starts with '_' followed by a capital letter [-Werror,-Wreserved-identifier]
    static inline gboolean _GLIB_CHECKED_MUL_U64 (guint64 *dest, guint64 a, guint64 b) {
                           ^
    /usr/local/include/glib-2.0/glib/gtypes.h:495:16: error: identifier '_GDoubleIEEE754' is reserved because it starts with '_' followed by a capital letter [-Werror,-Wreserved-identifier]
    typedef union  _GDoubleIEEE754  GDoubleIEEE754;
                   ^
    /usr/local/include/glib-2.0/glib/gtypes.h:496:16: error: identifier '_GFloatIEEE754' is reserved because it starts with '_' followed by a capital letter [-Werror,-Wreserved-identifier]
    typedef union  _GFloatIEEE754   GFloatIEEE754;
                   ^
    /usr/local/include/glib-2.0/glib/gtypes.h:545:16: error: identifier '_GTimeVal' is reserved because it starts with '_' followed by a capital letter [-Werror,-Wreserved-identifier]
    typedef struct _GTimeVal GTimeVal GLIB_DEPRECATED_TYPE_IN_2_62_FOR(GDateTime);
                   ^
    In file included from /wrkdirs/usr/ports/graphics/libavif/work/libavif-0.9.2/contrib/gdk-pixbuf/loader.c:9:
    In file included from /usr/local/include/gdk-pixbuf-2.0/gdk-pixbuf/gdk-pixbuf-io.h:35:
    In file included from /usr/local/include/glib-2.0/glib.h:31:
    /usr/local/include/glib-2.0/glib/garray.h:36:16: error: identifier '_GBytes' is reserved because it starts with '_' followed by a capital letter [-Werror,-Wreserved-identifier]
    typedef struct _GBytes          GBytes;
                   ^
    /usr/local/include/glib-2.0/glib/garray.h:37:16: error: identifier '_GArray' is reserved because it starts with '_' followed by a capital letter [-Werror,-Wreserved-identifier]
    typedef struct _GArray          GArray;
                   ^
    /usr/local/include/glib-2.0/glib/garray.h:38:16: error: identifier '_GByteArray' is reserved because it starts with '_' followed by a capital letter [-Werror,-Wreserved-identifier]
    typedef struct _GByteArray      GByteArray;
                   ^
    /usr/local/include/glib-2.0/glib/garray.h:39:16: error: identifier '_GPtrArray' is reserved because it starts with '_' followed by a capital letter [-Werror,-Wreserved-identifier]
    typedef struct _GPtrArray       GPtrArray;
                   ^
    In file included from /wrkdirs/usr/ports/graphics/libavif/work/libavif-0.9.2/contrib/gdk-pixbuf/loader.c:9:
    In file included from /usr/local/include/gdk-pixbuf-2.0/gdk-pixbuf/gdk-pixbuf-io.h:35:
    In file included from /usr/local/include/glib-2.0/glib.h:32:
    In file included from /usr/local/include/glib-2.0/glib/gasyncqueue.h:32:
    In file included from /usr/local/include/glib-2.0/glib/gthread.h:33:
    /usr/local/include/glib-2.0/glib/gerror.h:41:16: error: identifier '_GError' is reserved because it starts with '_' followed by a capital letter [-Werror,-Wreserved-identifier]
    typedef struct _GError GError;
                   ^
    In file included from /wrkdirs/usr/ports/graphics/libavif/work/libavif-0.9.2/contrib/gdk-pixbuf/loader.c:9:
    In file included from /usr/local/include/gdk-pixbuf-2.0/gdk-pixbuf/gdk-pixbuf-io.h:35:
    In file included from /usr/local/include/glib-2.0/glib.h:32:
    In file included from /usr/local/include/glib-2.0/glib/gasyncqueue.h:32:
    In file included from /usr/local/include/glib-2.0/glib/gthread.h:34:
    /usr/local/include/glib-2.0/glib/gutils.h:274:16: error: identifier '_GDebugKey' is reserved because it starts with '_' followed by a capital letter [-Werror,-Wreserved-identifier]
    typedef struct _GDebugKey GDebugKey;
                   ^
    In file included from /wrkdirs/usr/ports/graphics/libavif/work/libavif-0.9.2/contrib/gdk-pixbuf/loader.c:9:
    In file included from /usr/local/include/gdk-pixbuf-2.0/gdk-pixbuf/gdk-pixbuf-io.h:35:
    In file included from /usr/local/include/glib-2.0/glib.h:32:
    In file included from /usr/local/include/glib-2.0/glib/gasyncqueue.h:32:
    /usr/local/include/glib-2.0/glib/gthread.h:49:16: error: identifier '_GThread' is reserved because it starts with '_' followed by a capital letter [-Werror,-Wreserved-identifier]
    typedef struct _GThread         GThread;
                   ^
    /usr/local/include/glib-2.0/glib/gthread.h:51:16: error: identifier '_GMutex' is reserved because it starts with '_' followed by a capital letter [-Werror,-Wreserved-identifier]
    typedef union  _GMutex          GMutex;
                   ^
    /usr/local/include/glib-2.0/glib/gthread.h:52:16: error: identifier '_GRecMutex' is reserved because it starts with '_' followed by a capital letter [-Werror,-Wreserved-identifier]
    typedef struct _GRecMutex       GRecMutex;
                   ^
    /usr/local/include/glib-2.0/glib/gthread.h:53:16: error: identifier '_GRWLock' is reserved because it starts with '_' followed by a capital letter [-Werror,-Wreserved-identifier]
    typedef struct _GRWLock         GRWLock;
                   ^
    /usr/local/include/glib-2.0/glib/gthread.h:54:16: error: identifier '_GCond' is reserved because it starts with '_' followed by a capital letter [-Werror,-Wreserved-identifier]
    typedef struct _GCond           GCond;
                   ^
    /usr/local/include/glib-2.0/glib/gthread.h:55:16: error: identifier '_GPrivate' is reserved because it starts with '_' followed by a capital letter [-Werror,-Wreserved-identifier]
    typedef struct _GPrivate        GPrivate;
                   ^
    fatal error: too many errors emitted, stopping now [-ferror-limit=]
    
    Reported by:    antoine (via bug 258209 exp-run)
---
 graphics/libavif/Makefile | 1 +
 graphics/libavif/distinfo | 2 ++
 2 files changed, 3 insertions(+)

diff --git a/graphics/libavif/Makefile b/graphics/libavif/Makefile
index ef42dc4b06d7..30a6588d8e41 100644
--- a/graphics/libavif/Makefile
+++ b/graphics/libavif/Makefile
@@ -5,6 +5,7 @@ CATEGORIES=	graphics
 
 PATCH_SITES=	https://github.com/${GH_ACCOUNT}/${GH_PROJECT}/commit/
 PATCHFILES+=	2340cdb5f0c2.patch:-p1 # https://github.com/AOMediaCodec/libavif/pull/296
+PATCHFILES+=	dce4c2a5f4bb.patch:-p1 # https://github.com/AOMediaCodec/libavif/pull/783
 
 MAINTAINER=	jbeich@FreeBSD.org
 COMMENT=	Library for encoding and decoding .avif files
diff --git a/graphics/libavif/distinfo b/graphics/libavif/distinfo
index ebcf89370a08..fde5e928859c 100644
--- a/graphics/libavif/distinfo
+++ b/graphics/libavif/distinfo
@@ -3,3 +3,5 @@ SHA256 (AOMediaCodec-libavif-v0.9.3_GH0.tar.gz) = bcd9a1f57f982a9615eb7e2faf8723
 SIZE (AOMediaCodec-libavif-v0.9.3_GH0.tar.gz) = 2000521
 SHA256 (2340cdb5f0c2.patch) = acc0733963b7e1c9f4bb3563b052a15aff6705729ae08a50123f7a0d537396e5
 SIZE (2340cdb5f0c2.patch) = 1714
+SHA256 (dce4c2a5f4bb.patch) = a516cbcce0d93791ed9e5bfa3eb6f21d3e05d2e725852698089f0a138cda2b39
+SIZE (dce4c2a5f4bb.patch) = 1471