diff options
author | Petr Salinger <Petr.Salinger@seznam.cz> | 2007-01-09 13:26:33 +0000 |
---|---|---|
committer | Guillem Jover <guillem@hadrons.org> | 2008-05-06 08:56:37 +0300 |
commit | ac32eefec50a1f9a6c4a75b7467731fc99a0a109 (patch) | |
tree | 4ef4329f5995522ab9ea03ab82c32bb530bce54d | |
parent | 2ef27385c5a4d757f19a07096bbcc2d0a3e36d85 (diff) | |
download | libbsd-ac32eefec50a1f9a6c4a75b7467731fc99a0a109.tar.gz |
bsd/bsd.h: Cleanup
-rw-r--r-- | include/bsd/bsd.h | 54 |
1 files changed, 5 insertions, 49 deletions
diff --git a/include/bsd/bsd.h b/include/bsd/bsd.h index 6218e4c..0367694 100644 --- a/include/bsd/bsd.h +++ b/include/bsd/bsd.h @@ -10,25 +10,17 @@ #include <bsd/string.h> #include <bsd/queue.h> #include <bsd/ip_icmp.h> +#include <time.h> /* * Stuff to be moved. */ -#include <sys/types.h> - -typedef char * __va_list; -#if !defined(__GNUC_VA_LIST) -#define __GNUC_VA_LIST -typedef __va_list __gnuc_va_list; /* compatibility w/ GNU headers */ -#endif +#define __BSD_VISIBLE 1 +#define __XSI_VISIBLE 1 +#include <sys/limits.h> -extern time_t time (time_t *__timer) __THROW; - -struct __sbuf { - unsigned char *_base; - int _size; -}; +#include <sys/types.h> #define MLD_LISTENER_QUERY 130 /* multicast listener query */ #define MLD_LISTENER_REPORT 131 /* multicast listener report */ @@ -46,40 +38,4 @@ struct __sbuf { #define ND_REDIRECT_ONLINK 0 /* redirect to an on-link node */ #define ND_REDIRECT_ROUTER 1 /* redirect to a better router */ -/* - * Limits. - */ - -#define GID_MAX UINT_MAX /* max value for a gid_t */ -#define UID_MAX UINT_MAX /* max value for a uid_t */ - -#define SIZE_T_MAX __SIZE_T_MAX /* max value for a size_t */ - -// This depends on the arch, so this must be ported in other manner -#define __SIZE_T_MAX __UINT_MAX /* max value for a size_t */ -#define __UINT_MAX 0xffffffffU /* max value for an unsigned int */ - -/* - * Endianness. - */ - -#define HTONL(x) (x) = htonl((__uint32_t)(x)) - -#if _BYTE_ORDER == _LITTLE_ENDIAN -#define be64toh(x) bswap64((x)) -#else /* _BYTE_ORDER != _LITTLE_ENDIAN */ -#define be64toh(x) ((uint64_t)(x)) -#endif /* _BYTE_ORDER == _LITTLE_ENDIAN */ - -#define bswap64(x) __bswap64(x) - -static __inline __uint64_t -__bswap64(__uint64_t _x) -{ - return ((_x >> 56) | ((_x >> 40) & 0xff00) | ((_x >> 24) & 0xff0000) | - ((_x >> 8) & 0xff000000) | ((_x << 8) & ((__uint64_t)0xff << 32)) | - ((_x << 24) & ((__uint64_t)0xff << 40)) | - ((_x << 40) & ((__uint64_t)0xff << 48)) | ((_x << 56))); -} - #endif |