std-aux/glib-aux: move NM_AUTO_PROTECT_ERRNO() to libnm-std-aux

This commit is contained in:
Thomas Haller 2021-06-25 09:47:38 +02:00
parent 62141eb938
commit 2b55408cc7
No known key found for this signature in database
GPG key ID: 29C2366E4DFC5728
2 changed files with 8 additions and 8 deletions

View file

@ -122,14 +122,6 @@ _nm_auto_free_gstring(GString **str)
}
#define nm_auto_free_gstring nm_auto(_nm_auto_free_gstring)
static inline void
_nm_auto_protect_errno(const int *p_saved_errno)
{
errno = *p_saved_errno;
}
#define NM_AUTO_PROTECT_ERRNO(errsv_saved) \
nm_auto(_nm_auto_protect_errno) _nm_unused const int errsv_saved = (errno)
NM_AUTO_DEFINE_FCN0(GSource *, _nm_auto_unref_gsource, g_source_unref);
#define nm_auto_unref_gsource nm_auto(_nm_auto_unref_gsource)

View file

@ -821,6 +821,14 @@ nm_close(int fd)
NM_AUTO_DEFINE_FCN_VOID0(void *, _nm_auto_free_impl, free);
#define nm_auto_free nm_auto(_nm_auto_free_impl)
static inline void
_nm_auto_protect_errno(const int *p_saved_errno)
{
errno = *p_saved_errno;
}
#define NM_AUTO_PROTECT_ERRNO(errsv_saved) \
nm_auto(_nm_auto_protect_errno) _nm_unused const int errsv_saved = (errno)
/*****************************************************************************/
static inline void