aboutsummaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorIgor Grinberg <grinberg@compulab.co.il>2011-11-27 21:57:38 +0000
committerWolfgang Denk <wd@denx.de>2011-12-06 22:11:25 +0100
commit73f94ed403a24496d30d4a65afcf2a2d1c0c58d1 (patch)
tree3f998ae6aa414e1da55df70f672073f7de7a2335 /tools
parent734329f9644273e35716c11292f82723884c628e (diff)
tools/envcrc: fix compile breakage
When ENV_IS_EMBEDDED is not set, but CONFIG_BUILD_ENVCRC is set, the environment.h file does not get included resulting in unrecognized env_t type. Fix this by moving the include directive. Reported-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Igor Grinberg <grinberg@compulab.co.il> Tested-by: Mike Frysinger <vapier@gentoo.org>
Diffstat (limited to 'tools')
-rw-r--r--tools/envcrc.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/tools/envcrc.c b/tools/envcrc.c
index 111d9f628..51e3f54a3 100644
--- a/tools/envcrc.c
+++ b/tools/envcrc.c
@@ -61,7 +61,6 @@
#endif /* CONFIG_ENV_IS_IN_FLASH */
#if defined(ENV_IS_EMBEDDED) && !defined(CONFIG_BUILD_ENVCRC)
-# include <environment.h>
# define CONFIG_BUILD_ENVCRC 1
#endif
@@ -74,13 +73,14 @@
#define ENV_SIZE (CONFIG_ENV_SIZE - ENV_HEADER_SIZE)
-extern uint32_t crc32 (uint32_t, const unsigned char *, unsigned int);
-
#ifdef CONFIG_BUILD_ENVCRC
+# include <environment.h>
extern unsigned int env_size;
extern env_t environment;
#endif /* CONFIG_BUILD_ENVCRC */
+extern uint32_t crc32 (uint32_t, const unsigned char *, unsigned int);
+
int main (int argc, char **argv)
{
#ifdef CONFIG_BUILD_ENVCRC