glib: undef MIN()/MAX() to make it unusable (use NM variants)

NM variants:

- evaluate arguments only once
- have a static assertion that the signedness of the argument agrees.

Like MIN()/MAX(), NM_MIN()/NM_MAX() now also evaluate to a constant
expression, if the arguments are already constant. That means, the only
reason why MIN()/MAX() was preferable over NM_MIN()/NM_MAX() is no
longer relevant. Except there are a few places where NM_MIN()/NM_MAX()
cannot be used. In those places use NM_MIN_CONST()/NM_MAX_CONST().
This commit is contained in:
Thomas Haller 2023-10-30 08:34:08 +01:00
parent bee14cf47c
commit 21c979eb17
No known key found for this signature in database
GPG key ID: 29C2366E4DFC5728

View file

@ -766,4 +766,10 @@ _nm_deprecated("Don't use this API") void _nm_forbidden_glib_api_n(gconstpointer
/*****************************************************************************/
/* Use either NM_MIN()/NM_MAX() or (if that doesn't work) use NM_MIN_CONST()/NM_MAX_CONST(). */
#undef MIN
#undef MAX
/*****************************************************************************/
#endif /* __NM_GLIB_H__ */