gdbus-codegen(1): Suggest --pragma-once for headers written to stdout

Otherwise we would generate a multiple-inclusion guard of the
form `#ifndef __STDOUT__ ...`, which can only work for one D-Bus
interface per translation unit.

Signed-off-by: Simon McVittie <smcv@collabora.com>
This commit is contained in:
Simon McVittie 2024-02-06 13:50:16 +00:00
parent fc7942f46b
commit 040caa5f6a

View File

@ -305,6 +305,10 @@ The following options are supported:
This might make it necessary to use ``cc -include foo.h``, or generate a
filename like ``foo-impl.h`` and ``#include`` it into a wrapper ``.c`` file.
For ``--header`` and ``--interface-info-header``, there is no obvious
name for a traditional multiple-inclusion guard when writing to standard
output, so using the ``--pragma-once`` option is recommended.
In the rare situation that the intended output filename starts with ``-``,
it should be prefixed with ``./``.