[project @ 2001-11-08 17:04:28 by simonmar]
authorsimonmar <unknown>
Thu, 8 Nov 2001 17:04:28 +0000 (17:04 +0000)
committersimonmar <unknown>
Thu, 8 Nov 2001 17:04:28 +0000 (17:04 +0000)
minor simplification

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