shared: fix typecheck in NM_PTRARRAY_LEN()

Previously, NM_PTRARRAY_LEN() would not work if the pointer type is
an opaque type, which is common. For example:

  NMConnection *const*connections = ...;
This commit is contained in:
Thomas Haller
2018-03-14 09:10:49 +01:00
parent 39ab38a04d
commit f7b2ebc87a

View File

@@ -271,7 +271,8 @@ NM_G_ERROR_MSG (GError *error)
gsize _n = 0; \
\
if (_array) { \
_nm_unused typeof (*(_array[0])) *_array_check = _array[0]; \
_nm_unused gconstpointer _type_check_is_pointer = _array[0]; \
\
while (_array[_n]) \
_n++; \
} \