KallistiOS git master
Independent SDK for the Sega Dreamcast
Loading...
Searching...
No Matches
byteorder.h
Go to the documentation of this file.
1/* KallistiOS ##version##
2
3 arch/dreamcast/include/arch/byteorder.h
4 Copyright (C) 2015 Lawrence Sebald
5
6*/
7
8#ifndef __ARCH_BYTEORDER_H
9#define __ARCH_BYTEORDER_H
10
11#include <kos/cdefs.h>
12__BEGIN_DECLS
13
14/* Bring in the newlib header that defines the BYTE_ORDER macro */
15#include <machine/endian.h>
16
17__depr("arch_swap16() is deprecated, use __builtin_bswap16().")
18static inline uint16_t arch_swap16(uint16_t x) {
19 return __builtin_bswap16(x);
20}
21
22__depr("arch_swap32() is deprecated, use __builtin_bswap32().")
23static inline uint32_t arch_swap32(uint32_t x) {
24 return __builtin_bswap32(x);
25}
26
27__depr("arch_ntohs() is deprecated, use ntohs() from <arpa/inet.h>")
28static inline uint16_t arch_ntohs(uint16_t x) {
29 return __builtin_bswap16(x);
30}
31
32__depr("arch_ntohl() is deprecated, use ntohl() from <arpa/inet.h>")
33static inline uint32_t arch_ntohl(uint32_t x) {
34 return __builtin_bswap32(x);
35}
36
37__depr("arch_htons() is deprecated, use htons() from <arpa/inet.h>")
38static inline uint16_t arch_htons(uint16_t x) {
39 return __builtin_bswap16(x);
40}
41
42__depr("arch_htonl() is deprecated, use htonl() from <arpa/inet.h>")
43static inline uint32_t arch_htonl(uint32_t x) {
44 return __builtin_bswap32(x);
45}
46
47__END_DECLS
48
49#endif /* !__ARCH_BYTEORDER_H */
static uint32_t arch_ntohl(uint32_t x)
Definition byteorder.h:33
static uint32_t arch_htonl(uint32_t x)
Definition byteorder.h:43
static uint32_t arch_swap32(uint32_t x)
Definition byteorder.h:23
static uint16_t arch_htons(uint16_t x)
Definition byteorder.h:38
static uint16_t arch_ntohs(uint16_t x)
Definition byteorder.h:28
static uint16_t arch_swap16(uint16_t x)
Definition byteorder.h:18
Various common macros used throughout the codebase.
#define inline
Definition cdefs.h:107
static GLint x
Definition scissor.c:38