pkgsrc-WIP-changes archive

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

lang/gcc16: Guard Linux-only open(2) flags with #ifdef for NetBSD portability



Module Name:	pkgsrc-wip
Committed By:	ci4ic4 <ci4ic4%gmail.com@localhost>
Pushed By:	ci4ic4
Date:		Wed May 20 22:42:59 2026 +0100
Changeset:	8871be4574255cb085b7039e53ed213d25cd0962

Added Files:
	gcc16/patches/patch-libgcobol_posix_shim_open.cc

Log Message:
lang/gcc16: Guard Linux-only open(2) flags with #ifdef for NetBSD portability

Adds patch to libgcobol/posix/shim/open.cc to wrap O_DIRECT, O_LARGEFILE,
O_NOATIME, O_PATH and O_TMPFILE in #ifdef guards; these flags are
Linux-specific and not defined on NetBSD.

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=8871be4574255cb085b7039e53ed213d25cd0962

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 gcc16/patches/patch-libgcobol_posix_shim_open.cc | 35 ++++++++++++++++++++++++
 1 file changed, 35 insertions(+)

diffs:
diff --git a/gcc16/patches/patch-libgcobol_posix_shim_open.cc b/gcc16/patches/patch-libgcobol_posix_shim_open.cc
new file mode 100644
index 0000000000..3fc4a35b6f
--- /dev/null
+++ b/gcc16/patches/patch-libgcobol_posix_shim_open.cc
@@ -0,0 +1,35 @@
+$NetBSD$
+
+Guard Linux-specific open(2) flags (O_DIRECT, O_LARGEFILE, O_NOATIME,
+O_PATH, O_TMPFILE) with #ifdef so libgcobol builds on NetBSD, where
+these flags are not defined.
+
+
+--- libgcobol/posix/shim/open.cc.ORIG	2026-04-30 09:33:28.000000000 +0100
++++ libgcobol/posix/shim/open.cc	2026-05-11 11:31:52.302652073 +0100
+@@ -29,15 +29,25 @@
+     { cbl::PSX_O_APPEND, O_APPEND },
+     { cbl::PSX_O_NONBLOCK, O_NONBLOCK },
+     { cbl::PSX_O_DSYNC, O_DSYNC },
++#ifdef O_DIRECT
+     { cbl::PSX_O_DIRECT, O_DIRECT },
++#endif
++#ifdef O_LARGEFILE
+     { cbl::PSX_O_LARGEFILE, O_LARGEFILE },
++#endif
+     { cbl::PSX_O_DIRECTORY, O_DIRECTORY },
+     { cbl::PSX_O_NOFOLLOW, O_NOFOLLOW },
++#ifdef O_NOATIME
+     { cbl::PSX_O_NOATIME, O_NOATIME },
++#endif
+     { cbl::PSX_O_CLOEXEC, O_CLOEXEC },
+     { cbl::PSX_O_SYNC, O_SYNC },
++#ifdef O_PATH
+     { cbl::PSX_O_PATH, O_PATH },
++#endif
++#ifdef O_TMPFILE
+     { cbl::PSX_O_TMPFILE, O_TMPFILE },
++#endif
+   };
+ 
+   static const std::map<int, int> mode_bits {


Home | Main Index | Thread Index | Old Index