]> code.delx.au - gnu-emacs/commitdiff
Fixed compilation problems in lib/.
authorEli Zaretskii <eliz@gnu.org>
Sat, 30 Mar 2013 12:25:48 +0000 (15:25 +0300)
committerEli Zaretskii <eliz@gnu.org>
Sat, 30 Mar 2013 12:25:48 +0000 (15:25 +0300)
nt/inc/ms-w32.h
nt/inc/sys/stat.h
src/w32.c

index 39820bf2f080105e3367c7b239cc6d1bbdc70cbe..9817cd78cad5891a7b9c58a4d8fc226dd6d99316 100644 (file)
@@ -133,6 +133,20 @@ typedef unsigned short mode_t;
 extern char *getenv ();
 #endif
 
+#ifdef __MINGW32__
+/* A kludge to avoid including header files in lib/.  They cannot be
+   configured-out, and their stuff interferes with what we have
+   defined in this header and in other headers in nt/inc.  Yuck!  */
+#define __need_system_fcntl_h
+#define _GL_FCNTL_H
+#define _GL_JUST_INCLUDE_SYSTEM_INTTYPES_H
+#define _GL_ALREADY_INCLUDING_SIGNAL_H
+#define _GL_ALREADY_INCLUDING_STDIO_H
+#define __need_system_stdlib_h
+#define _GL_TIME_H
+#define __need_system_sys_stat_h
+#endif
+
 /* Prevent accidental use of features unavailable in older Windows
    versions we still support.  MinGW64 defines this to a higher value
    in its system headers, and is not really compatible with values
@@ -276,9 +290,6 @@ typedef int pid_t;
 #define popen     _popen
 #define pclose    _pclose
 #define umask    _umask
-#ifndef _MSC_VER
-#define utimbuf          _utimbuf
-#endif
 #define strdup    _strdup
 #define strupr    _strupr
 #define strnicmp  _strnicmp
@@ -295,10 +306,6 @@ int _getpid (void);
    array, and triggers an error message.  */
 #include <time.h>
 #define tzname    _tzname
-#if !defined (_MSC_VER) || (_MSC_VER < 1400)
-#undef  utime
-#define utime    _utime
-#endif
 
 /* 'struct timespec' is used by time-related functions in lib/ and
    elsewhere, but we don't use lib/time.h where the structure is
index f6785c56477183d4e0af0a744ad7fb0eb1ffeb82..857acce18157df16b1d8a162c60abbbd22646794 100644 (file)
@@ -83,6 +83,9 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 #define S_TYPEISSHM(p) 0
 #define S_TYPEISTMO(p) 0
 
+#define UTIME_NOW  (-1)
+#define UTIME_OMIT (-2)
+
 struct stat {
   unsigned __int64 st_ino;     /* ino_t in sys/types.h is too narrow */
   dev_t st_dev;
index 0fa5970124aa90dcbc5363369770666e4e7680ec..fb069c36673c6ac550b5219a604e39440b264ee3 100644 (file)
--- a/src/w32.c
+++ b/src/w32.c
@@ -4430,9 +4430,9 @@ fstat (int desc, struct stat * buf)
 }
 
 int
-utime (const char *name, struct utimbuf *times)
+utime (const char *name, struct _utimbuf *times)
 {
-  struct utimbuf deftime;
+  struct _utimbuf deftime;
   HANDLE fh;
   FILETIME mtime;
   FILETIME atime;