gdbus-codegen: Add --glib-max-allowed argument

This complements the `--glib-min-required` argument, just like the
`GLIB_MIN_REQUIRED` and `GLIB_MAX_ALLOWED` preprocessor defines which
control access to APIs in C.

Currently, it doesn’t affect code generation at all. When we next change
code generation, we will need to gate any new API usage on this
argument.

Signed-off-by: Philip Withnall <withnall@endlessm.com>

Fixes: #1993
This commit is contained in:
Philip Withnall
2020-01-27 10:36:03 +00:00
parent 4d1c3e15f9
commit 9734e4854e
5 changed files with 101 additions and 1 deletions

View File

@@ -51,6 +51,7 @@
</arg>
</group>
<arg><option>--glib-min-required</option> <replaceable>VERSION</replaceable></arg>
<arg><option>--glib-max-allowed</option> <replaceable>VERSION</replaceable></arg>
<arg choice="plain">FILE</arg>
<arg>
<arg choice="plain" rep="repeat">FILE</arg>
@@ -460,6 +461,27 @@ gdbus-codegen --c-namespace MyApp \
</listitem>
</varlistentry>
<varlistentry>
<term><option>--glib-max-allowed</option> <replaceable>VERSION</replaceable></term>
<listitem>
<para>
Specifies the maximum version of GLib which the code generated by
<command>gdbus-codegen</command> can depend on. This may be used to
ensure that code generated by <command>gdbus-codegen</command> is
compilable with specific older versions of GLib that your software has
to support.
</para>
<para>
The version number must be of the form
<literal><replaceable>MAJOR</replaceable>.<replaceable>MINOR</replaceable>.<replaceable>MICRO</replaceable></literal>,
where all parts are integers. <replaceable>MINOR</replaceable> and
<replaceable>MICRO</replaceable> are optional. The version number must
be greater than or equal to that passed to <option>--glib-min-required</option>.
It defaults to the version of GLib which provides this <command>gdbus-codegen</command>.
</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>