andreasbuhr / cppcoro

A library of C++ coroutine abstractions for the coroutines TS
MIT License
364 stars 53 forks source link

Use a namespace linux,but it expand as a macro #77

Open asdadj opened 1 year ago

andreasbuhr commented 1 year ago

Sorry, I don't understand what you mean. Could you elaborate please?

vasdal commented 11 months ago

Thinks this probably is the same error as i get:

include/cppcoro/detail/linux.hpp:22:13: error: expected identifier or '{'
[build]    22 |                 namespace linux
[build]       |                           ^
[build] <built-in>:447:15: note: expanded from macro 'linux'
[build]   447 | #define linux 1
[build]       |               ^
include/cppcoro/detail/linux.hpp:22:13: error: expected unqualified-id
[build] <built-in>:447:15: note: expanded from macro 'linux'
[build]   447 | #define linux 1
[build]       |               ^
andreasbuhr commented 11 months ago

What compiler are you using? It seems the compiler defines a macro named "linux". Do you find any documentation for that macro?

andreasbuhr commented 11 months ago

I do not find any compiler which defines "linux". It seems rather strange to me to do this, for a compiler.

vasdal commented 11 months ago

I'm currently building with:

Debian clang version 17.0.6 (++20231208085813+6009708b4367-1~exp1~20231208085906.81)
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/local/bin

Using this docker file: Dockerfile.zip

jorgen commented 11 months ago

This happens if you are missing the C++ version. The linux macro is deprecated but included if you don't specify a C++ version: https://godbolt.org/z/M3o1MMKv1