Opened 5 months ago

Closed 2 months ago

Last modified 6 weeks ago

#69890 closed enhancement (fixed)

legacysupport: add SLIST_REMOVE_AFTER

Reported by: barracuda156 Owned by: fhgwright (Fred Wright)
Priority: Normal Milestone:
Component: ports Version: 2.9.3
Keywords: Cc: mascguy (Christopher Nielsen), fhgwright (Fred Wright), catap (Kirill A. Korinsky)
Port: legacy-support

Description

Could we add support for SLIST_REMOVE_AFTER, which is missing from sys/queue.h in some older OS?

Perhaps, from Apple code:

#ifndef SLIST_REMOVE_AFTER
#define SLIST_REMOVE_AFTER(elm, field) do {             \
        SLIST_NEXT(elm, field) =                        \
            SLIST_NEXT(SLIST_NEXT(elm, field), field);  \
} while (0)
#endif

https://opensource.apple.com/source/Libc/Libc-997.1.1/gen/FreeBSD/popen.c.auto.html

Change History (4)

comment:1 Changed 2 months ago by fhgwright (Fred Wright)

Owner: set to fhgwright
Resolution: fixed
Status: newclosed

In bcf07c4875bbc1ee44d0bb26a2eb2365b63c8dac/macports-legacy-support (master):

Add SLIST_REMOVE_AFTER, SLIST_HEAD_INITIALIZER

Several other queue macros are also missing, which is not covered by
this commit.

Closes: #69890

TESTED:
Builds and passes tests on all platforms, including the new tests for
the new macros.

comment:2 Changed 2 months ago by fhgwright (Fred Wright)

In a2cd30549f437341996dc1e5e84bd9a1cd136c70/macports-legacy-support (master):

Add tests for some queue operations.

This adds a long-missing test for STAILQ_FOREACH, as well as a test
for the newly added SLIST_REMOVE_AFTER (which also tests
SLIST_HEAD_INITIALIZER).

Re: #69890

TESTED:
Detects missing STAILQ_FOREACH in 10.4 SDK (without old fix).
Detects missing SLIST_HEAD_INITIALIZER in 10.4 SDK (without new fix).
Detects missing SLIST_REMOVE_AFTER in 10.4-10.6 SDKs (without new
fix).
With fixes, passes with all applicable SDKs on all platforms.

comment:3 Changed 2 months ago by fhgwright (Fred Wright)

In a16240162b34f3a69eab8c529bd6bef7d25d51df/macports-ports (master):

legacy-support-devel: Update to latest master.

Since the previous legacy-support-devel:

  • Adds SLIST_REMOVE_AFTER, SLIST_HEAD_INITIALIZER Re: #69890
  • Adds fgetattrlist()

In the previous legacy-support-devel, since v1.2.4:

  • Adds optional security wrapper for stpncpy(). Re: #69878
  • Moves renameat() prototype to the proper header location.
  • Fixes incorrect CLOCK_UPTIME_RAW_APPROX definition
  • Eliminates spurious fmemopen() in OSes that don't need it
  • Adds appropriate DARWIN_C_LEVEL conditionals, as in SDK headers. Re: #69688
  • Reworks headers for "mismatched" SDK compatibility. Re: #69867
  • Makes clockid_t an enum, matching SDK behavior.

TESTED:
Tested both normal and -devel versions on 10.4-10.5 ppc, 10.5-10.6 ppc
(i386 Rosetta), 10.4-10.6 i386, 10.4-12.x x86_64, and 11.x-14.x arm64.
Builds on all tested platforms except 10.4 ppc +universal.
Passes all tests in all buildable cases.

comment:4 Changed 6 weeks ago by fhgwright (Fred Wright)

In ceccb8bb27da3987f9c191f0ad8181998af1831c/macports-ports (master):

legacy-support: Update to v1.3.0.

  • Adds optional security wrapper for stpncpy(). Re: #69878
  • Moves renameat() prototype to the proper header location.
  • Fixes incorrect CLOCK_UPTIME_RAW_APPROX definition.
  • Eliminates spurious fmemopen() in OSes that don't need it.
  • Adds appropriate DARWIN_C_LEVEL conditionals, as in SDK headers. Re: #69688
  • Reworks headers for "mismatched" SDK compatibility. Re: #69867
  • Makes clockid_t an enum, matching SDK behavior.
  • Adds SLIST_REMOVE_AFTER, SLIST_HEAD_INITIALIZER. Re: #69890
  • Adds fgetattrlist(). Closes: #70350

Portfile changes:

  • Removes obsolete portion of Tiger-specific additions.
  • Moves atexit removal from post-extract to pre-patch, to respect expected phase behavior.

TESTED:
Tested both normal and -devel versions (currently identical) on
10.4-10.5 ppc, 10.5-10.6 ppc (i386 Rosetta), 10.4-10.6 i386, 10.4-12.x
x86_64, and 11.x-14.x arm64.
Builds on all tested platforms except 10.4 ppc +universal.
Passes all tests in all buildable cases.

Note: See TracTickets for help on using tickets.