These typedefs are commonly used in BSD code. Most libc libraries define
them by default or for _DEFAULT_SOURCE files. Because unikraft is
usually closer to Linux, this adopts the later approach.
Signed-off-by: Marco Schlumpp <marco.schlumpp@gmail.com>
Reviewed-by: Razvan Deaconescu <razvand@unikraft.io>
Reviewed-by: Marc Rittinghaus <marc.rittinghaus@unikraft.io>
Approved-by: Marc Rittinghaus <marc.rittinghaus@unikraft.io>
Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Closes: #627
typedef __sa_family_t sa_family_t;
#define __DEFINED_sa_family_t
#endif
+
+#if defined(__NEED_BSD_TYPES) && !defined(__DEFINED_BSD_TYPES)
+typedef unsigned char u_char;
+typedef unsigned short u_short;
+typedef unsigned int u_int;
+typedef unsigned long u_long;
+#define __DEFINED_BSD_TYPES
+#endif
extern "C" {
#endif
+#ifdef _DEFAULT_SOURCE
+#define __NEED_BSD_TYPES
+#endif
#define __NEED_size_t
#define __NEED_ssize_t
#define __NEED_off_t