Re: [PATCH] Current GNU libc: Declare htonl() via <arpa/inet.h>
Izumi Tsutsui <[email protected]> Mon, 28 Oct 2024 22:19:40 +0900
| Newsgroups | gmane.os.netbsd.devel.toolchain |
|---|---|
| Message-ID | <[email protected]> |
> | Would be nice if somebody would comment on this (verified to not break
> | a build on NetBSD-current) or commit it.
>
> Looks reasonable to me, I will get to it later tonight.
Maybe we can replace it with N_SETMAGIC() in <sys/exec_aout.h>
(that already uses htobe32()):
---
#define N_SETMAGIC(ex,mag,mid,flag) \
((ex).a_midmag = htobe32((uint32_t) \
((((flag)&0x3f)<<26)|(((mid)&0x03ff)<<16)|(((mag)&0xffff)))))
---
We should also update another htonl() leftover in comment
in <sys/exec_aout.h>?
---
/*
* Header prepended to each a.out file.
* only manipulate the a_midmag field via the
* N_SETMAGIC/N_GET{MAGIC,MID,FLAG} macros below.
*/
struct exec {
unsigned long a_midmag; /* htonl(flags<<26 | mid<<16 | magic) */
unsigned long a_text; /* text segment size */
---
Izumi Tsutsui