libvncserver icon indicating copy to clipboard operation
libvncserver copied to clipboard

public header rfb/rfbproto.h redefines TRUE

Open gaho1 opened this issue 1 year ago • 2 comments

The header file rfb/rfbproto.h #undefs and #defines TRUE to -1 and is part of the public API for the project (deployed to /usr/include) for client applications to use. This header is included when rfb/rfbclient.h is included by an application using libvncclient.

This redefinition of TRUE is likely to silently clash with definitions of the same name provided by either another library or by user code. Especially because of the slightly non-conventional use of -1 for TRUE and how widely used a symbol named TRUE is.

In my case, it clashed with an internal header from the gstreamer project which defines TRUE as 1. Gstreamer validates some inputs against that value.

gaho1 avatar Jul 31 '24 08:07 gaho1

This is somehting for post-v.1.0.0. In the meantime, you'll have to do your own #ifdef logic.

bk138 avatar Jul 31 '24 08:07 bk138

Thanks. I have a workaround - just wanted to ensure it was tracked / known here.

gaho1 avatar Jul 31 '24 08:07 gaho1