PortableEndian.hpp
Go to the documentation of this file.
1#ifndef PORTABLE_ENDIAN_H__
2#define PORTABLE_ENDIAN_H__
3
4#if (defined(_WIN16) || defined(_WIN32) || defined(_WIN64)) && !defined(__WINDOWS__)
5
6# define __WINDOWS__
7
8#endif
9
10#if defined(__WINDOWS__)
11#define __builtin_bswap16(x) _byteswap_ushort((x))
12#define __builtin_bswap32(x) _byteswap_ulong((x))
13#define __builtin_bswap64(x) _byteswap_uint64((x))
14#endif
15
16#endif // PORTABLE_ENDIAN_H__