Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
ce10d42
fdopendir.c: Fix typo in comment.
fhgwright May 9, 2026
5e595c6
Use __MPLS_TARGET_OSVER in most cases.
fhgwright Jun 8, 2026
2e812f5
USB.h: Fix gcc version threshold.
fhgwright May 9, 2026
bd27c46
Verbatim checkin of Apple's 10.4 Xplugin.h
fhgwright May 10, 2026
af89ffa
Xplugin.h: Provide missing 10.4 version.
fhgwright May 10, 2026
4a4aa19
test_xplugin: New test.
fhgwright May 10, 2026
699f74c
allheaders: Exempt Xplugin.h
fhgwright Jun 12, 2026
1e8931a
Add CFStringCreateWithBytesNoCopy proto for 10.4.
fhgwright May 8, 2026
47764b1
test_cfstring: New test.
fhgwright Jun 11, 2026
b9800f1
mach/port.h: Fix missing _Static_assert() cases.
fhgwright May 21, 2026
033d3b9
test_static_assert: New test.
fhgwright May 21, 2026
838ef82
sdkversion.h: Add more version undefs.
fhgwright Jun 7, 2026
50f26e7
Make 10.4 context names look like 10.5+.
fhgwright May 25, 2026
670113e
dirent.h: Add DIR element aliases for 10.4.
fhgwright Jun 8, 2026
8cb329d
Remove obsolete __dd macros.
fhgwright Jun 8, 2026
96a60ad
Support _DARWIN_C_SOURCE in 10.4 in some headers.
fhgwright Jun 8, 2026
407bc8e
Makefile: Add *_all_unv targets.
fhgwright May 29, 2026
c80f86a
Add test for _DARWIN_C_SOURCE in updated headers.
fhgwright Jun 3, 2026
495dd3a
test_contexts: New test.
fhgwright Jun 5, 2026
9f5d37d
runnablearchs.sh: Update comments.
fhgwright May 24, 2026
ba4bcd7
Import needed Apple 10.4 signal-related sources verbatim.
fhgwright Jun 9, 2026
e7eeeb1
Move Apple signal sources into the library sources.
fhgwright Jun 9, 2026
679a769
sigtramp.c: Fix 10.4 ppc64 signal bugs.
fhgwright Jun 10, 2026
12f0764
test_signals: New test.
fhgwright Jun 11, 2026
d1ea415
sigtramp.c: Allow building with 10.5 SDK.
fhgwright Jun 12, 2026
498e589
test_dirent: Add tests for DIR field names.
fhgwright Jun 13, 2026
a8b2fef
gliDispatch.h: Use newer SDK version method.
fhgwright Jun 14, 2026
5d69a68
gliDispatch.h: Add version for AGL.
fhgwright Jun 14, 2026
790d38e
Import needed Apple 10.4 OpenGL+AGL gl.h source verbatim.
fhgwright Jun 14, 2026
cd71f49
OpenGL/gl.h: Make types consistent with 10.5+.
fhgwright Jun 14, 2026
a61e5a1
OpenGL/gl.h: Add wrapper/substitution headers.
fhgwright Jun 14, 2026
b1e9574
test_opengl_ints*: New tests.
fhgwright Jun 14, 2026
23c948e
Enhance checksdkversion, now called checkversions.
fhgwright Jun 16, 2026
6da4634
Fix OS version spoofing on 11.x+
fhgwright Jun 16, 2026
981e240
CommonDigest.h: Add definitions missing from 10.4.
fhgwright Jun 16, 2026
45560cb
CommonDigest.h: Convert macros to 10.6+ argless form.
fhgwright Jun 16, 2026
b5c21d4
test_digests: New test.
fhgwright Jun 16, 2026
64deb2f
test_digests: Add tests for taking pointers to functions.
fhgwright Jun 17, 2026
b3f36a9
sdkversion.h: Update for SDK 27.
fhgwright Jun 17, 2026
cc2802c
TargetConditionals.h: Work around false "kernelkit" in SDK 27.
fhgwright Jun 17, 2026
2aa311a
TargetConditionals.h: Limit "kernelkit" hack to SDK 27+.
fhgwright Jun 18, 2026
58a00f2
TargetConditionals.h: Add missing targets.
fhgwright Jun 18, 2026
5714878
test_targetconds: Add missing targets.
fhgwright Jun 18, 2026
90b1dc6
test_targetconds: Update to test "bare" include.
fhgwright Jun 18, 2026
383b0b2
TargetConditionals.h: Provide dummy __has_include() when needed.
fhgwright Jun 18, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
109 changes: 89 additions & 20 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# GNU Makefile for MacportsLegacySupport
# Copyright (c) 2018 Chris Jones <jonesc@macports.org>
# Copyright (c) 2019 Michael Dickens <michaelld@macports.org>
# Copyright (c) 2026 Frederick H. G. Wright II <fw@fwright.net>
#
# Permission to use, copy, modify, and distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
Expand Down Expand Up @@ -170,17 +171,27 @@ XTESTBINPREFIX = $(TESTBINDIR)/test_
XTESTRUNPREFIX = run_
XTESTLDFLAGS = $(ALLLDFLAGS)
XTESTSRCS_C := $(wildcard $(XTESTNAMEPREFIX)*.c)
XTESTSRCS_GL := $(wildcard $(XTESTNAMEPREFIX)opengl_*.c)
XTESTPRGS_C := $(patsubst $(XTESTDIR)/%.c,%,$(XTESTSRCS_C))
XTESTPRGS_GL := $(patsubst $(XTESTDIR)/%.c,%,$(XTESTSRCS_GL))
XTESTOBJS_C := $(patsubst %,$(TESTBINDIR)/%.o,$(XTESTPRGS_C))
XTESTOBJS_GL := $(patsubst %,$(TESTBINDIR)/%.o,$(XTESTPRGS_GL))
XTESTOBJS_NGL := $(filter-out $(XTESTOBJS_GL),$(XTESTOBJS_C))
XTESTPRGS = $(patsubst %,$(TESTBINDIR)/%,$(XTESTPRGS_C))
XTESTRUNS := \
$(patsubst $(XTESTBINPREFIX)%,$(XTESTRUNPREFIX)%,$(XTESTPRGS))
DARWINSRCS_C := $(wildcard $(XTESTNAMEPREFIX)darwin_c*.c)
DARWINRUNS := $(patsubst \
$(XTESTNAMEPREFIX)%.c,$(XTESTRUNPREFIX)%,$(DARWINSRCS_C))
DARWINSSRCS_C := $(wildcard $(XTESTNAMEPREFIX)darwin_source*.c)
DARWINSRUNS := $(patsubst \
$(XTESTNAMEPREFIX)%.c,$(XTESTRUNPREFIX)%,$(DARWINSSRCS_C))
SCANDIRSRCS_C := $(wildcard $(XTESTNAMEPREFIX)scandir*.c)
SCANDIRRUNS := $(patsubst \
$(XTESTNAMEPREFIX)%.c,$(XTESTRUNPREFIX)%,$(SCANDIRSRCS_C))
CONTEXTSSRCS_C := $(wildcard $(XTESTNAMEPREFIX)contexts*.c)
CONTEXTSRUNS := $(patsubst \
$(XTESTNAMEPREFIX)%.c,$(XTESTRUNPREFIX)%,$(CONTEXTSSRCS_C))
ALLHDRSRCS_C := $(wildcard $(XTESTNAMEPREFIX)allheaders*.c)
ALLHDRRUNS := $(patsubst \
$(XTESTNAMEPREFIX)%.c,$(XTESTRUNPREFIX)%,$(ALLHDRSRCS_C)) \
Expand Down Expand Up @@ -226,6 +237,12 @@ ATTRLISTRUNS := $(patsubst \
# All automatic test runners
ALLTESTRUNS := $(TESTRUNS) $(TESTSRUNS) $(TESTSYSRUNS) $(XTESTRUNS)

# Special manual tests needing CoreFoundation framework
MANTESTSRCS_CF := $(MANTESTPREFIX)cfstring.c
MANTESTPRGS_CF := $(patsubst $(MANTESTPREFIX)%.c,%,$(MANTESTSRCS_CF))
MANTESTBINS_CF := $(patsubst %,$(TESTBINDIR)/%,$(MANTESTPRGS_CF))
CFFLAGS := -framework CoreFoundation

# Tests that are only run manually
MANTESTDIR = manual_tests
MANTESTPREFIX = $(MANTESTDIR)/
Expand All @@ -246,6 +263,7 @@ MANTESTOBJS_CPP := $(patsubst %,$(TESTBINDIR)/%.o,$(MANTESTPRGS_CPP))
MANTESTOBJS := $(MANTESTOBJS_C) $(MANLIBTESTOBJS_C) $(MANTESTOBJS_CPP)
MANTESTBINS_C := $(patsubst %,$(TESTBINDIR)/%,$(MANTESTPRGS_C))
MANTESTBINS_CPP := $(patsubst %,$(TESTBINDIR)/%,$(MANTESTPRGS_CPP))
MANTESTBINS_NF := $(filter-out $(MANTESTBINS_CF),$(MANTESTBINS_C))
MANTESTPRGS := $(MANTESTBINS_C) $(MANTESTBINS_CPP)
MANTESTRUNS := $(patsubst \
$(TESTBINDIR)/%,$(MANRUNPREFIX)%,$(MANTESTPRGS))
Expand Down Expand Up @@ -357,9 +375,15 @@ $(TESTOBJS_C): $(TESTBINDIR)/%.o: $(TESTDIR)/%.c $(ALLHEADERS) | $(TESTBINDIR)
$(CC) -c -std=$(TESTCSTD) -I$(SRCINCDIR) $(TESTCFLAGS) $< -o $@

# The "darwin_c" tests need the -fno-builtin option with some compilers.
$(XTESTOBJS_C): $(TESTBINDIR)/%.o: $(XTESTDIR)/%.c $(ALLHEADERS) | $(TESTBINDIR)
$(XTESTOBJS_NGL): $(TESTBINDIR)/%.o: $(XTESTDIR)/%.c $(ALLHEADERS) \
| $(TESTBINDIR)
$(CC) -c -std=$(TESTCSTD) -fno-builtin -I$(SRCINCDIR) $(TESTCFLAGS) $< -o $@

# The OpenGL tests need -Wno-undef to be non-obnoxious.
$(XTESTOBJS_GL): $(TESTBINDIR)/%.o: $(XTESTDIR)/%.c $(ALLHEADERS) \
| $(TESTBINDIR)
$(CC) -c -std=$(TESTCSTD) -I$(SRCINCDIR) $(TESTCFLAGS) -Wno-undef $< -o $@

$(MANTESTOBJS_C): \
$(TESTBINDIR)/%.o: $(MANTESTDIR)/%.c $(ALLHEADERS) | $(TESTBINDIR)
$(CC) -c -std=$(TESTCSTD) -I$(SRCINCDIR) $(TESTCFLAGS) $< -o $@
Expand Down Expand Up @@ -411,7 +435,7 @@ $(XTESTPRGS): %: %.o
$(CC) $(XTESTLDFLAGS) $< -o $@

# Currently, the manual C tests don't require the library
$(MANTESTBINS_C): %: %.o
$(MANTESTBINS_NF): %: %.o
$(CC) $(MANTESTLDFLAGS) $< -o $@

# Except for the ones that do
Expand All @@ -422,6 +446,10 @@ $(MANLIBTESTBINS): %: %.o $(BUILDDLIBPATH)
$(MANTESTBINS_CPP): %: %.o $(BUILDDLIBPATH)
$(CXX) $(TESTLDFLAGS) $< $(TESTLIBS) -o $@

# And certain cases require CoreFoundation
$(MANTESTBINS_CF): %: %.o
$(CC) $(MANTESTLDFLAGS) $(CFFLAGS) $< -o $@

alltestobjs: $(TESTOBJS_C) $(XTESTOBJS_C) $(MANTESTOBJS_C) $(MANLIBTESTOBJS_C)

$(TIGERPRGS): $(TIGERBINDIR)/%: $(TIGERSRCDIR)/%.c | $(TIGERBINDIR)
Expand Down Expand Up @@ -608,11 +636,29 @@ $(XTESTBINPREFIX)darwin_c_199309.o: $(XTESTNAMEPREFIX)darwin_c.c
$(XTESTBINPREFIX)darwin_c_200809.o: $(XTESTNAMEPREFIX)darwin_c.c
$(XTESTBINPREFIX)darwin_c_full.o: $(XTESTNAMEPREFIX)darwin_c.c

# The "darwin_source" tests include the basic "darwin_source" source
$(XTESTBINPREFIX)darwin_source_a.o: $(XTESTNAMEPREFIX)darwin_source.c
$(XTESTBINPREFIX)darwin_source_k.o: $(XTESTNAMEPREFIX)darwin_source.c
$(XTESTBINPREFIX)darwin_source_p.o: $(XTESTNAMEPREFIX)darwin_source.c
$(XTESTBINPREFIX)darwin_source_x.o: $(XTESTNAMEPREFIX)darwin_source.c
$(XTESTBINPREFIX)darwin_source_d.o: $(XTESTNAMEPREFIX)darwin_source.c
$(XTESTBINPREFIX)darwin_source_da.o: $(XTESTNAMEPREFIX)darwin_source.c
$(XTESTBINPREFIX)darwin_source_dk.o: $(XTESTNAMEPREFIX)darwin_source.c
$(XTESTBINPREFIX)darwin_source_dp.o: $(XTESTNAMEPREFIX)darwin_source.c
$(XTESTBINPREFIX)darwin_source_dx.o: $(XTESTNAMEPREFIX)darwin_source.c

# The "scandir_*" tests include the basic "scandir" source
$(XTESTBINPREFIX)scandir_old.o: $(XTESTNAMEPREFIX)scandir.c
$(XTESTBINPREFIX)scandir_ino32.o: $(XTESTNAMEPREFIX)scandir.c
$(XTESTBINPREFIX)scandir_ino64.o: $(XTESTNAMEPREFIX)scandir.c

# The "contexts" tests include the basic "contexts" source
$(XTESTBINPREFIX)contexts_p.o: $(XTESTNAMEPREFIX)contexts.c
$(XTESTBINPREFIX)contexts_d.o: $(XTESTNAMEPREFIX)contexts.c
$(XTESTBINPREFIX)contexts_dp.o: $(XTESTNAMEPREFIX)contexts.c
$(XTESTBINPREFIX)contexts_dx.o: $(XTESTNAMEPREFIX)contexts.c
$(XTESTBINPREFIX)contexts_x.o: $(XTESTNAMEPREFIX)contexts.c

# The nonstandard realpath tests include the realpath source
$(TESTBINPREFIX)realpath_nonext.o: $(TESTNAMEPREFIX)realpath.c
$(TESTBINPREFIX)realpath_nonposix.o: $(TESTNAMEPREFIX)realpath.c
Expand Down Expand Up @@ -649,32 +695,52 @@ $(XTESTBINPREFIX)allheaders_full_ds.o: $(XTESTNAMEPREFIX)allheaders.c
# The "attrlist_nonposix" test includes the attrlist test source
$(TESTNAMEPREFIX)attrlist_nonposix.o: $(TESTNAMEPREFIX)attrlist.c

# Provide a target for all "darwin_c" tests
# The "opengl" tests include the basic "opengl" source
$(XTESTBINPREFIX)opengl_ints_agl.o: $(XTESTNAMEPREFIX)opengl_ints.c

# Provide targets for all "darwin_c" tests
$(XTESTRUNPREFIX)darwin_c_all: $(DARWINRUNS)
$(XTESTRUNPREFIX)darwin_c_all_unv: $(addsuffix _unv,$(DARWINRUNS))

# Provide a target for all "scandir" tests
# Provide targets for all "darwin_source" tests
$(XTESTRUNPREFIX)darwin_source_all: $(DARWINSRUNS)
$(XTESTRUNPREFIX)darwin_source_all_unv: $(addsuffix _unv,$(DARWINSRUNS))

# Provide targets for all "scandir" tests
$(XTESTRUNPREFIX)scandir_all: $(SCANDIRRUNS)
$(XTESTRUNPREFIX)scandir_all_unv: $(addsuffix _unv,$(SCANDIRRUNS))

# Provide targets for all "contexts" tests
$(XTESTRUNPREFIX)contexts_all: $(CONTEXTSRUNS)
$(XTESTRUNPREFIX)contexts_all_unv: $(addsuffix _unv,$(CONTEXTSRUNS))

# Provide a target for all "realpath" tests
# Provide targets for all "realpath" tests
$(TESTRUNPREFIX)realpath_all: $(REALPATHRUNS)
$(TESTRUNPREFIX)realpath_all_unv: $(addsuffix _unv,$(REALPATHRUNS))

# Provide a target for all "fdopendir" tests
# Provide targets for all "fdopendir" tests
$(TESTRUNPREFIX)fdopendir_all: $(FDOPENDIRRUNS)
$(TESTRUNPREFIX)fdopendir_all_unv: $(addsuffix _unv,$(FDOPENDIRRUNS))

# Provide a target for all "stat" tests
# Provide targets for all "stat" tests
$(TESTRUNPREFIX)stat_all: $(STATXXRUNS)
$(TESTRUNPREFIX)stat_all_unv: $(addsuffix _unv,$(STATXXRUNS))

# Provide a target for all "stpncpy_chk" tests
# Provide targets for all "stpncpy_chk" tests
$(MANRUNPREFIX)stpncpy_chk_all: $(STPNCHKRUNS)
$(MANRUNPREFIX)stpncpy_chk_all_unv: $(addsuffix _unv,$(STPNCHKRUNS))

# Provide a target for all non-manual "packet" tests
# Provide targets for all non-manual "packet" tests
$(TESTRUNPREFIX)packet_all: $(PACKETRUNS)
$(TESTRUNPREFIX)packet_all_unv: $(addsuffix _unv,$(PACKETRUNS))

# Provide a target for all "allheaders" tests
# Provide targets for all "allheaders" tests
$(XTESTRUNPREFIX)allheaders_all: $(ALLHDRRUNS)
$(XTESTRUNPREFIX)allheaders_all_unv: $(addsuffix _unv,$(ALLHDRRUNS))

# Provide a target for all "attrlist" tests
# Provide targets for all "attrlist" tests
$(TESTRUNPREFIX)attrlist_all: $(ATTRLISTRUNS)
$(TESTRUNPREFIX)attrlist_all_unv: $(addsuffix _unv,$(ATTRLISTRUNS))

install: install-headers install-lib

Expand Down Expand Up @@ -768,15 +834,18 @@ clean: test_clean tools_clean
.PHONY: test_static test_syslib test_all
.PHONY: $(TESTRUNS) $(XTESTRUNS) $(MANTESTRUNS)
.PHONY: $(MANRUNPREFIX)clean test_clean xtest_clean
.PHONY: $(XTESTRUNPREFIX)darwin_c_all
.PHONY: $(XTESTRUNPREFIX)scandir_all
.PHONY: $(TESTRUNPREFIX)realpath_all
.PHONY: $(TESTRUNPREFIX)fdopendir_all
.PHONY: $(TESTRUNPREFIX)stat_all
.PHONY: $(MANRUNPREFIX)stpncpy_chk_all
.PHONY: $(TESTRUNPREFIX)packet_all
.PHONY: $(MANRUNPREFIX)packet_all
.PHONY: $(XTESTRUNPREFIX)allheaders_all
.PHONY: $(XTESTRUNPREFIX)darwin_c_all $(XTESTRUNPREFIX)darwin_c_all_unv
.PHONY: $(XTESTRUNPREFIX)darwin_source_all
.PHONY: $(XTESTRUNPREFIX)darwin_source_all_unv
.PHONY: $(XTESTRUNPREFIX)scandir_all $(XTESTRUNPREFIX)scandir_all_unv
.PHONY: $(XTESTRUNPREFIX)contexts_all $(XTESTRUNPREFIX)contexts_all_unv
.PHONY: $(TESTRUNPREFIX)realpath_all $(TESTRUNPREFIX)realpath_all_unv
.PHONY: $(TESTRUNPREFIX)fdopendir_all $(TESTRUNPREFIX)fdopendir_all_inv
.PHONY: $(TESTRUNPREFIX)stat_all $(TESTRUNPREFIX)stat_all_unv
.PHONY: $(MANRUNPREFIX)stpncpy_chk_all $(MANRUNPREFIX)stpncpy_chk_all_unv
.PHONY: $(TESTRUNPREFIX)packet_all $(TESTRUNPREFIX)packet_all_unv
.PHONY: $(MANRUNPREFIX)packet_all $(MANRUNPREFIX)packet_all_unv
.PHONY: $(XTESTRUNPREFIX)allheaders_all $(XTESTRUNPREFIX)allheaders_all_unv
.PHONY: install install-headers install-lib install-dlib install-slib
.PHONY: tiger-bins install-tiger
.PHONY: leopard-bins install-leopard
Expand Down
28 changes: 27 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,11 @@ Wrapped headers and replaced functions are:
<td>Adds function <code>timespec_get</code></td>
<td>OSX10.14</td>
</tr>
<tr>
<td><code>ucontext.h</code> subincludes</td>
<td>Adds definitions and aliases for 10.5+ context names to 10.4</td>
<td>OSX10.4</td>
</tr>
<tr>
<td rowspan="2"><code>unistd.h</code></td>
<td>Adds <code>fgetattrlist</code> and <code>fsetattrlist</code>
Expand All @@ -146,6 +151,11 @@ Wrapped headers and replaced functions are:
functions</td>
<td>OSX10.6</td>
</tr>
<tr>
<td><code>Xplugin.h</code></td>
<td>Adds missing <code>Xplugin.h</code> to 10.4</td>
<td>OSX10.4</td>
</tr>
<tr>
<td rowspan="2"><code>mach/mach_time.h</code></td>
<td>Adds function <code>mach_approximate_time</code></td>
Expand Down Expand Up @@ -302,7 +312,18 @@ Wrapped headers and replaced functions are:
<td>OSX10.5</td>
</tr>
<tr>
<td><code>OpenGL/gliDispatch.h</code></td>
<td><code>CoreFoundation/CFString.h</code></td>
<td>Adds <code>CFStringCreateWithBytesNoCopy</code> prototype</td>
<td>OSX10.4</td>
</tr>
<tr>
<td><code>OpenGL/gl.h</code>, <code>AGL/gl.h</code></td>
<td>Updates 10.4 <code>gl.h</code> to make types match behaviour
of newer systems.</td>
<td>OSX10.4</td>
</tr>
<tr>
<td><code>OpenGL/gliDispatch.h</code>, <code>AGL/gliDispatch.h</code></td>
<td>Wraps <code>gliDispatch.h</code> to prevent including
<code>glext.h</code> and thereby match behaviour of newer systems.</td>
<td>OSX10.6</td>
Expand Down Expand Up @@ -337,6 +358,11 @@ Wrapped headers and replaced functions are:
<td>Fixes boottime bug in 64-bit <code>sysctl()</code> and <code>sysctlbyname()</code></td>
<td>OSX10.5</td>
</tr>
<tr>
<td><code>-</code></td>
<td>Fixes ppc64 signal handling in 10.4</td>
<td>OSX10.4</td>
</tr>
</table>

For information on building this library outside MacPorts, see BUILDING.txt.
32 changes: 32 additions & 0 deletions include/AGL/gl.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/*
* Copyright (c) 2026
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/

/*
* The 10.4 version of this header has five typedefs which differ from the
* 10.5+ versions. To eliminate this inconsistency, we substitute a
* modified version of the header in the 10.4 case. This can't be done
* as a wrapper header, since typedefs can't be overridden. In the 10.5+
* cases, we simply pass through the standard version.
*/

/* Do our SDK-related setup */
#include <_macports_extras/sdkversion.h>

#if __MPLS_SDK_MAJOR < 1050
#include <_macports_extras/tiger_only/AGL/gl.h>
#else
#include_next <AGL/gl.h>
#endif
44 changes: 44 additions & 0 deletions include/AGL/gliDispatch.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
/*
* Copyright (c) 2026
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/

/*
* In SDKs > 10.6 this Apple header does not include glext.h.
* Including it causes redefinition errors that are hard to
* overcome in ports, eg mesa, so we block the loading of
* glext.h here on older systems for consistent behaviour with newer systems.
*
* Note: this header has no guard macro as it may be called
* multiple times and should have the same effect each time.
*
* Also note: This header doesn't exist in 10.7+ AGL, so there's no need for
* a version check. Any attempt to use this wrapper with a 10.7+ SDK will
* result in a failure of the include_next.
*/

#ifdef __glext_h_
# define __MPLS_SAVED_GLEXT_SET
#else
# define __glext_h_
#endif

/* Include the primary system AGL/gliDispatch.h */
#include_next <AGL/gliDispatch.h>

#ifdef __MPLS_SAVED_GLEXT_SET
# undef __MPLS_SAVED_GLEXT_SET
#else
# undef __glext_h_
#endif
Loading