tests: use correct m32/mx32 st_mtime_nsec checks in tests/xstatx.c

* bootstrap: Add -DMPERS_IS_$(MPERS_NAME) to ARCH_MFLAGS.
* tests/xstatx.c [USE_ASM_STAT && STRUCT_STAT_IS_STAT64 && MPERS_IS_m32]:
Redefine HAVE_STRUCT_STAT_ST_MTIME_NSEC
to HAVE_M32_STRUCT_STAT64_ST_MTIME_NSEC.
[USE_ASM_STAT && STRUCT_STAT_IS_STAT64 && MPERS_IS_mx32]:
Redefine HAVE_STRUCT_STAT_ST_MTIME_NSEC
to HAVE_MX32_STRUCT_STAT64_ST_MTIME_NSEC.
[USE_ASM_STAT && !STRUCT_STAT_IS_STAT64 && MPERS_IS_m32]:
Redefine HAVE_STRUCT_STAT_ST_MTIME_NSEC
to HAVE_M32_STRUCT_STAT_ST_MTIME_NSEC.
[USE_ASM_STAT && !STRUCT_STAT_IS_STAT64 && MPERS_IS_mx32]:
Redefine HAVE_STRUCT_STAT_ST_MTIME_NSEC
to HAVE_MX32_STRUCT_STAT_ST_MTIME_NSEC.

Based on patch by James Clarke <jrtc27@jrtc27.com>.
This commit is contained in:
Дмитрий Левин 2016-08-30 12:43:09 +00:00
parent ae914db459
commit b80894cf07
2 changed files with 28 additions and 2 deletions

View File

@ -5,7 +5,9 @@ for m in m32 mx32; do
rm -rf $tests
mkdir $tests
s='[[:space:]]*'
sed "s/@arch@/@arch_$m@/;s/^MPERS_NAME$s=.*/& $m/;s/^ARCH_MFLAGS$s=.*/& -$m/" \
sed "s/@arch@/@arch_$m@/;
s/^MPERS_NAME$s=.*/& $m/;
s/^ARCH_MFLAGS$s=.*/& -DMPERS_IS_\$(MPERS_NAME) -$m/" \
tests/Makefile.am > $tests/Makefile.am
for f in tests/*; do
case "${f##*/}" in

View File

@ -91,10 +91,34 @@ typedef off_t libc_off_t;
# undef st_mtime
# undef st_ctime
# include "asm_stat.h"
# if STRUCT_STAT_IS_STAT64
# undef HAVE_STRUCT_STAT_ST_MTIME_NSEC
# define HAVE_STRUCT_STAT_ST_MTIME_NSEC 1
# if defined MPERS_IS_m32
# ifdef HAVE_M32_STRUCT_STAT64_ST_MTIME_NSEC
# define HAVE_STRUCT_STAT_ST_MTIME_NSEC 1
# endif
# elif defined MPERS_IS_mx32
# ifdef HAVE_MX32_STRUCT_STAT64_ST_MTIME_NSEC
# define HAVE_STRUCT_STAT_ST_MTIME_NSEC 1
# endif
# elif defined HAVE_STRUCT_STAT64_ST_MTIME_NSEC
# define HAVE_STRUCT_STAT_ST_MTIME_NSEC 1
# endif /* MPERS_IS_m32 || MPERS_IS_mx32 || HAVE_STRUCT_STAT64_ST_MTIME_NSEC */
# else /* !STRUCT_STAT_IS_STAT64 */
# if defined MPERS_IS_m32
# undef HAVE_STRUCT_STAT_ST_MTIME_NSEC
# ifdef HAVE_M32_STRUCT_STAT_ST_MTIME_NSEC
# define HAVE_STRUCT_STAT_ST_MTIME_NSEC 1
# endif
# elif defined MPERS_IS_mx32
# undef HAVE_STRUCT_STAT_ST_MTIME_NSEC
# ifdef HAVE_MX32_STRUCT_STAT_ST_MTIME_NSEC
# define HAVE_STRUCT_STAT_ST_MTIME_NSEC 1
# endif
# endif /* MPERS_IS_m32 || MPERS_IS_mx32 */
# endif /* STRUCT_STAT_IS_STAT64 */
# else /* !USE_ASM_STAT */
# undef HAVE_STRUCT_STAT_ST_MTIME_NSEC
# ifdef HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC