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

Linux compilation using X11's header Xos.h failed, due to macro definition "index(s, c)" #1388

Closed
BoneCrasher opened this issue Nov 1, 2019 · 1 comment

Comments

@BoneCrasher
Copy link

Using libfmt on linux in conjunction with X11 headers I encountered a name collision with the macro index(s, c) defined in Xos.h.

If fmt/format.h is included AFTER Xos.h, this code in format.h will fail to compile:

  arg_id_kind kind;
  union value {
    FMT_CONSTEXPR value() : index(0u) {}
    FMT_CONSTEXPR value(int id) : index(id) {}
    FMT_CONSTEXPR value(basic_string_view<Char> n) : name(n) {}

    int index;
    basic_string_view<Char> name;
  } val;

with
error: macro "index" requires 2 arguments, but only 1 given FMT_CONSTEXPR value() : index(0u) {}

since index(...) expects two arguments.

vitaut added a commit that referenced this issue Nov 1, 2019
vitaut added a commit that referenced this issue Nov 1, 2019
vitaut added a commit that referenced this issue Nov 1, 2019
@vitaut
Copy link
Contributor

vitaut commented Nov 1, 2019

Worked around in 213e096.

@vitaut vitaut closed this as completed Nov 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants