You've already forked macports-ports
mirror of
https://github.com/macports/macports-ports.git
synced 2026-07-12 18:20:25 -07:00
plotutils: Fix build with a C23 compiler
The configure script auto-enables -std=gnu23 when it's available, but the header that defines the boolean constants doesn't support C23, breaking compilation. Drop the unnecessary platforms line as suggested by 'port lint'.
This commit is contained in:
@@ -8,7 +8,6 @@ version 2.6
|
||||
revision 5
|
||||
conflicts bsd-plotutils
|
||||
categories graphics
|
||||
platforms darwin
|
||||
maintainers {snc @nerdling} openmaintainer
|
||||
license GPL-3+
|
||||
|
||||
@@ -30,7 +29,8 @@ checksums rmd160 2a32244eb20e00b82a0742dde7b690f688e82774 \
|
||||
size 3657562
|
||||
|
||||
patchfiles patch-configure.ac.diff \
|
||||
patch-libpng-1.5.diff
|
||||
patch-libpng-1.5.diff \
|
||||
patch-sys-defines.h-c23-compat.diff
|
||||
|
||||
use_autoreconf yes
|
||||
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
Do not redefine bool constants in C23
|
||||
|
||||
C23 now includes predefined constants for the boolean values true and
|
||||
false, and attempting to redefine them ends with a compiler error. Avoid
|
||||
doing that by adjusting the preprocessor guard around that.
|
||||
|
||||
Upstream-Status: Submitted [email]
|
||||
--- include/sys-defines.h.orig 2026-04-13 22:50:46
|
||||
+++ include/sys-defines.h 2026-04-13 22:53:57
|
||||
@@ -253,7 +253,7 @@
|
||||
/* Support the `bool' datatype, which is used widely in this package. */
|
||||
/**************************************************************************/
|
||||
|
||||
-#ifndef __cplusplus
|
||||
+#if !defined(__cplusplus) && (!defined(__STDC_VERSION__) || __STDC_VERSION__ < 202311L)
|
||||
#ifdef __STDC__
|
||||
typedef enum { false = 0, true = 1 } bool;
|
||||
#else /* not __STDC__, do things the old-fashioned way */
|
||||
@@ -261,7 +261,7 @@
|
||||
#define false 0
|
||||
#define true 1
|
||||
#endif /* not __STDC__ */
|
||||
-#endif /* not __cplusplus */
|
||||
+#endif /* not __cplusplus and (not __STDC_VERSION__ or __STDC_VERSION__ < 202311L) */
|
||||
|
||||
/**************************************************************************/
|
||||
/* Define numerical constants (unofficial, so may not be in math.h). */
|
||||
Reference in New Issue
Block a user