boostorg / boostorg/asio

boost 1.77.0 and newer conflicts with Qt5

Abierto
#393 3 comentarios 0 reacciones 0 asignados Ver en GitHub
Lenguaje dominante
C++
Estrellas
1.6k
Forks
485
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

We have a self-written program which compiled without any issues until 1.75.0. I had some spare time and tried to find out, why the compiler reports syntax errors since 1.76.0.

In file included from/software/libs/boost/1.79.0/include/boost/asio/associated_cancellation_slot.hpp(20),
from /software/libs/boost/1.79.0/include/boost/asio.hpp(22),
from src/mainwindow.h(47),
from src/main.cpp(7):
/software/libs/boost/1.79.0/include/boost/asio/cancellation_signal.hpp(116): error: expected a ")"
void emit(cancellation_type_t type)

There are other source files, which also include asio.hpp which do not show this error. I added --save-temps (GCC)/-P (ICC) to the compiler flags and compared the resulting .ii/.i files.

The working source files contain:
```
void emit(cancellation_type_t type)
{
if (handler_)
handler_->call(type);
}

```

The non working source files:
```
void (cancellation_type_t type)
{
if (handler_)
handler_->call(type);
}
```

The issue is caused by Qt5 which has a line `# define emit` in https://github.com/qt/qtbase/blob/5.15.2/src/corelib/kernel/qobjectdefs.h#L97 (`/usr/include/qt5/QtCore/qobjectdefs.h`)

Would it be possible to rename the function so that we can use a current Boost together with Qt5?

Note: https://github.com/boostorg/asio/commit/3521da0834fd20a520dc33e5b256c59b20827842 introduced that function.

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.