changeset 1467:e5da225ea2ca

[xemacs-hg @ 2003-05-09 09:50:40 by stephent] #define stat workaround <87r878ihhf.fsf@tleepslib.sk.tsukuba.ac.jp>
author stephent
date Fri, 09 May 2003 09:50:42 +0000
parents 88a2f43560bf
children 0f42689481f0
files src/ChangeLog src/filemode.c src/lisp.h src/sysfile.h
diffstat 4 files changed, 32 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/src/ChangeLog	Fri May 09 01:41:56 2003 +0000
+++ b/src/ChangeLog	Fri May 09 09:50:42 2003 +0000
@@ -1,3 +1,23 @@
+2003-05-09  Stephen J. Turnbull  <stephen@xemacs.org>
+
+	Various cleanups against the possibility that <sys/stat.h> does
+	#define stat ... .
+
+	* lisp.h: Remove struct stat declaration.
+
+2003-05-06  Stephen J. Turnbull  <stephen@xemacs.org>
+
+	* broken-sun.h: Warn about possibility of #define stat.
+
+2000-07-22  Ilya N. Golubev  <gin@mo.msk.ru>
+
+	* lisp.h (filemodestring): Remove
+	
+	* sysfile.h (filemodestring): Put it here
+
+	* filemode.c (filemodestring): Note in comment where it is
+	declared.
+
 2003-05-09  Martin Buchholz  <martin@xemacs.org>
 
 	* dumper.c (pdump_load): Pdump'ed XEmacs can't find its .dmp file.
@@ -9,7 +29,7 @@
 
 	* database.c: Berkeley DB wants __STDC__ to be defined.
 
-2003-05-04  Martin Buchholz  <martin@xemacs.org>
+2003-04-05  Martin Buchholz  <martin@xemacs.org>
 
 	* EmacsFrameP.h (EmacsFramePart):
 	Kludge to allow compiling with Motif1, but linking with Motif2.
--- a/src/filemode.c	Fri May 09 01:41:56 2003 +0000
+++ b/src/filemode.c	Fri May 09 09:50:42 2003 +0000
@@ -30,7 +30,9 @@
 static void rwx (unsigned short bits, char *chars);
 static void setst (unsigned short bits, char *chars);
 
-/* filemodestring - fill in string STR with an ls-style ASCII
+/* declared in "sysfile.h"
+
+   filemodestring - fill in string STR with an ls-style ASCII
    representation of the st_mode field of file stats block STATP.
    10 characters are stored in STR; no terminating null is added.
    The characters stored in STR are:
--- a/src/lisp.h	Fri May 09 01:41:56 2003 +0000
+++ b/src/lisp.h	Fri May 09 09:50:42 2003 +0000
@@ -1405,7 +1405,6 @@
 struct extent;
 struct frame;			/* "frame.h" */
 struct window;                  /* "window.h" */
-struct stat;                    /* <sys/stat.h> */
 struct utimbuf;                 /* "systime.h" or <utime.h> */
 struct display_line;
 struct display_glyph_area;
@@ -4283,9 +4282,6 @@
 void unlock_all_files (void);
 void unlock_buffer (struct buffer *);
 
-/* Defined in filemode.c */
-void filemodestring (struct stat *, char *);
-
 /* Defined in floatfns.c */
 EXFUN (Ftruncate, 1);
 
--- a/src/sysfile.h	Fri May 09 01:41:56 2003 +0000
+++ b/src/sysfile.h	Fri May 09 09:50:42 2003 +0000
@@ -58,6 +58,9 @@
 # include <sys/file.h>
 #endif
 
+/* Some systems (SCO 3.2v5) do #define stat ... in this header.  So it
+   _must_ be included before any use of struct stat.  Most emacs files
+   should include sysfile.h.  The unex*.c include <sys/stat.h> directly. */
 #include <sys/stat.h>
 
 #ifdef WIN32_ANY
@@ -368,6 +371,11 @@
 
 int qxe_unlink (const Ibyte *path);
 
+/* definition in filemode.c
+   must be declared here to ensure that struct stat is properly formed
+   on systems like SCO 3.2v5 */
+void filemodestring (struct stat *, char *);
+
 #endif /* emacs */
 
 
@@ -478,5 +486,4 @@
 
 #endif /* emacs */
 
-
 #endif /* INCLUDED_sysfile_h_ */