summaryrefslogtreecommitdiff
path: root/sim/common/callback.c
diff options
context:
space:
mode:
authorHans-Peter Nilsson <hp@axis.com>2004-12-03 19:36:53 +0000
committerHans-Peter Nilsson <hp@axis.com>2004-12-03 19:36:53 +0000
commit6700970780c0d00d52029e6fb1e2f41bcf0983e7 (patch)
treecc073b34236b41b59ba46aea639acf9a1715d2f8 /sim/common/callback.c
parent0489b4d71aba59235725e54a939823b2c18cc1af (diff)
downloadgdb-6700970780c0d00d52029e6fb1e2f41bcf0983e7.tar.gz
* configure.in (SIM_CHECK_MEMBERS): Call for struct stat members
st_dev, st_ino, st_mode, st_nlink, st_uid, st_gid, st_rdev, st_size, st_blksize, st_blocks, st_atime, st_mtime and st_ctime. * aclocal.m4 (SIM_CHECK_MEMBER, SIM_CHECK_MEMBERS_1) (SIM_CHECK_MEMBERS): New macros. * callback.c (cb_host_to_target_stat): Use temporary macro ST_x for struct stat member test and write. Add ST_x calls for each struct stat member tested in configure.in. Wrap each ST_x call in #ifdef of configure macro for that member. * configure, config.in: Regenerate.
Diffstat (limited to 'sim/common/callback.c')
-rw-r--r--sim/common/callback.c52
1 files changed, 48 insertions, 4 deletions
diff --git a/sim/common/callback.c b/sim/common/callback.c
index ca707fc18cd..d2a92d084ca 100644
--- a/sim/common/callback.c
+++ b/sim/common/callback.c
@@ -816,10 +816,54 @@ cb_host_to_target_stat (cb, hs, ts)
if (hs != NULL)
{
- if (strncmp (m, "st_dev", q - m) == 0)
- store (p, size, hs->st_dev, big_p);
- else if (strncmp (m, "st_ino", q - m) == 0)
- store (p, size, hs->st_ino, big_p);
+ if (1)
+ ;
+ /* Defined here to avoid emacs indigestion on a lone "else". */
+#undef ST_x
+#define ST_x(FLD) \
+ else if (strncmp (m, #FLD, q - m) == 0) \
+ store (p, size, hs->FLD, big_p)
+
+#ifdef HAVE_STRUCT_STAT_ST_DEV
+ ST_x (st_dev);
+#endif
+#ifdef HAVE_STRUCT_STAT_ST_INO
+ ST_x (st_ino);
+#endif
+#ifdef HAVE_STRUCT_STAT_ST_MODE
+ ST_x (st_mode);
+#endif
+#ifdef HAVE_STRUCT_STAT_ST_NLINK
+ ST_x (st_nlink);
+#endif
+#ifdef HAVE_STRUCT_STAT_ST_UID
+ ST_x (st_uid);
+#endif
+#ifdef HAVE_STRUCT_STAT_ST_GID
+ ST_x (st_gid);
+#endif
+#ifdef HAVE_STRUCT_STAT_ST_RDEV
+ ST_x (st_rdev);
+#endif
+#ifdef HAVE_STRUCT_STAT_ST_SIZE
+ ST_x (st_size);
+#endif
+#ifdef HAVE_STRUCT_STAT_ST_BLKSIZE
+ ST_x (st_blksize);
+#endif
+#ifdef HAVE_STRUCT_STAT_ST_BLOCKS
+ ST_x (st_blocks);
+#endif
+#ifdef HAVE_STRUCT_STAT_ST_ATIME
+ ST_x (st_atime);
+#endif
+#ifdef HAVE_STRUCT_STAT_ST_MTIME
+ ST_x (st_mtime);
+#endif
+#ifdef HAVE_STRUCT_STAT_ST_CTIME
+ ST_x (st_ctime);
+#endif
+#undef ST_x
/* FIXME:wip */
else
store (p, size, 0, big_p); /* unsupported field, store 0 */