diff --git a/workbench/network/common/include/sys/_types.h b/workbench/network/common/include/sys/_types.h index 499d7f91d7..33b0a2e03d 100644 --- a/workbench/network/common/include/sys/_types.h +++ b/workbench/network/common/include/sys/_types.h @@ -32,75 +32,42 @@ #include /* - * Basic types upon which most other types are built. - * - * Note: It would be nice to simply use the compiler-provided __FOO_TYPE__ - * macros. However, in order to do so we have to check that those match the - * previous typedefs exactly (not just that they have the same size) since any - * change would be an ABI break. For example, changing `long` to `long long` - * results in different C++ name mangling. + * Basic types upon which other BSD types are built. + * Use AROS provided definitions. */ -typedef signed char __int8_t; -typedef unsigned char __uint8_t; -typedef short __int16_t; -typedef unsigned short __uint16_t; -typedef int __int32_t; -typedef unsigned int __uint32_t; -#if __SIZEOF_LONG__ == 8 -typedef long __int64_t; -typedef unsigned long __uint64_t; -#elif __SIZEOF_LONG__ == 4 -__extension__ -typedef long long __int64_t; -__extension__ -typedef unsigned long long __uint64_t; -#else -#error unsupported long size -#endif +typedef signed AROS_8BIT_TYPE __int8_t; +typedef unsigned AROS_8BIT_TYPE __uint8_t; +typedef signed AROS_16BIT_TYPE __int16_t; +typedef unsigned AROS_16BIT_TYPE __uint16_t; +typedef signed AROS_32BIT_TYPE __int32_t; +typedef unsigned AROS_32BIT_TYPE __uint32_t; +typedef signed AROS_64BIT_TYPE __int64_t; +typedef unsigned AROS_64BIT_TYPE __uint64_t; -typedef __int8_t __int_least8_t; -typedef __int16_t __int_least16_t; -typedef __int32_t __int_least32_t; -typedef __int64_t __int_least64_t; -typedef __int64_t __intmax_t; -typedef __uint8_t __uint_least8_t; -typedef __uint16_t __uint_least16_t; -typedef __uint32_t __uint_least32_t; -typedef __uint64_t __uint_least64_t; -typedef __uint64_t __uintmax_t; +typedef __int8_t __int_least8_t; +typedef __int16_t __int_least16_t; +typedef __int32_t __int_least32_t; +typedef __int64_t __int_least64_t; +typedef __int64_t __intmax_t; +typedef __uint8_t __uint_least8_t; +typedef __uint16_t __uint_least16_t; +typedef __uint32_t __uint_least32_t; +typedef __uint64_t __uint_least64_t; +typedef __uint64_t __uintmax_t; -#if __WORDSIZE == 64 -typedef __int64_t __intptr_t; -typedef __int64_t __intfptr_t; -typedef __uint64_t __uintptr_t; -typedef __uint64_t __uintfptr_t; -typedef __uint64_t __vm_offset_t; -typedef __uint64_t __vm_size_t; -#elif __WORDSIZE == 32 -typedef __int32_t __intptr_t; -typedef __int32_t __intfptr_t; -typedef __uint32_t __uintptr_t; -typedef __uint32_t __uintfptr_t; -typedef __uint32_t __vm_offset_t; -typedef __uint32_t __vm_size_t; -#else -#error unsupported pointer size -#endif - -#if __SIZEOF_SIZE_T__ == 8 -typedef __uint64_t __size_t; /* sizeof() */ -typedef __int64_t __ssize_t; /* byte count or error */ -#elif __SIZEOF_SIZE_T__ == 4 -typedef __uint32_t __size_t; /* sizeof() */ -typedef __int32_t __ssize_t; /* byte count or error */ -#else -#error unsupported size_t size -#endif +typedef signed AROS_INTPTR_TYPE __intptr_t; +typedef signed AROS_INTPTR_TYPE __intfptr_t; +typedef unsigned AROS_INTPTR_TYPE __uintptr_t; +typedef unsigned AROS_INTPTR_TYPE __uintfptr_t; +typedef unsigned AROS_INTPTR_TYPE __vm_offset_t; +typedef unsigned AROS_INTPTR_TYPE __vm_size_t; +typedef unsigned AROS_INTPTR_TYPE __size_t; +typedef signed AROS_INTPTR_TYPE __ssize_t; /* * Standard type definitions. */ -typedef __uint8_t __sa_family_t; -typedef __uint32_t __socklen_t; +typedef unsigned AROS_8BIT_TYPE __sa_family_t; +typedef unsigned AROS_32BIT_TYPE __socklen_t; #endif /* !_SYS__TYPES_H_ */ diff --git a/workbench/network/common/include/sys/socket.h b/workbench/network/common/include/sys/socket.h index e1a2d0808c..bea89dbafa 100644 --- a/workbench/network/common/include/sys/socket.h +++ b/workbench/network/common/include/sys/socket.h @@ -60,79 +60,51 @@ */ #if __BSD_VISIBLE #ifndef _GID_T_DECLARED -#if defined(__AROS__) #include -#else -typedef __gid_t gid_t; -#endif -#define _GID_T_DECLARED +#define _GID_T_DECLARED #endif #ifndef _OFF_T_DECLARED -#if defined(__AROS__) #include -#else -typedef __off_t off_t; -#endif -#define _OFF_T_DECLARED +#define _OFF_T_DECLARED #endif #ifndef _PID_T_DECLARED -#if defined(__AROS__) #include -#else -typedef __pid_t pid_t; -#endif -#define _PID_T_DECLARED +#define _PID_T_DECLARED #endif #endif #ifndef _SA_FAMILY_T_DECLARED -#if defined(__AROS__) #include -#else -typedef __sa_family_t sa_family_t; -#endif -#define _SA_FAMILY_T_DECLARED +#define _SA_FAMILY_T_DECLARED #endif #ifndef _SOCKLEN_T_DECLARED -#if defined(__AROS__) #include -#else -typedef __socklen_t socklen_t; -#endif -#define _SOCKLEN_T_DECLARED +#define _SOCKLEN_T_DECLARED #endif #ifndef _SSIZE_T_DECLARED -#if defined(__AROS__) #include -#else -typedef __ssize_t ssize_t; -#endif -#define _SSIZE_T_DECLARED +#define _SSIZE_T_DECLARED #endif #if __BSD_VISIBLE #ifndef _UID_T_DECLARED -#if defined(__AROS__) #include -#else -typedef __uid_t uid_t; -#endif -#define _UID_T_DECLARED +#define _UID_T_DECLARED #endif #endif #ifndef _UINT32_T_DECLARED -typedef __uint32_t uint32_t; -#define _UINT32_T_DECLARED +#include +#define _UINT32_T_DECLARED #endif #ifndef _UINTPTR_T_DECLARED -typedef __uintptr_t uintptr_t; -#define _UINTPTR_T_DECLARED +#include +#define _UINTPTR_T_DECLARED #endif /* @@ -730,63 +702,4 @@ struct splice { #endif /* __BSD_VISIBLE */ -#ifndef _KERNEL - -#if defined(_FORTIFY_SOURCE) && _FORTIFY_SOURCE > 0 -#include -#endif - -#if !defined(__AROS__) -#include - -__BEGIN_DECLS -int accept(int, struct sockaddr * __restrict, socklen_t * __restrict); -int bind(int, const struct sockaddr *, socklen_t); -int connect(int, const struct sockaddr *, socklen_t); -#if __BSD_VISIBLE -int accept4(int, struct sockaddr * __restrict, socklen_t * __restrict, int); -int bindat(int, int, const struct sockaddr *, socklen_t); -int connectat(int, int, const struct sockaddr *, socklen_t); -#endif -int getpeername(int, struct sockaddr * __restrict, socklen_t * __restrict); -int getsockname(int, struct sockaddr * __restrict, socklen_t * __restrict); -int getsockopt(int, int, int, void * __restrict, socklen_t * __restrict); -int listen(int, int); -ssize_t recv(int, void *, size_t, int); -ssize_t recvfrom(int, void *, size_t, int, struct sockaddr * __restrict, socklen_t * __restrict); -ssize_t recvmsg(int, struct msghdr *, int); -#if __BSD_VISIBLE -struct timespec; -ssize_t recvmmsg(int, struct mmsghdr * __restrict, size_t, int, - const struct timespec * __restrict); -#endif -ssize_t send(int, const void *, size_t, int); -ssize_t sendto(int, const void *, - size_t, int, const struct sockaddr *, socklen_t); -ssize_t sendmsg(int, const struct msghdr *, int); -#if __BSD_VISIBLE -int sendfile(int, int, off_t, size_t, struct sf_hdtr *, off_t *, int); -ssize_t sendmmsg(int, struct mmsghdr * __restrict, size_t, int); -int setfib(int); -#endif -int setsockopt(int, int, int, const void *, socklen_t); -int shutdown(int, int); -int sockatmark(int); -int socket(int, int, int); -int socketpair(int, int, int, int *); -__END_DECLS - -#endif /* !_KERNEL */ - -#ifdef _KERNEL -struct socket; - -int so_options_get(const struct socket *); -void so_options_set(struct socket *, int); - -int so_error_get(const struct socket *); -void so_error_set(struct socket *, int); -#endif /* _KERNEL */ -#endif - #endif /* !_SYS_SOCKET_H_ */