// Copyright 2021 The Fuchsia Authors. All rights reserved. | |
// Use of this source code is governed by a BSD-style license that can be | |
// found in the LICENSE file. | |
#include "util.h" | |
uint64_t htonll(uint64_t val) { | |
#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ | |
return __builtin_bswap64(val); | |
#else | |
return val; | |
#endif | |
} | |
uint64_t ntohll(uint64_t val) { return htonll(val); } |