Welcome to mirror list, hosted at ThFree Co, Russian Federation.

ByteSwap.h « src - github.com/mumble-voip/mumble.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 54521ef85a67fa56fc4863abfb66a41a287af74e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// Copyright 2005-2019 The Mumble Developers. All rights reserved.
// Use of this source code is governed by a BSD-style license
// that can be found in the LICENSE file at the root of the
// Mumble source tree or at <https://www.mumble.info/LICENSE>.

#ifndef MUMBLE_BYTESWAP_H_
#define MUMBLE_BYTESWAP_H_

#if Q_BYTE_ORDER == Q_BIG_ENDIAN
#define SWAP64(x) (x)
#else
#if defined(__x86_64__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
#define SWAP64(x) __builtin_bswap64(x)
#else
#define SWAP64(x) qbswap<quint64>(x)
#endif
#endif

#endif