diff --git a/src/header/netdb/cbindgen.toml b/src/header/netdb/cbindgen.toml index e6e6c1abbe..b031875f72 100644 --- a/src/header/netdb/cbindgen.toml +++ b/src/header/netdb/cbindgen.toml @@ -1,12 +1,12 @@ # netinet/in.h brings in sys/socket.h -sys_includes = ["netinet/in.h", "features.h"] +sys_includes = ["inttypes.h", "netinet/in.h", "features.h"] include_guard = "_RELIBC_NETDB_H" trailer = """ #ifndef _RELIBC_BITS_NETDB_H #define _RELIBC_BITS_NETDB_H #define h_errno (*__h_errno_location()) -#define h_addr h_addr_list[0] /* Address, for backward compatibility.*/ +#define h_addr h_addr_list[0] /* Address, for backward compatibility.*/ #endif // _RELIBC_BITS_NETDB_H """ diff --git a/src/header/netdb/mod.rs b/src/header/netdb/mod.rs index 424270b907..1d9941cbc5 100644 --- a/src/header/netdb/mod.rs +++ b/src/header/netdb/mod.rs @@ -27,7 +27,7 @@ use crate::{ platform::{ self, Pal, Sys, rlb::{Line, RawLineBuffer}, - types::{c_char, c_int, c_ulong, c_void}, + types::{c_char, c_int, c_void, uint32_t}, }, raw_cell::RawCell, }; @@ -62,7 +62,7 @@ pub struct netent { n_name: *mut c_char, /* official name of net */ n_aliases: *mut *mut c_char, /* alias list */ n_addrtype: c_int, /* net address type */ - n_net: c_ulong, /* network # */ + n_net: uint32_t, /* network # */ } /// See . @@ -512,7 +512,7 @@ pub unsafe extern "C" fn getnetent() -> *mut netent { .cast::(), n_aliases: net_aliases.as_mut_slice().as_mut_ptr(), n_addrtype: AF_INET, - n_net: c_ulong::from(NET_ADDR.unwrap()), + n_net: uint32_t::from(NET_ADDR.unwrap()), } }; (&raw mut NET_ENTRY).cast::()