X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2Fsys_stat.in.h;h=9f7bf76ed84785054855b1ae4687b64071df64c3;hb=103bb35a244bc08ec657bac05a0a1d429d651f45;hp=63e46efb2663e900b1076fe9d841447968456ea2;hpb=0d3f6696ea99b6ab11b704ad969f39b9a66a0a59;p=gnulib.git diff --git a/lib/sys_stat.in.h b/lib/sys_stat.in.h index 63e46efb2..9f7bf76ed 100644 --- a/lib/sys_stat.in.h +++ b/lib/sys_stat.in.h @@ -1,5 +1,5 @@ /* Provide a more complete sys/stat header file. - Copyright (C) 2005-2010 Free Software Foundation, Inc. + Copyright (C) 2005-2011 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -34,7 +34,7 @@ #else /* Normal invocation convention. */ -#ifndef _GL_SYS_STAT_H +#ifndef _@GUARD_PREFIX@_SYS_STAT_H /* Get nlink_t. */ #include @@ -45,8 +45,8 @@ /* The include_next requires a split double-inclusion guard. */ #@INCLUDE_NEXT@ @NEXT_SYS_STAT_H@ -#ifndef _GL_SYS_STAT_H -#define _GL_SYS_STAT_H +#ifndef _@GUARD_PREFIX@_SYS_STAT_H +#define _@GUARD_PREFIX@_SYS_STAT_H /* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */ @@ -55,10 +55,17 @@ /* The definition of _GL_WARN_ON_USE is copied here. */ /* Before doing "#define mkdir rpl_mkdir" below, we need to include all - headers that may declare mkdir(). */ + headers that may declare mkdir(). Native Windows platforms declare mkdir + in and/or , not in . */ #if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ # include /* mingw32, mingw64 */ -# include /* mingw64 */ +# include /* mingw64, MSVC 9 */ +#endif + +#ifndef S_IFIFO +# ifdef _S_IFIFO +# define S_IFIFO _S_IFIFO +# endif #endif #ifndef S_IFMT @@ -312,16 +319,25 @@ _GL_WARN_ON_USE (fchmodat, "fchmodat is not portable - " #endif -#if @REPLACE_FSTAT@ -# if !(defined __cplusplus && defined GNULIB_NAMESPACE) -# define fstat rpl_fstat -# endif +#if @GNULIB_FSTAT@ +# if @REPLACE_FSTAT@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef fstat +# define fstat rpl_fstat +# endif _GL_FUNCDECL_RPL (fstat, int, (int fd, struct stat *buf) _GL_ARG_NONNULL ((2))); _GL_CXXALIAS_RPL (fstat, int, (int fd, struct stat *buf)); -#else +# else _GL_CXXALIAS_SYS (fstat, int, (int fd, struct stat *buf)); -#endif +# endif _GL_CXXALIASWARN (fstat); +#elif defined GNULIB_POSIXCHECK +# undef fstat +# if HAVE_RAW_DECL_FSTAT +_GL_WARN_ON_USE (fstat, "fstat has portability problems - " + "use gnulib module fstat for portability"); +# endif +#endif #if @GNULIB_FSTATAT@ @@ -355,7 +371,11 @@ _GL_WARN_ON_USE (fstatat, "fstatat is not portable - " #if @GNULIB_FUTIMENS@ -# if @REPLACE_FUTIMENS@ +/* Use the rpl_ prefix also on Solaris <= 9, because on Solaris 9 our futimens + implementation relies on futimesat, which on Solaris 10 makes an invocation + to futimens that is meant to invoke the libc's futimens(), not gnulib's + futimens(). */ +# if @REPLACE_FUTIMENS@ || (!@HAVE_FUTIMENS@ && defined __sun) # if !(defined __cplusplus && defined GNULIB_NAMESPACE) # undef futimens # define futimens rpl_futimens @@ -368,7 +388,9 @@ _GL_FUNCDECL_SYS (futimens, int, (int fd, struct timespec const times[2])); # endif _GL_CXXALIAS_SYS (futimens, int, (int fd, struct timespec const times[2])); # endif +# if @HAVE_FUTIMENS@ _GL_CXXALIASWARN (futimens); +# endif #elif defined GNULIB_POSIXCHECK # undef futimens # if HAVE_RAW_DECL_FUTIMENS @@ -461,11 +483,14 @@ _GL_CXXALIAS_RPL (mkdir, int, (char const *name, mode_t mode)); which are included above. */ # if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ +# if !GNULIB_defined_rpl_mkdir static inline int rpl_mkdir (char const *name, mode_t mode) { return _mkdir (name); } +# define GNULIB_defined_rpl_mkdir 1 +# endif # if !(defined __cplusplus && defined GNULIB_NAMESPACE) # define mkdir rpl_mkdir @@ -609,7 +634,11 @@ _GL_WARN_ON_USE (stat, "stat is unportable - " #if @GNULIB_UTIMENSAT@ -# if @REPLACE_UTIMENSAT@ +/* Use the rpl_ prefix also on Solaris <= 9, because on Solaris 9 our utimensat + implementation relies on futimesat, which on Solaris 10 makes an invocation + to utimensat that is meant to invoke the libc's utimensat(), not gnulib's + utimensat(). */ +# if @REPLACE_UTIMENSAT@ || (!@HAVE_UTIMENSAT@ && defined __sun) # if !(defined __cplusplus && defined GNULIB_NAMESPACE) # undef utimensat # define utimensat rpl_utimensat @@ -628,7 +657,9 @@ _GL_FUNCDECL_SYS (utimensat, int, (int fd, char const *name, _GL_CXXALIAS_SYS (utimensat, int, (int fd, char const *name, struct timespec const times[2], int flag)); # endif +# if @HAVE_UTIMENSAT@ _GL_CXXALIASWARN (utimensat); +# endif #elif defined GNULIB_POSIXCHECK # undef utimensat # if HAVE_RAW_DECL_UTIMENSAT @@ -638,6 +669,6 @@ _GL_WARN_ON_USE (utimensat, "utimensat is not portable - " #endif -#endif /* _GL_SYS_STAT_H */ -#endif /* _GL_SYS_STAT_H */ +#endif /* _@GUARD_PREFIX@_SYS_STAT_H */ +#endif /* _@GUARD_PREFIX@_SYS_STAT_H */ #endif