1
0
mirror of https://github.com/ericonr/sndio.git synced 2024-02-18 04:45:21 -06:00
sndio/bsd-compat/bsd-compat.h
2012-10-29 18:08:36 +01:00

25 lines
584 B
C

#ifndef __packed
#define __packed __attribute__((packed))
#endif
#ifndef HAVE_LETOH
#include <byteswap.h>
#include <endian.h>
#if __BYTE_ORDER == __LITTLE_ENDIAN
#define htole16(x) (x)
#define htole32(x) (x)
#define letoh16(x) (x)
#define letoh32(x) (x)
#else
#define htole16(x) bswap_16(x)
#define htole32(x) bswap_32(x)
#define letoh16(x) bswap_16(x)
#define letoh32(x) bswap_32(x)
#endif
#endif
int issetugid(void);
size_t strlcpy(char *, const char *, size_t);
size_t strlcat(char *, const char *, size_t);
long long strtonum(const char *, long long, long long, const char **);