cctools
cctools_endian.h
Go to the documentation of this file.
1/*
2Copyright (C) 2022 The University of Notre Dame
3This software is distributed under the GNU General Public License.
4See the file COPYING for details.
5*/
6
7#ifndef CCTOOLS_ENDIAN_H
8#define CCTOOLS_ENDIAN_H
9
10#include <stdint.h>
11
12
24uint64_t cctools_htonll(uint64_t hostlonglong);
25uint64_t cctools_ntohll(uint64_t netlonglong);
26
27/* Some platforms provide their own htonll/ntohll functions
28 * (or #define them to a byte swap function). We transparently
29 * modify the linker namespace to point to our implementation.
30 */
31#undef htonll
32#undef ntohll
33#define htonll(x) cctools_htonll(x)
34#define ntohll(x) cctools_htonll(x)
35
36#endif