From: Jean-Christophe PLAGNIOL-VILLARD Date: Sat, 16 Aug 2008 18:56:16 +0200 Subject: [U-Boot] [PATCH 1/1] add u-boot/types to simplify HOST support Message-ID: <1218905776-3096-1-git-send-email-plagnioj@jcrosoft.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de add fix MacOS HOST support Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD --- include/elf.h | 15 +------------ include/environment.h | 6 +---- include/image.h | 1 + include/libfdt_env.h | 3 +- include/u-boot/md5.h | 2 +- include/u-boot/types.h | 53 ++++++++++++++++++++++++++++++++++++++++++++++++ 6 files changed, 58 insertions(+), 22 deletions(-) create mode 100644 include/u-boot/types.h diff --git a/include/elf.h b/include/elf.h index a9839df..88d76bd 100644 --- a/include/elf.h +++ b/include/elf.h @@ -33,20 +33,7 @@ #ifndef _ELF_H #define _ELF_H -#if defined(__BEOS__) || \ - defined(__NetBSD__) || \ - defined(__FreeBSD__) || \ - defined(__sun__) || \ - defined(__APPLE__) -#include -#elif defined(__linux__) && defined(USE_HOSTCC) -#include -#elif defined(__WIN32__) -#include -typedef unsigned char uint8_t; -typedef unsigned short uint16_t; -typedef unsigned int uint32_t; -#endif +#include /* * This version doesn't work for 64-bit ABIs - Erik. diff --git a/include/environment.h b/include/environment.h index 481ea73..d9d75cb 100644 --- a/include/environment.h +++ b/include/environment.h @@ -84,11 +84,7 @@ # endif #endif /* CFG_ENV_IS_IN_NAND */ -#ifdef USE_HOSTCC -# include -#else -# include -#endif +#include #ifdef CFG_REDUNDAND_ENVIRONMENT # define ENV_HEADER_SIZE (sizeof(uint32_t) + 1) diff --git a/include/image.h b/include/image.h index 4b9c582..0f1a5f4 100644 --- a/include/image.h +++ b/include/image.h @@ -35,6 +35,7 @@ #include #include +#include #ifndef USE_HOSTCC #include diff --git a/include/libfdt_env.h b/include/libfdt_env.h index a7fd2f8..d5b1c12 100644 --- a/include/libfdt_env.h +++ b/include/libfdt_env.h @@ -21,12 +21,11 @@ #ifndef _LIBFDT_ENV_H #define _LIBFDT_ENV_H +#include #ifdef USE_HOSTCC -#include #include #else #include -#include #endif /* USE_HOSTCC */ #include diff --git a/include/u-boot/md5.h b/include/u-boot/md5.h index 8b44a7f..0e3f3bc 100644 --- a/include/u-boot/md5.h +++ b/include/u-boot/md5.h @@ -6,7 +6,7 @@ #ifndef _MD5_H #define _MD5_H -#include +#include struct MD5Context { __u32 buf[4]; diff --git a/include/u-boot/types.h b/include/u-boot/types.h new file mode 100644 index 0000000..e4afa98 --- /dev/null +++ b/include/u-boot/types.h @@ -0,0 +1,53 @@ +/* + * (C) Copyright 2008 Jean-Christophe PLAGNIOL-VILLARD + * + * + * See file CREDITS for list of people who contributed to this + * project. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + */ + +#ifndef __U_BOOT_TYPES_H__ +#define __U_BOOT_TYPES_H__ + +#ifndef USE_HOSTCC +#include +#else + +#if defined(__BEOS__) || \ + defined(__NetBSD__) || \ + defined(__FreeBSD__) || \ + defined(__sun__) || \ + defined(__APPLE__) +#include +/* sysv */ +typedef unsigned char unchar; +typedef unsigned short ushort; +typedef unsigned int uint; +typedef unsigned long ulong; + +#elif defined(__linux__) +#include +#elif defined(__WIN32__) +#include +typedef unsigned char uint8_t; +typedef unsigned short uint16_t; +typedef unsigned int uint32_t; +#endif +#endif /* USE_HOSTCC */ + +#endif /* __U_BOOT_TYPES_H__ */ -- 1.5.6.3