3rdparty/licenseReport: Add seperate LGPL checks
[haiku.git] / src / add-ons / media / plugins / asf_reader / libasf / compat.h
blob5a95630216b20d8732964fc37612ecbe4d776720
1 /* libasf - An Advanced Systems Format media file parser
2 * Copyright (C) 2006-2010 Juho Vähä-Herttua
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 #ifndef COMPAT_H
20 #define COMPAT_H
22 #ifdef __GNUC__
23 # define INLINE __inline__
24 #else
25 # define INLINE
26 #endif
28 static INLINE uint16_t
29 GetWLE(const void *pointer)
31 const uint8_t *data = pointer;
32 return ((uint16_t)data[1] << 8) |
33 ((uint16_t)data[0]);
36 static INLINE uint32_t
37 GetDWLE(const void *pointer)
39 const uint8_t *data = pointer;
40 return ((uint32_t)data[3] << 24) |
41 ((uint32_t)data[2] << 16) |
42 ((uint32_t)data[1] << 8) |
43 ((uint32_t)data[0]);
46 static INLINE uint64_t
47 GetQWLE(const void *pointer)
49 const uint8_t *data = pointer;
50 return ((uint64_t)data[7] << 56) |
51 ((uint64_t)data[6] << 48) |
52 ((uint64_t)data[5] << 40) |
53 ((uint64_t)data[4] << 32) |
54 ((uint64_t)data[3] << 24) |
55 ((uint64_t)data[2] << 16) |
56 ((uint64_t)data[1] << 8) |
57 ((uint64_t)data[0]);
60 #endif