NetworkManager/shared
Thomas Haller b52d3e2ad3 shared: add NM_CONST_MAX() macro
There is:

 1) glib's MAX() macro, which evaluates arguments multiple times,
    but yields a constant expression, if the arguments are constant.

 2) NM's NM_MAX() macro, which evaluates arguments exactly once,
    but never yields a constant expression.

 3) systemd's MAX() which is like NM_MAX().

Now, it's sensible to use

    char buf[MAX (A_CONSTANT, ANOTHER_CONSTANT)];

and this works with glib's variant (1).

However, when we include systemd headers, 1) gets redefined to 3), and
above no longer works. That is because we we don't allow VLA and systemd's
macro gives not a constant expression.

Add NM_CONST_MAX() macro which is like systemd's CONST_MAX(). It can
only operate on constant arguments.
2019-02-04 10:55:25 +01:00
..
c-list shared/c-list: re-import from latest c-util/c-list 2018-08-01 12:57:34 +02:00
c-rbtree build: meson: Add trailing commas 2018-12-20 13:50:34 +01:00
c-siphash build: meson: Add trailing commas 2018-12-20 13:50:34 +01:00
n-acd build: meson: Add trailing commas 2018-12-20 13:50:34 +01:00
nm-utils shared: add NM_CONST_MAX() macro 2019-02-04 10:55:25 +01:00
systemd all: fix misspellings 2019-01-24 17:19:44 +01:00
meson.build libnm: use "libnm-systemd-shared.a" in "libnm-core.la" (and "libnm.so") 2019-01-02 17:08:41 +01:00
nm-common-macros.h manager: add connectivity-check-{available,enabled} properties. 2017-08-17 22:31:47 +02:00
nm-dbus-compat.h build: rename directory "include" to "shared" 2015-12-24 11:42:37 +01:00
nm-default.h systemd: move basic systemd library to shared/nm-utils 2019-01-02 17:07:13 +01:00
nm-dispatcher-api.h build: cleanup src/Makefile.am 2016-08-11 11:54:18 +02:00
nm-ethtool-utils.c all/ethtool: add support for all currently supported kernel features 2018-08-10 10:38:19 +02:00
nm-ethtool-utils.h all/ethtool: add support for all currently supported kernel features 2018-08-10 10:38:19 +02:00
nm-meta-setting.c wifi-p2p: rename Wi-Fi P2P 2019-02-01 17:02:57 +01:00
nm-meta-setting.h wifi-p2p: rename Wi-Fi P2P 2019-02-01 17:02:57 +01:00
nm-test-libnm-utils.h tests: add nmtstc_auto_service_cleanup macro 2018-06-25 12:13:28 +02:00
nm-test-utils-impl.c all: don't use gchar/gshort/gint/glong but C types 2018-07-11 12:02:06 +02:00
nm-version-macros.h.in release: bump version to 1.15.0 (development) 2018-09-08 10:24:20 +02:00