2 * Copyright (C) 2005-2008 Team XBMC
4 * Copyright (C) 2008-2009 Andrej Stepanchuk
5 * Copyright (C) 2009-2010 Howard Chu
7 * This file is part of librtmp.
9 * librtmp is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU Lesser General Public License as
11 * published by the Free Software Foundation; either version 2.1,
12 * or (at your option) any later version.
14 * librtmp is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU Lesser General Public License
20 * along with librtmp see the file COPYING. If not, write to
21 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
22 * Boston, MA 02110-1301, USA.
23 * http://www.gnu.org/copyleft/lgpl.html
32 /* Windows is little endian only */
33 #define __LITTLE_ENDIAN 1234
34 #define __BIG_ENDIAN 4321
35 #define __BYTE_ORDER __LITTLE_ENDIAN
36 #define __FLOAT_WORD_ORDER __BYTE_ORDER
38 typedef unsigned char uint8_t;
42 #include <sys/param.h>
44 #if defined(BYTE_ORDER) && !defined(__BYTE_ORDER)
45 #define __BYTE_ORDER BYTE_ORDER
48 #if defined(BIG_ENDIAN) && !defined(__BIG_ENDIAN)
49 #define __BIG_ENDIAN BIG_ENDIAN
52 #if defined(LITTLE_ENDIAN) && !defined(__LITTLE_ENDIAN)
53 #define __LITTLE_ENDIAN LITTLE_ENDIAN
58 /* define default endianness */
59 #ifndef __LITTLE_ENDIAN
60 #define __LITTLE_ENDIAN 1234
64 #define __BIG_ENDIAN 4321
68 #warning "Byte order not defined on your system, assuming little endian!"
69 #define __BYTE_ORDER __LITTLE_ENDIAN
72 /* ok, we assume to have the same float word order and byte order if float word order is not defined */
73 #ifndef __FLOAT_WORD_ORDER
74 #warning "Float word order not defined, assuming the same as byte order!"
75 #define __FLOAT_WORD_ORDER __BYTE_ORDER
78 #if !defined(__BYTE_ORDER) || !defined(__FLOAT_WORD_ORDER)
79 #error "Undefined byte or float word order!"
82 #if __FLOAT_WORD_ORDER != __BIG_ENDIAN && __FLOAT_WORD_ORDER != __LITTLE_ENDIAN
83 #error "Unknown/unsupported float word order!"
86 #if __BYTE_ORDER != __BIG_ENDIAN && __BYTE_ORDER != __LITTLE_ENDIAN
87 #error "Unknown/unsupported byte order!"