net: tcp: Change FL() macro to avoid runtime overhead

Instead of strlen() use sizeof() in FL() macro. This way
all the checks are done at compile time instead of runtime.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
This commit is contained in:
Jukka Rissanen 2023-10-18 18:08:12 +03:00 committed by Carles Cufí
commit 31081d8411

View file

@ -328,6 +328,6 @@ struct tcp { /* TCP connection */
})
#define FL(_fl, _op, _mask, _args...) \
_flags(_fl, _op, _mask, strlen("" #_args) ? _args : true)
_flags(_fl, _op, _mask, sizeof(#_args) > 1 ? _args : true)
typedef void (*net_tcp_cb_t)(struct tcp *conn, void *user_data);