undef _get{short,long} before redefining

This commit is contained in:
Damien Miller 2022-10-14 14:52:22 +11:00
parent 5eb796a369
commit bc2e480d99
No known key found for this signature in database
1 changed files with 9 additions and 3 deletions

View File

@ -116,8 +116,14 @@ struct __res_state _res;
#if !defined(HAVE__GETSHORT) || !defined(HAVE__GETLONG) || \ #if !defined(HAVE__GETSHORT) || !defined(HAVE__GETLONG) || \
!defined(HAVE_DECL__GETSHORT) || HAVE_DECL__GETSHORT == 0 || \ !defined(HAVE_DECL__GETSHORT) || HAVE_DECL__GETSHORT == 0 || \
!defined(HAVE_DECL__GETLONG) || HAVE_DECL__GETLONG == 0 !defined(HAVE_DECL__GETLONG) || HAVE_DECL__GETLONG == 0
#define _getshort(x) (_ssh_compat_getshort(x)) # ifdef _getshort
#define _getlong(x) (_ssh_compat_getlong(x)) # undef _getshort
# endif
# ifdef _getlong
# undef _getlong
# endif
# define _getshort(x) (_ssh_compat_getshort(x))
# define _getlong(x) (_ssh_compat_getlong(x))
/* /*
* Routines to insert/extract short/long's. * Routines to insert/extract short/long's.
*/ */
@ -138,7 +144,7 @@ _getlong(const u_char *msgp)
GETLONG(u, msgp); GETLONG(u, msgp);
return (u); return (u);
} }
#endif #endif /* missing _getshort/_getlong */
/* ************** */ /* ************** */