blob: 9b940e6e00c8bc1dfacc72daee4294efb573d115 [file] [log] [blame]
The Android Open Source Projectcbb10112009-03-03 19:31:44 -08001/*
2 * Copyright (C) 2006 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
Elliott Hughesb6e7de22019-09-18 08:02:10 -070017#pragma once
The Android Open Source Projectcbb10112009-03-03 19:31:44 -080018
Elliott Hughesb6e7de22019-09-18 08:02:10 -070019/*
20 * If you're looking for a portable <endian.h> that's available on Android,
21 * Linux, macOS, and Windows, see <android-base/endian.h> instead.
22 *
23 * Nothing in this file is useful because all supported Android ABIs are
24 * little-endian and all our code that runs on the host assumes that the host is
25 * also little-endian. What pretense at big-endian support exists is completely
26 * untested and unlikely to actually work.
27 */
The Android Open Source Projectcbb10112009-03-03 19:31:44 -080028
29#include <stdint.h>
30#include <sys/types.h>
Elliott Hughesadbf4422015-07-29 17:45:24 -070031#if defined(_WIN32)
The Android Open Source Projectcbb10112009-03-03 19:31:44 -080032#include <winsock2.h>
33#else
34#include <netinet/in.h>
35#endif
36
Elliott Hughesb6e7de22019-09-18 08:02:10 -070037/* TODO: move this cruft to frameworks/. */
The Android Open Source Projectcbb10112009-03-03 19:31:44 -080038
Elliott Hughesb6e7de22019-09-18 08:02:10 -070039#define dtohl(x) (x)
40#define dtohs(x) (x)
41#define htodl(x) (x)
42#define htods(x) (x)
Joe Onorato62a381b2009-05-15 09:07:06 -040043
Joe Onorato62a381b2009-05-15 09:07:06 -040044#define fromlel(x) (x)
Joe Onorato62a381b2009-05-15 09:07:06 -040045#define tolel(x) (x)