mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-03 02:20:14 +01:00
core: add macro STRLEN
Returns the length of a string at compile time. Contrary to strlen(), which is a run time expression -- even if the compler might be able to optimize strlen() for string constants. Signed-off-by: Thomas Haller <thaller@redhat.com>
This commit is contained in:
parent
408ecd6b5f
commit
a72079a862
1 changed files with 3 additions and 0 deletions
|
|
@ -40,6 +40,9 @@ void nm_utils_ip6_address_clear_host_address (struct in6_addr *dst, const struct
|
|||
|
||||
int nm_spawn_process (const char *args);
|
||||
|
||||
/* macro to return strlen() of a compile time string. */
|
||||
#define STRLEN(str) ( sizeof ("" str) - 1 )
|
||||
|
||||
gboolean nm_match_spec_string (const GSList *specs, const char *string);
|
||||
gboolean nm_match_spec_hwaddr (const GSList *specs, const char *hwaddr);
|
||||
gboolean nm_match_spec_s390_subchannels (const GSList *specs, const char *subchannels);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue