Bug 277995 - devel/p4: fails to build after SHUT_RD and friend were changed to enum
Summary: devel/p4: fails to build after SHUT_RD and friend were changed to enum
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: freebsd-ports-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-03-27 18:59 UTC by Dimitry Andric
Modified: 2024-03-27 19:50 UTC (History)
2 users (show)

See Also:
bugzilla: maintainer-feedback? (antonfb)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dimitry Andric freebsd_committer freebsd_triage 2024-03-27 18:59:35 UTC
In https://cgit.freebsd.org/src/commit/?id=c3276e02beab8, the SHUT_RD, SHUT_WR and SHUT_RDWR constants were changed from #defines to enum values.

This breaks devel/p4:

net/nettcptransport.cc:821:16: error: use of undeclared identifier 'SD_SEND'
  821 |                 shutdown( t, SD_SEND );
      |                              ^

The code does:

#if defined(SHUT_WR) // POSIX
                shutdown( t, SHUT_WR );
#else // Windows
                shutdown( t, SD_SEND );
#endif

so it could be kludged around by #defining SHUT_WR, etc via CXXFLAGS.
Comment 1 commit-hook freebsd_committer freebsd_triage 2024-03-27 19:23:17 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=3fa957840354bb476c2f990b72cb2ee7339ac328

commit 3fa957840354bb476c2f990b72cb2ee7339ac328
Author:     Gleb Smirnoff <glebius@FreeBSD.org>
AuthorDate: 2024-03-27 19:19:44 +0000
Commit:     Gleb Smirnoff <glebius@FreeBSD.org>
CommitDate: 2024-03-27 19:22:10 +0000

    sockets: define shutdown(2) constants in cpp namespace

    There is software that uses SHUT_RD, SHUT_WR as preprocessor defines and
    its build was broken by enum declaration.  Keep the enum, but provide
    defines to propagate the constants to cpp namespace.

    PR:             277994
    PR:             277995
    Fixes:          c3276e02beab825824e3147b31af33af66298430

 sys/sys/socket.h | 3 +++
 1 file changed, 3 insertions(+)