VSF Documented
SDL_endian.h
Go to the documentation of this file.
1/*****************************************************************************
2 * Copyright(C)2009-2022 by VSF Team *
3 * *
4 * Licensed under the Apache License, Version 2.0 (the "License"); *
5 * you may not use this file except in compliance with the License. *
6 * You may obtain a copy of the License at *
7 * *
8 * http://www.apache.org/licenses/LICENSE-2.0 *
9 * *
10 * Unless required by applicable law or agreed to in writing, software *
11 * distributed under the License is distributed on an "AS IS" BASIS, *
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. *
13 * See the License for the specific language governing permissions and *
14 * limitations under the License. *
15 * *
16 ****************************************************************************/
17
18#ifndef __VSF_SDL2_ENDIAN_H__
19#define __VSF_SDL2_ENDIAN_H__
20
21/*============================ INCLUDES ======================================*/
22
23#include "../../vsf_sdl2_cfg.h"
24
25#if VSF_USE_SDL2 == ENABLED
26
27#include "hal/arch/vsf_arch.h"
28#include "SDL_stdinc.h"
29
30#include "begin_code.h"
31
32#ifdef __cplusplus
33extern "C" {
34#endif
35
36/*============================ MACROS ========================================*/
37
38#define SDL_BYTEORDER __BYTE_ORDER
39#define SDL_LIL_ENDIAN __LITTLE_ENDIAN
40#define SDL_BIG_ENDIAN __BIG_ENDIAN
41
42
43
44
45#define SDL_Swap16 bswap_16
46#define SDL_Swap32 bswap_32
47#define SDL_Swap64 bswap_64
48
49#define SDL_SwapLE16 cpu_to_le16
50#define SDL_SwapLE32 cpu_to_le32
51#define SDL_SwapLE64 cpu_to_le64
52#define SDL_SwapBE16 cpu_to_be16
53#define SDL_SwapBE32 cpu_to_be32
54#define SDL_SwapBE64 cpu_to_be64
55
56/*============================ MACROFIED FUNCTIONS ===========================*/
57/*============================ TYPES =========================================*/
58/*============================ GLOBAL VARIABLES ==============================*/
59/*============================ LOCAL VARIABLES ===============================*/
60/*============================ PROTOTYPES ====================================*/
61
62
63#ifdef __cplusplus
64}
65#endif
66#include "close_code.h"
67
68#endif // VSF_USE_SDL2
69#endif // __VSF_SDL2_ENDIAN_H__
70/* EOF */