FastEngine 0.9.3
A multiplayer oriented 2D engine made with Vulkan.
Loading...
Searching...
No Matches
fge_endian.hpp
1/*
2 * Copyright 2024 Guillaume Guillet
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#ifndef _FGE_ENDIAN_HPP_INCLUDED_
18#define _FGE_ENDIAN_HPP_INCLUDED_
19
20#include "FastEngine/fge_extern.hpp"
21#include <cstdint>
22
23namespace fge
24{
25
35FGE_API uint16_t SwapHostNetEndian_16(uint16_t n);
45FGE_API uint32_t SwapHostNetEndian_32(uint32_t n);
55FGE_API uint64_t SwapHostNetEndian_64(uint64_t n);
65FGE_API float SwapHostNetEndian_f(float n);
75FGE_API double SwapHostNetEndian_d(double n);
76
86FGE_API uint16_t SwapEndian_16(uint16_t n);
96FGE_API uint32_t SwapEndian_32(uint32_t n);
106FGE_API uint64_t SwapEndian_64(uint64_t n);
116FGE_API float SwapEndian_f(float n);
126FGE_API double SwapEndian_d(double n);
127
134FGE_API bool IsBigEndian();
135
136} // namespace fge
137
138#endif // _FGE_ENDIAN_HPP_INCLUDED_
FGE_API uint16_t SwapHostNetEndian_16(uint16_t n)
Swap the endianness of a 16-bit integer.
FGE_API double SwapHostNetEndian_d(double n)
Swap the endianness of a double.
FGE_API uint16_t SwapEndian_16(uint16_t n)
Swap the endianness of a 16-bit integer.
FGE_API uint64_t SwapHostNetEndian_64(uint64_t n)
Swap the endianness of a 64-bit integer.
FGE_API bool IsBigEndian()
Check if the endianness of the system is big endian.
FGE_API float SwapHostNetEndian_f(float n)
Swap the endianness of a float.
FGE_API float SwapEndian_f(float n)
Swap the endianness of a float.
FGE_API double SwapEndian_d(double n)
Swap the endianness of a double.
FGE_API uint64_t SwapEndian_64(uint64_t n)
Swap the endianness of a 64-bit integer.
FGE_API uint32_t SwapHostNetEndian_32(uint32_t n)
Swap the endianness of a 32-bit integer.
FGE_API uint32_t SwapEndian_32(uint32_t n)
Swap the endianness of a 32-bit integer.