OpenVPN 3 Core Library
Loading...
Searching...
No Matches
endian_platform.hpp
Go to the documentation of this file.
1// OpenVPN -- An application to securely tunnel IP networks
2// over a single port, with support for SSL/TLS-based
3// session authentication and key exchange,
4// packet encryption, packet authentication, and
5// packet compression.
6//
7// Copyright (C) 2012- OpenVPN Inc.
8//
9// SPDX-License-Identifier: MPL-2.0 OR AGPL-3.0-only WITH openvpn3-openssl-exception
10//
11
12#pragma once
13
15
16// test for machine endiannes
17#if defined(__BYTE_ORDER__) && defined(__ORDER_BIG_ENDIAN__) && defined(__ORDER_LITTLE_ENDIAN__)
18#if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
19#define OPENVPN_BIG_ENDIAN
20#elif __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
21#define OPENVPN_LITTLE_ENDIAN
22#endif
23#elif defined(_WIN32)
24#define OPENVPN_LITTLE_ENDIAN // assume that Windows is always little-endian
25#endif