APPROVE COMMIT 21.5
>>>>"RR" == Rick Rankin
<rrankin1424-xemacs(a)yahoo.com> writes:
RR> The patch below fixes a compiler
error that occurs when building
RR> the latest 21.5 sources from CVS on the latest Cygwin
RR> release. Cygwin 1.5.19 has removed the d_ino field from 'struct
RR> dirent' since it wasn't used on Cygwin and apparently POSIX
RR> doesn't require it to be present. I haven't done a great deal of
RR> testing with this patch, but dired seems to work fine with it.
I commit Rick's patch as it is necessary to compile XEmacs on latest
Cygwin.
RR> Also, I had to disable the new allocator when building as it was
RR> causing core dumps. I haven't had much time to look at it, but
RR> apparently, SYS_PAGE_SIZE was returning an unrecognized value in
RR> init_mc_allocator() which was causing ABORT() to be called from
RR> the switch statement at the beginning of the function. I'll try to
RR> look at it in a bit more detail in a few days.
Since latest Cygwin claims to have a 64k page size, I add this case to
the switch statement. Thanks for pointing this out, Rick!
src/ChangeLog addition:
2006-01-21 Marcus Crestani <crestani(a)xemacs.org>
* mc-alloc.c (init_mc_allocator): Cygwin claims to have a 64k
page size, add it.
2006-01-20 Rick Rankin <rrankin1424-xemacs(a)yahoo.com>
* sysdir.h: Workaround missing d_ino field from 'struct dirent'.
xemacs-21.5 source patch:
Diff command: cvs -q diff -u
Files affected: src/sysdir.h src/mc-alloc.c
Index: src/mc-alloc.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/mc-alloc.c,v
retrieving revision 1.6
diff -u -r1.6 mc-alloc.c
--- src/mc-alloc.c 25 Nov 2005 01:42:05 -0000 1.6
+++ src/mc-alloc.c 21 Jan 2006 12:47:20 -0000
@@ -1732,7 +1732,12 @@
case 4096: log_page_size = 12; break;
case 8192: log_page_size = 13; break;
case 16384: log_page_size = 14; break;
- default: ABORT ();
+ case 32768: log_page_size = 15; break;
+ case 65536: log_page_size = 16; break;
+ default:
+ fprintf(stderr, "##### SYS_PAGE_SIZE=%d not supported #####\n",
+ SYS_PAGE_SIZE);
+ ABORT ();
}
page_size_div_2 = (EMACS_INT) SYS_PAGE_SIZE >> 1;
Index: src/sysdir.h
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/sysdir.h,v
retrieving revision 1.7
diff -u -r1.7 sysdir.h
--- src/sysdir.h 5 Jun 2002 09:57:18 -0000 1.7
+++ src/sysdir.h 21 Jan 2006 12:47:20 -0000
@@ -62,7 +62,11 @@
Since applying strlen to the name always works, we'll just do that. */
#define NAMLEN(p) strlen (p->d_name)
-#define DIRENTRY_NONEMPTY(p) ((p)->d_ino)
+#ifdef __CYGWIN__
+# define DIRENTRY_NONEMPTY(p) ((p)->d_name[0] != '\0')
+#else
+# define DIRENTRY_NONEMPTY(p) ((p)->d_ino)
+#endif
/* encapsulation: directory calls */
--
Marcus