From: Chad Brown <yandros@MIT.EDU>
To: Emacs development discussions <emacs-devel@gnu.org>
Subject: Re: recent commit broke src/dired.c on OSX
Date: Sun, 25 Jul 2010 20:12:01 -0700 [thread overview]
Message-ID: <E152BE37-3F16-4FF0-9252-75915893E400@mit.edu> (raw)
In-Reply-To: <A1BAEBEF-9156-4516-A0FE-DA05B1D6FECA@mit.edu>
Here's a stab at implementing Jan's suggestion: testing for dirent.h in configure instead of dancing around SYSV_SYSTEM_DIR. The changes are pretty small, and I have signed papers already anyway.
I did simplify a test that checked for MSDOS, and I have no way to test on that platform, so I would appreciate it if someone would check to make sure I did no harm. Thanks.
*Chad
P.S. If someone would prefer unidiffs instead, just let me know. Also, I could put together a ChangeLog entry if that would be helpful -- I just realized that I hadn't done so, but the changes are pretty straightforward.
=== modified file 'configure'
*** configure 2010-07-25 19:09:54 +0000
--- configure 2010-07-26 02:39:53 +0000
***************
*** 6149,6155 ****
linux/version.h sys/systeminfo.h termios.h limits.h string.h stdlib.h \
stdio_ext.h fcntl.h strings.h coff.h pty.h sys/mman.h \
sys/param.h sys/vlimit.h sys/resource.h locale.h sys/_mbstate_t.h \
! sys/utsname.h pwd.h utmp.h
do :
as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
--- 6149,6155 ----
linux/version.h sys/systeminfo.h termios.h limits.h string.h stdlib.h \
stdio_ext.h fcntl.h strings.h coff.h pty.h sys/mman.h \
sys/param.h sys/vlimit.h sys/resource.h locale.h sys/_mbstate_t.h \
! sys/utsname.h pwd.h utmp.h dirent.h
do :
as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
=== modified file 'configure.in'
*** configure.in 2010-07-25 19:09:54 +0000
--- configure.in 2010-07-26 02:36:43 +0000
***************
*** 1204,1210 ****
linux/version.h sys/systeminfo.h termios.h limits.h string.h stdlib.h \
stdio_ext.h fcntl.h strings.h coff.h pty.h sys/mman.h \
sys/param.h sys/vlimit.h sys/resource.h locale.h sys/_mbstate_t.h \
! sys/utsname.h pwd.h utmp.h)
AC_MSG_CHECKING(if personality LINUX32 can be set)
AC_TRY_COMPILE([#include <sys/personality.h>], [personality (PER_LINUX32)],
--- 1204,1210 ----
linux/version.h sys/systeminfo.h termios.h limits.h string.h stdlib.h \
stdio_ext.h fcntl.h strings.h coff.h pty.h sys/mman.h \
sys/param.h sys/vlimit.h sys/resource.h locale.h sys/_mbstate_t.h \
! sys/utsname.h pwd.h utmp.h dirent.h)
AC_MSG_CHECKING(if personality LINUX32 can be set)
AC_TRY_COMPILE([#include <sys/personality.h>], [personality (PER_LINUX32)],
=== modified file 'src/config.in'
*** src/config.in 2010-07-25 19:09:54 +0000
--- src/config.in 2010-07-26 02:43:53 +0000
***************
*** 737,742 ****
--- 737,745 ----
/* Define to 1 if you have the <utmp.h> header file. */
#undef HAVE_UTMP_H
+ /* Define to 1 if you have the <dirent.h> header file. */
+ #undef HAVE_DIRENT_H
+
/* Define to 1 if you have the `vfork' function. */
#undef HAVE_VFORK
=== modified file 'src/dired.c'
*** src/dired.c 2010-07-25 00:20:51 +0000
--- src/dired.c 2010-07-26 03:03:56 +0000
***************
*** 48,76 ****
Since applying strlen to the name always works, we'll just do that. */
#define NAMLEN(p) strlen (p->d_name)
! #ifdef SYSV_SYSTEM_DIR
#include <dirent.h>
#define DIRENTRY struct dirent
! #else /* not SYSV_SYSTEM_DIR */
- #ifdef MSDOS
- #include <dirent.h>
- #else
#include <sys/dir.h>
- #endif
-
#include <sys/stat.h>
- #ifndef MSDOS
#define DIRENTRY struct direct
extern DIR *opendir (char *);
extern struct direct *readdir (DIR *);
! #endif /* not MSDOS */
! #endif /* not SYSV_SYSTEM_DIR */
/* Some versions of Cygwin don't have d_ino in `struct dirent'. */
#if defined(MSDOS) || defined(__CYGWIN__)
--- 48,69 ----
Since applying strlen to the name always works, we'll just do that. */
#define NAMLEN(p) strlen (p->d_name)
! #ifdef HAVE_DIRENT_H
#include <dirent.h>
#define DIRENTRY struct dirent
! #else /* not HAVE_DIRENT */
#include <sys/dir.h>
#include <sys/stat.h>
#define DIRENTRY struct direct
extern DIR *opendir (char *);
extern struct direct *readdir (DIR *);
! #endif /* HAVE_DIRENT_H */
/* Some versions of Cygwin don't have d_ino in `struct dirent'. */
#if defined(MSDOS) || defined(__CYGWIN__)
=== modified file 'src/sysdep.c'
*** src/sysdep.c 2010-07-13 10:57:00 +0000
--- src/sysdep.c 2010-07-26 02:48:50 +0000
***************
*** 2447,2453 ****
\f
/* Directory routines for systems that don't have them. */
! #ifdef SYSV_SYSTEM_DIR
#include <dirent.h>
--- 2447,2453 ----
\f
/* Directory routines for systems that don't have them. */
! #ifdef HAVE_DIRENT
#include <dirent.h>
***************
*** 2464,2470 ****
return rtnval;
}
#endif /* not HAVE_CLOSEDIR */
! #endif /* SYSV_SYSTEM_DIR */
\f
int
--- 2464,2470 ----
return rtnval;
}
#endif /* not HAVE_CLOSEDIR */
! #endif /* HAVE_DIRENT */
\f
int
next prev parent reply other threads:[~2010-07-26 3:12 UTC|newest]
Thread overview: 41+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-07-25 17:23 recent commit broke src/dired.c on OSX Randal L. Schwartz
2010-07-25 17:30 ` Juanma Barranquero
2010-07-25 17:40 ` Randal L. Schwartz
2010-07-25 17:51 ` Juanma Barranquero
2010-07-25 17:58 ` Randal L. Schwartz
2010-07-25 18:04 ` Juanma Barranquero
2010-07-25 20:12 ` Chad Brown
2010-07-25 20:39 ` Juanma Barranquero
2010-07-26 2:46 ` Chad Brown
2010-07-26 3:12 ` Chad Brown [this message]
2010-07-26 3:43 ` Juanma Barranquero
2010-07-26 8:44 ` David Kastrup
2010-07-26 9:58 ` Juanma Barranquero
2010-07-26 6:02 ` Jan Djärv
2010-07-26 6:33 ` Jan Djärv
2010-07-26 16:58 ` Eli Zaretskii
2010-07-27 21:40 ` Chad Brown
2010-07-27 23:18 ` Juanma Barranquero
2010-07-27 23:28 ` Óscar Fuentes
2010-07-28 0:16 ` Juanma Barranquero
2010-07-28 0:33 ` Óscar Fuentes
2010-07-28 0:45 ` Juanma Barranquero
2010-07-28 0:54 ` Óscar Fuentes
2010-07-28 0:58 ` Juanma Barranquero
2010-07-28 6:32 ` Jan Djärv
2010-07-25 20:44 ` Eli Zaretskii
2010-07-29 18:21 ` Randal L. Schwartz
2010-07-29 19:11 ` Jan Djärv
2010-07-29 19:19 ` Randal L. Schwartz
2010-07-29 19:29 ` Chad Brown
2010-07-29 20:09 ` Jan Djärv
2010-07-29 20:37 ` Óscar Fuentes
2010-07-29 21:07 ` Jan Djärv
2010-07-29 21:17 ` Óscar Fuentes
2010-07-29 23:19 ` Chad Brown
2010-07-25 20:50 ` Dan Nicolaescu
2010-07-25 20:54 ` Juanma Barranquero
2010-07-25 20:59 ` Eli Zaretskii
2010-07-25 21:26 ` Jan Djärv
2010-07-25 21:32 ` Jan Djärv
2010-07-25 17:38 ` Eli Zaretskii
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=E152BE37-3F16-4FF0-9252-75915893E400@mit.edu \
--to=yandros@mit.edu \
--cc=emacs-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.