blob: 12cbae7d6feba90572e41d4fb1b7dbf108b2bf53 [file] [log] [blame]
Stefan Reinauer6ed57e52010-04-24 01:15:17 +02001/*
2 * Decompression utility for AMI BIOSes.
3 *
4 * Copyright (C) 2009-2010 coresystems GmbH
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2, or (at your option)
9 * any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; see the file COPYING. If not, write to
18 * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
19 */
20
21#ifdef __APPLE__
22void *memmem(const void *haystack, size_t haystacklen, const void *needle, size_t needlelen);
23size_t strnlen(const char *s, size_t maxlen);
24char *strndup(const char *s, size_t n);
25#endif
26
27// "endian.h" does not exist on (at least) these platforms:
28// FreeBSD, NetBSD, OSF/Tru64, HP-UX 10, Solaris, A/UX, Ultrix and
29// AIX. It exists on Linux and Irix
30#ifdef __linux__
31#include <endian.h>
32#endif
33
34#if !defined(le32toh) || !defined(le16toh)
35#if BYTE_ORDER == LITTLE_ENDIAN
36#define le32toh(x) (x)
37#define le16toh(x) (x)
38#else
39#include <byteswap.h>
40#define le32toh(x) bswap_32(x)
41#define le16toh(x) bswap_16(x)
42#endif
43#endif
44
45