projects
/
ghc-hetmet.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
02fb813
)
[project @ 2001-11-08 17:04:28 by simonmar]
author
simonmar
<unknown>
Thu, 8 Nov 2001 17:04:28 +0000
(17:04 +0000)
committer
simonmar
<unknown>
Thu, 8 Nov 2001 17:04:28 +0000
(17:04 +0000)
minor simplification
ghc/lib/std/cbits/dirUtils.c
patch
|
blob
|
history
diff --git
a/ghc/lib/std/cbits/dirUtils.c
b/ghc/lib/std/cbits/dirUtils.c
index
edced70
..
a224004
100644
(file)
--- a/
ghc/lib/std/cbits/dirUtils.c
+++ b/
ghc/lib/std/cbits/dirUtils.c
@@
-15,15
+15,10
@@
#ifdef HAVE_STDDEF_H
# include <stddef.h>
#endif
#ifdef HAVE_STDDEF_H
# include <stddef.h>
#endif
-
#ifdef HAVE_ERRNO_H
# include <errno.h>
#endif
#ifdef HAVE_ERRNO_H
# include <errno.h>
#endif
-#ifndef offsetof
-#define offsetof(t, f) ((size_t) &((t *)0)->f)
-#endif
-
HsInt
prel_mkdir(HsAddr pathName, HsInt mode)
{
HsInt
prel_mkdir(HsAddr pathName, HsInt mode)
{
@@
-63,7
+58,7
@@
mode_t prel_st_mode(struct stat* st) { return st->st_mode; }
HsAddr prel_d_name(struct dirent* d)
{
#ifndef mingw32_TARGET_OS
HsAddr prel_d_name(struct dirent* d)
{
#ifndef mingw32_TARGET_OS
- return (HsAddr)((char*)d + (long)offsetof(struct dirent,d_name));
+ return (HsAddr)(&d->d_name);
#else
return (HsAddr)(d->d_name);
#endif
#else
return (HsAddr)(d->d_name);
#endif