mirror of
https://github.com/PowerShell/openssh-portable.git
synced 2025-07-25 23:05:21 +02:00
Improve handling of _getshort and _getlong.
If the system native ones are exactly as required then use them, otherwise use the local versions mapped to another name to prevent name collisions.
This commit is contained in:
parent
8e206e0dd6
commit
0132056efa
@ -109,11 +109,18 @@ struct __res_state _res;
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/*
|
||||||
|
* If the system doesn't have _getshort/_getlong or that are not exactly what
|
||||||
|
* we need then use local replacements, avoiding name collisions.
|
||||||
|
*/
|
||||||
|
#if !defined(HAVE__GETSHORT) || !defined(HAVE__GETLONG) || \
|
||||||
|
!defined(HAVE_DECL__GETSHORT) || HAVE_DECL__GETSHORT == 0 || \
|
||||||
|
!defined(HAVE_DECL__GETLONG) || HAVE_DECL__GETLONG == 0
|
||||||
|
#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.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef HAVE__GETSHORT
|
|
||||||
static u_int16_t
|
static u_int16_t
|
||||||
_getshort(const u_char *msgp)
|
_getshort(const u_char *msgp)
|
||||||
{
|
{
|
||||||
@ -122,11 +129,7 @@ _getshort(const u_char *msgp)
|
|||||||
GETSHORT(u, msgp);
|
GETSHORT(u, msgp);
|
||||||
return (u);
|
return (u);
|
||||||
}
|
}
|
||||||
#elif defined(HAVE_DECL__GETSHORT) && (HAVE_DECL__GETSHORT == 0)
|
|
||||||
u_int16_t _getshort(const u_char *);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef HAVE__GETLONG
|
|
||||||
static u_int32_t
|
static u_int32_t
|
||||||
_getlong(const u_char *msgp)
|
_getlong(const u_char *msgp)
|
||||||
{
|
{
|
||||||
@ -135,8 +138,6 @@ _getlong(const u_char *msgp)
|
|||||||
GETLONG(u, msgp);
|
GETLONG(u, msgp);
|
||||||
return (u);
|
return (u);
|
||||||
}
|
}
|
||||||
#elif defined(HAVE_DECL__GETLONG) && (HAVE_DECL__GETLONG == 0)
|
|
||||||
u_int32_t _getlong(const u_char *);
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* ************** */
|
/* ************** */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user