Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleanups and a few minor bugfixes #91

Merged
merged 15 commits into from
Jun 30, 2024
Merged

Conversation

fhgwright
Copy link
Contributor

See the individual commit descriptions.

Tested on:

Mac OS X 10.4.11 8S165, PPC, Xcode 2.5 8M2558
Mac OS X 10.4.11 8S2167, i386, Xcode 2.5 8M2558
Mac OS X 10.5.8 9L31a, PPC, Xcode 3.1.4 9M2809
Mac OS X 10.5.8 9L31a, i386, Xcode 3.1.4 9M2809
Mac OS X 10.5.8 9L31a, x86_64, Xcode 3.1.4 9M2809
Mac OS X 10.5.8 9L31a, PPC (i386 Rosetta), Xcode 3.1.4 9M2809
Mac OS X 10.6.8 10K549, i386, Xcode 3.2.6 10M2518
Mac OS X 10.6.8 10K549, x86_64, Xcode 3.2.6 10M2518
Mac OS X 10.6.8 10K549, PPC (i386 Rosetta), Xcode 3.2.6 10M2518
Mac OS X 10.7.5 11G63, x86_64, Xcode 4.6.3 4H1503
OS X 10.8.5 12F2560, x86_64, Xcode 5.1.1 5B1008
OS X 10.9.5 13F1911, x86_64, Xcode 6.2 6C131e
OS X 10.10.5 14F2511, x86_64, Xcode 7.2 7C68
OS X 10.11.6 15G22010, x86_64, Xcode 8.1 8B62
macOS 10.12.6 16G2136, x86_64, Xcode 9.2 9C40b
macOS 10.13.6 17G14042, x86_64, Xcode 10.1 10B61
macOS 10.14.6 18G9323, x86_64, Xcode 11.3.1 11C505
macOS 10.15.7 19H15, x86_64, Xcode 12.4 12D4e
macOS 11.7.10 20G1427, x86_64, Xcode 13.2.1 13C100
macOS 11.7.10 20G1427, arm64, Xcode 13.2.1 13C100
macOS 12.7.5 21H1222, x86_64, Xcode 14.2 14C18
macOS 12.7.5 21H1222, arm64, Xcode 14.2 14C18
macOS 13.6.7 22G720, arm64, Xcode 15.2 15C500b
macOS 14.5 23F79, arm64, Xcode 15.4 15F31d

All tests were run with all compatible SDK versions >= the target OS version. "Header-only" tests were also run with "earlier" SDKs.

fhgwright added 15 commits June 20, 2024 19:45
The dirfuncs_compat test uses the dirfuncs test source, and hence
needs a dependency on it.

TESTED:
Running "make test_dirfuncs_compat" after "touch test/test_dirfuncs.c"
now correctly rebuilds the test.
This fixes three issues with specifying flag variables to the Makefile:

1) It attempted to insert ARCHFLAGS into CC and CXX, but it was using ?=,
which doesn't work for predefined variables.

2) It never incorporated ARCHFLAGS into LDFLAGS.

3) It provided some defaults in CFLAGS and CXXFLAGS, but any setting of
these variables removed those defaults.  The defaults are now in XCFLAGS
and XCXXFLAGS, which are added to C[XX]FLAGS, along with ARCHFLAGS, so
they normally are kept.  If removing the defaults is desired, then
XC[XX]FLAGS can be overridden.

Note that the port build procedure uses FORCE_ARCH, not ARCHFLAGS.

Closes: https://trac.macports.org/ticket/69782

TESTED:
ARCHFLAGS is now respected, and setting CFLAGS doesn't remove
defaults.
TESTED:
Builds and passes tests on all platforms.
TESTED:
Builds and passes tests on all platforms, including mismatched SDK
cases.
TESTED:
Builds and passes tests on all platforms.
TESTED:
Tests pass normally, and fail with a manually induced error.
This adds a new composite definition to simplify conditionals, and
updates the feature macros accordingly.  See the comments for more
details.

TESTED:
Tests pass on all platforms.
TESTED:
Tests pass on all platforms.
Includes comments explaining the new feature-flag setup.

TESTED:
Tests pass on all platforms, including mismatched SDK cases.
This splits the feature flag for stpncpy() into separate flags for the
target OS version and the SDK version (the first of many such cases).
For the library, this just renames the feature flag.  For the header,
it's complicated by the added feature of fixing the possible
incompatibility between 10.7+ SDKs and old compilers.  See the
comments in string.h.

TESTED:
Tests pass on all platforms, including mismatched SDK cases.
This makes the proper SDK/lib split for the feature flag.

With a proper stdlib.h wrapper, there's no need for a private
arc4random.h, nor is there any need to test the feature flag in the
test.

TESTED:
Tests pass on all platforms, including mismatched SDK cases.
This was missing from the README list.

There's also no need for the version threshold macro when it uses an
ifndef.

TESTED:
Tests pass on all platforms, though there's no specific test for this
feature.  That should be added in the future.  The change is fairly
simple.
This constant was misdefined to be the same value as CLOCK_UPTIME_RAW.
In the simple case, it made no difference since both cases are treated
identically by the library.  But that meant that the library didn't
support CLOCK_UPTIME_RAW_APPROX with the correct value, which could
occur if the client were built with an SDK that defined it.  This can
be seen by running test_time.cpp built with an SDK>=10.12 on OS<10.12,
though only in the text output, since the test "succeeds" even when
the functions don't.

TESTED:
The aforementioned failing case now works properly.
The implementation of fmemopen() was lacking the usual conditional, so
that it was present even in OS versions where the OS provides the
function.  At best, this was a bit of code bloat.  At worst, it might
substitute an inferior implementation in later OS versions, rather
than getting out of the way.

TESTED:
Tests pass.
The fmemopen() function is now absent on 10.13 builds, while still
being present in 10.12 builds.
This allows passing command-line options to tests invoked via the
"make" command.

TESTED:
Works with old checksdkflagvalues, that had -v arg.
@fhgwright
Copy link
Contributor Author

@mascguy
Here's the new version of #90.

Copy link
Member

@mascguy mascguy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mascguy mascguy merged commit ed58217 into macports:master Jun 30, 2024
@fhgwright fhgwright deleted the newfixes branch June 30, 2024 19:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants