[project @ 2001-11-08 17:04:28 by simonmar]
[ghc-hetmet.git] / ghc / lib / std / cbits / dirUtils.c
index edced70..a224004 100644 (file)
 #ifdef HAVE_STDDEF_H
 # include <stddef.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)
 {
@@ -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
-  return (HsAddr)((char*)d + (long)offsetof(struct dirent,d_name));
+  return (HsAddr)(&d->d_name);
 #else
   return (HsAddr)(d->d_name);
 #endif