Do only one call to GetVersionEx in the common case.
[pspp] / lib / sys_stat.in.h
index b0ea92d6e3d9ab559ccfd4c3987c31ffe2fec984..cc438229e7d68db6e383d8d0bc9adeada686abfb 100644 (file)
@@ -302,6 +302,22 @@ extern int rpl_lstat (const char *name, struct stat *buf);
    lstat (p, b))
 #endif
 
+#if @GNULIB_STAT@
+# if @REPLACE_STAT@
+/* We can't use the object-like #define stat rpl_stat, because of
+   struct stat.  This means that rpl_stat will not be used if the user
+   does (stat)(a,b).  Oh well.  */
+#  undef stat
+#  define stat(name, st) rpl_stat (name, st)
+extern int stat (const char *name, struct stat *buf);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef stat
+# define stat(p,b)                                                     \
+  (GL_LINK_WARNING ("stat is unportable - "                            \
+                   "use gnulib module stat for portability"),          \
+   stat (p, b))
+#endif
 
 #if @GNULIB_FCHMODAT@
 # if !@HAVE_FCHMODAT@
@@ -369,7 +385,7 @@ int mknodat (int fd, char const *file, mode_t mode, dev_t dev);
      mknodat (f, n, m, d))
 #endif
 
-#if @REPLACE_FCHDIR@
+#if @REPLACE_FSTAT@
 # define fstat rpl_fstat
 extern int fstat (int fd, struct stat *buf);
 #endif