git: 6084a7f53724 - main - graphics/libfreehand: fix build with clang 16

From: Dimitry Andric <dim_at_FreeBSD.org>
Date: Sun, 14 May 2023 19:29:18 UTC
The branch main has been updated by dim:

URL: https://cgit.FreeBSD.org/ports/commit/?id=6084a7f537241a5936d76883a9638571bb9c102c

commit 6084a7f537241a5936d76883a9638571bb9c102c
Author:     Dimitry Andric <dim@FreeBSD.org>
AuthorDate: 2023-05-14 17:55:47 +0000
Commit:     Dimitry Andric <dim@FreeBSD.org>
CommitDate: 2023-05-14 19:26:54 +0000

    graphics/libfreehand: fix build with clang 16
    
    Since clang 16 (and gcc 11) the default C++ standard is now gnu++17.
    Because graphics/libfreehand's configure scripts and Makefiles do not
    explicitly set the C++ standard, this leads to several errors:
    
      In file included from FreeHandDocument.cpp:14:
      In file included from ./FHParser.h:15:
      /usr/local/include/lcms2.h:1291:44: error: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
      typedef cmsInt32Number (* cmsSAMPLER16)   (CMSREGISTER const cmsUInt16Number In[],
                                                 ^~~~~~~~~~~~
      /usr/local/include/lcms2.h:158:23: note: expanded from macro 'CMSREGISTER'
      #  define CMSREGISTER register
                            ^
      /usr/local/include/lcms2.h:1292:44: error: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
                                                 CMSREGISTER cmsUInt16Number Out[],
                                                 ^~~~~~~~~~~~
      /usr/local/include/lcms2.h:158:23: note: expanded from macro 'CMSREGISTER'
      #  define CMSREGISTER register
                            ^
      /usr/local/include/lcms2.h:1293:44: error: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
                                                 CMSREGISTER void * Cargo);
                                                 ^~~~~~~~~~~~
      /usr/local/include/lcms2.h:158:23: note: expanded from macro 'CMSREGISTER'
      #  define CMSREGISTER register
                            ^
      /usr/local/include/lcms2.h:1295:44: error: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
      typedef cmsInt32Number (* cmsSAMPLERFLOAT)(CMSREGISTER const cmsFloat32Number In[],
                                                 ^~~~~~~~~~~~
      /usr/local/include/lcms2.h:158:23: note: expanded from macro 'CMSREGISTER'
      #  define CMSREGISTER register
                            ^
      /usr/local/include/lcms2.h:1296:44: error: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
                                                 CMSREGISTER cmsFloat32Number Out[],
                                                 ^~~~~~~~~~~~
      /usr/local/include/lcms2.h:158:23: note: expanded from macro 'CMSREGISTER'
      #  define CMSREGISTER register
                            ^
      /usr/local/include/lcms2.h:1297:44: error: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
                                                 CMSREGISTER void * Cargo);
                                                 ^~~~~~~~~~~~
      /usr/local/include/lcms2.h:158:23: note: expanded from macro 'CMSREGISTER'
      #  define CMSREGISTER register
                            ^
    
    Add -D CMS_NO_REGISTER_KEYWORD to CPPFLAGS, to avoid lcms2.h using
    register keywords in its declarations.
    
    PR:             271421
    Approved by:    sunpoet (maintainer)
    MFH:            2023Q2
---
 graphics/libfreehand/Makefile | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/graphics/libfreehand/Makefile b/graphics/libfreehand/Makefile
index 4ef08d8e943a..c02e1e7090e2 100644
--- a/graphics/libfreehand/Makefile
+++ b/graphics/libfreehand/Makefile
@@ -1,6 +1,6 @@
 PORTNAME=	libfreehand
 PORTVERSION=	0.1.2
-PORTREVISION=	25
+PORTREVISION=	26
 CATEGORIES=	graphics
 MASTER_SITES=	LODEV
 
@@ -22,6 +22,7 @@ USES=	compiler:c++11-lang gperf perl5 libtool pathfix pkgconfig tar:xz
 USE_LDCONFIG=	yes
 USE_PERL5=	build
 CONFIGURE_ARGS=	--disable-werror --without-docs
+CPPFLAGS+=	-D CMS_NO_REGISTER_KEYWORD
 CPPFLAGS+=	-I ${LOCALBASE}/include
 INSTALL_TARGET=	install-strip