iconv/loop.c: Fix -Wundef warning with !_STRING_ARCH_unaligned

If code is required to handle the unaligned case then loop.c includes
itself and relies on the #undefs at the end of the file to avoid
outputting two copies of LOOPFCT and gconv_btowc. However
MAX_NEEDED_INPUT is tested with #if so this causes a warning.
Reorder the code so that the function definitions are in an #else
block to make the behaviour clearer and fix the warning.

Verified that code is unchanged on x86_64 and arm.

ChangeLog:

2014-07-17  Will Newton  <will.newton@linaro.org>

	* iconv/loop.c: Move definition of LOOPFCT and gconv_btowc
	into an #else block.
This commit is contained in:
Will Newton 2014-07-10 09:18:03 +01:00
parent 37fccd4192
commit 32bead5b6d
2 changed files with 34 additions and 30 deletions

View File

@ -1,3 +1,8 @@
2014-07-17 Will Newton <will.newton@linaro.org>
* iconv/loop.c: Move definition of LOOPFCT and gconv_btowc
into an #else block.
2014-07-16 Roland McGrath <roland@hack.frob.com>
* sysdeps/arm/preconfigure.ac: Apply EABI sanity check to arm*, not

View File

@ -354,9 +354,7 @@ FCTNAME (LOOPFCT) (struct __gconv_step *step,
# define DEFINE_UNALIGNED
# include "loop.c"
# undef DEFINE_UNALIGNED
#endif
#else
# if MAX_NEEDED_INPUT > 1
# define SINGLE(fct) SINGLE2 (fct)
# define SINGLE2(fct) fct##_single
@ -497,6 +495,7 @@ gconv_btowc (struct __gconv_step *step, unsigned char c)
# define FROM_ONEBYTE gconv_btowc
# endif
#endif
/* We remove the macro definitions so that we can include this file again
for the definition of another function. */