Expands to the GNU C fallthrough statement attribute if the compiler is gcc.
This allows declaring case statement to explicitly fall through in switch
statements. To enable this feature, use -Wimplicit-fallthrough during
compilation.
On 32 bit systems, the size of a long might be the same as the size of
an int. In that case, we won't be able to get an overflow when
converting from a GTimeVal to a time_t. Skip the test for this in that
case.
Closes#1509
We already set -Wformat=2, which implies -Wformat-security, so there’s
no need to test for and set -Wformat-security separately.
The test for -Wformat-security never worked anyway, since gcc complains
if it’s specified without also setting -Wformat to some value. The
complaint causes configure.ac/meson.build to assume the option doesn’t
work.
Signed-off-by: Philip Withnall <withnall@endlessm.com>
https://gitlab.gnome.org/GNOME/glib/issues/656
There are many cases where a default TLS database is not able to be
defined within the constraints of a system. For example glib-networking
(or glib-openssl) cannot retrieve the default certificate store on iOS
or Android and need to be initialized from a cert file of certificates
bundled with the application.
Previously GStreamer was relying on a custom patch to glib-networking to
populate the default database from the file pointed to by the
CA_CERTIFICATES environment variable however the mechanism that enabled
this was recently remove from glib-networking.
Adding a more generic g_tls_backend_set_default_database() API allows
application developers to override the default database using their own
certificates as well as allowing equivalent functionality on Android/iOS
(or others) as on the default database handling Linux.
Fixes https://gitlab.gnome.org/GNOME/glib-networking/issues/35
The ::network-changed signal is documented to indicate any change in
network configuration, which doesn't necessarily imply a property
change - additional services becoming available after connecting to
a VPN comes to mind for instance.
In order to match the "native" network monitor's behavior, always
emit the signal when it's in response to the 'changed' D-Bus signal.
Also emit the signal unconditionally when loading the initial property
values, to allow clients to differentiate between "offline" meaning
"offline" and "offline" meaning "uninitialized".
Test a few situations where NULL values for optional out parameters
weren’t being tested. This takes the branch coverage of GHashTable up to
100% (ignoring g_return_if_fail() branches).
Signed-off-by: Philip Withnall <withnall@endlessm.com>
If the given key is not found, clear the orig_key and value arguments to
NULL as well as returning FALSE. Then the caller can unconditionally
check them.
This makes the behaviour of g_hash_table_lookup_extended() consistent
with g_hash_table_steal_extended().
Signed-off-by: Philip Withnall <withnall@endlessm.com>
With 0d685b4946, we now encode resource
data as a string. Strings have trailing nul terminators. A C compiler
will happily ignore the fact that the nul terminator exceeds the stated
array length, and will drop it — but a C++ compiler won’t, and will
raise:
error: initializer-string for array of chars is too long [-fpermissive]
Fix that by increasing the array length by 1, and subtracting it again
in the GStaticResource struct.
Signed-off-by: Philip Withnall <withnall@endlessm.com>