mirror of
https://github.com/openssh/openssh-portable.git
synced 2026-11-06 05:16:43 +00:00
provide a htobe32() replacement
This commit is contained in:
2 files changed
+10
-3
No files matched your search
+1
-1
@@ -588,7 +588,7 @@ for include in sys/queue.h sys/tree.h; do
|
||||
esac >"$header"
|
||||
done
|
||||
|
||||
AC_CHECK_DECLS([le32toh, le64toh, htole64], [], [], [
|
||||
AC_CHECK_DECLS([le32toh, le64toh, htole64, htobe32], [], [], [
|
||||
#ifdef HAVE_SYS_TYPES_H
|
||||
# include <sys/types.h>
|
||||
#endif
|
||||
|
||||
@@ -663,7 +663,8 @@ struct winsize {
|
||||
|
||||
#if (defined(HAVE_DECL_LE32TOH) && HAVE_DECL_LE32TOH == 0) || \
|
||||
(defined(HAVE_DECL_LE64TOH) && HAVE_DECL_LE64TOH == 0) || \
|
||||
(defined(HAVE_DECL_HTOLE64) && HAVE_DECL_HTOLE64 == 0)
|
||||
(defined(HAVE_DECL_HTOLE64) && HAVE_DECL_HTOLE64 == 0) || \
|
||||
(defined(HAVE_DECL_HTOBE32) && HAVE_DECL_HTOBE32 == 0)
|
||||
# define openssh_swap32(v) \
|
||||
(uint32_t)(((uint32_t)(v) & 0xff) << 24 | \
|
||||
((uint32_t)(v) & 0xff00) << 8 | \
|
||||
@@ -687,7 +688,10 @@ struct winsize {
|
||||
# endif
|
||||
# if defined(HAVE_DECL_HTOLE64) && HAVE_DECL_HTOLE64 == 0
|
||||
# define htole64(v) (openssh_swap64(v))
|
||||
# endif
|
||||
# endif
|
||||
# if defined(HAVE_DECL_HTOBE32) && HAVE_DECL_HTOBE32 == 0
|
||||
# define htobe32(v) ((uint32_t)v)
|
||||
# endif
|
||||
# else
|
||||
# if defined(HAVE_DECL_LE32TOH) && HAVE_DECL_LE32TOH == 0
|
||||
# define le32toh(v) ((uint32_t)v)
|
||||
@@ -698,6 +702,9 @@ struct winsize {
|
||||
# if defined(HAVE_DECL_HTOLE64) && HAVE_DECL_HTOLE64 == 0
|
||||
# define htole64(v) ((uint64_t)v)
|
||||
# endif
|
||||
# if defined(HAVE_DECL_HTOBE32) && HAVE_DECL_HTOBE32 == 0
|
||||
# define htobe32(v) (openssh_swap32(v))
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
|
||||
|
||||
Reference in new issue
Block a user