Bug 281141 - editors/le: fix build with recent libc++ headers
Summary: editors/le: fix build with recent libc++ headers
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: Ryan Steinmetz
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-08-30 19:02 UTC by Dimitry Andric
Modified: 2024-08-30 19:47 UTC (History)
0 users

See Also:
zi: maintainer-feedback+


Attachments
editors/le: fix build with recent libc++ headers (574 bytes, patch)
2024-08-30 19:02 UTC, Dimitry Andric
no flags Details | Diff

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-08-30 19:02:08 UTC
As reported on the ports mailing lists, with recent libc++ headers on e.g. 15.0-CURRENT, 13.4 or 14.2, editors/le fails with errors similar to:

/usr/include/c++/v1/ios:257:25: error: expected ')'
  257 |   static const fmtflags hex         = 0x0008;
      |                         ^
./edit.h:158:26: note: expanded from macro 'hex'
  158 | #define hex     (editmode==HEXM)
      |                          ^
/usr/include/c++/v1/ios:257:25: note: to match this '('
./edit.h:158:17: note: expanded from macro 'hex'
  158 | #define hex     (editmode==HEXM)
      |                 ^

This is because edit.h defines a `hex` macro, and this clashes with std::hex from the libc++ headers.

I am attaching a diff which uses post-patch to rename the `hex` macro to `is_hex`.
Comment 1 Dimitry Andric freebsd_committer freebsd_triage 2024-08-30 19:02:35 UTC
Created attachment 253188 [details]
editors/le: fix build with recent libc++ headers
Comment 2 Ryan Steinmetz freebsd_committer freebsd_triage 2024-08-30 19:16:16 UTC
Approved, thanks!
Comment 3 commit-hook freebsd_committer freebsd_triage 2024-08-30 19:34:01 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=1aa709605c874eb09ce84076367d86a02023ee2d

commit 1aa709605c874eb09ce84076367d86a02023ee2d
Author:     Dimitry Andric <dim@FreeBSD.org>
AuthorDate: 2024-08-30 19:07:16 +0000
Commit:     Dimitry Andric <dim@FreeBSD.org>
CommitDate: 2024-08-30 19:29:53 +0000

    editors/le: fix build with recent libc++ headers

    As reported on the ports mailing lists, with recent libc++ headers on
    e.g. 15.0-CURRENT, 13.4 or 14.2, editors/le fails with errors similar
    to:

        /usr/include/c++/v1/ios:257:25: error: expected ')'
          257 |   static const fmtflags hex         = 0x0008;
              |                         ^
        ./edit.h:158:26: note: expanded from macro 'hex'
          158 | #define hex     (editmode==HEXM)
              |                          ^
        /usr/include/c++/v1/ios:257:25: note: to match this '('
        ./edit.h:158:17: note: expanded from macro 'hex'
          158 | #define hex     (editmode==HEXM)
              |                 ^

    This is because edit.h defines a `hex` macro, and this clashes with
    std::hex from the libc++ headers.

    To fix the build, use post-patch to rename the `hex` macro to `is_hex`.

    PR:             281141
    Reported by:    J David <j.david.lists@gmail.com>
    Approved by:    zi (maintainer)
    MFH:            2024Q3

 editors/le/Makefile | 5 +++++
 1 file changed, 5 insertions(+)
Comment 4 commit-hook freebsd_committer freebsd_triage 2024-08-30 19:38:02 UTC
A commit in branch 2024Q3 references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=117ed7e19830f213744750d5db48d45766f5c1a5

commit 117ed7e19830f213744750d5db48d45766f5c1a5
Author:     Dimitry Andric <dim@FreeBSD.org>
AuthorDate: 2024-08-30 19:07:16 +0000
Commit:     Dimitry Andric <dim@FreeBSD.org>
CommitDate: 2024-08-30 19:35:01 +0000

    editors/le: fix build with recent libc++ headers

    As reported on the ports mailing lists, with recent libc++ headers on
    e.g. 15.0-CURRENT, 13.4 or 14.2, editors/le fails with errors similar
    to:

        /usr/include/c++/v1/ios:257:25: error: expected ')'
          257 |   static const fmtflags hex         = 0x0008;
              |                         ^
        ./edit.h:158:26: note: expanded from macro 'hex'
          158 | #define hex     (editmode==HEXM)
              |                          ^
        /usr/include/c++/v1/ios:257:25: note: to match this '('
        ./edit.h:158:17: note: expanded from macro 'hex'
          158 | #define hex     (editmode==HEXM)
              |                 ^

    This is because edit.h defines a `hex` macro, and this clashes with
    std::hex from the libc++ headers.

    To fix the build, use post-patch to rename the `hex` macro to `is_hex`.

    PR:             281141
    Reported by:    J David <j.david.lists@gmail.com>
    Approved by:    zi (maintainer)
    MFH:            2024Q3

    (cherry picked from commit 1aa709605c874eb09ce84076367d86a02023ee2d)

 editors/le/Makefile | 5 +++++
 1 file changed, 5 insertions(+)