X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2Fsys_stat.in.h;h=da965d02704c21ccbf0389a81febb9217f23b8fb;hb=ade4fb6ef4588f370c1bdbdb90665501140a608d;hp=fef9dd6cce7cdb3905fc23f36d8af401fc30f0a9;hpb=3247f1f8ad0dc42bbf863d481e4111b4735e4bb5;p=gnulib.git diff --git a/lib/sys_stat.in.h b/lib/sys_stat.in.h index fef9dd6cc..da965d027 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-2008 Free Software Foundation, Inc. + Copyright (C) 2005-2009 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 @@ -21,12 +21,23 @@ incomplete. It is intended to provide definitions and prototypes needed by an application. Start with what the system provides. */ -#ifndef _GL_SYS_STAT_H - #if __GNUC__ >= 3 @PRAGMA_SYSTEM_HEADER@ #endif +#if defined __need_system_sys_stat_h +/* Special invocation convention. */ + +#@INCLUDE_NEXT@ @NEXT_SYS_STAT_H@ + +#else +/* Normal invocation convention. */ + +#ifndef _GL_SYS_STAT_H + +/* Get nlink_t. */ +#include + /* The include_next requires a split double-inclusion guard. */ #@INCLUDE_NEXT@ @NEXT_SYS_STAT_H@ @@ -267,12 +278,31 @@ # define S_IRWXUGO (S_IRWXU | S_IRWXG | S_IRWXO) #endif + +#ifdef __cplusplus +extern "C" { +#endif + + +#if @GNULIB_LSTAT@ +# if ! @HAVE_LSTAT@ /* mingw does not support symlinks, therefore it does not have lstat. But without links, stat does just fine. */ -#if ! @HAVE_LSTAT@ -# define lstat stat +# define lstat stat +# elif @REPLACE_LSTAT@ +# undef lstat +# define lstat rpl_lstat +extern int rpl_lstat (const char *name, struct stat *buf); +# endif +#elif defined GNULIB_POSIXCHECK +# undef lstat +# define lstat(p,b) \ + (GL_LINK_WARNING ("lstat is unportable - " \ + "use gnulib module lstat for portability"), \ + lstat (p, b)) #endif + #if @REPLACE_MKDIR@ # undef mkdir # define mkdir rpl_mkdir @@ -320,5 +350,12 @@ extern int lchmod (const char *filename, mode_t mode); lchmod (f, m)) #endif + +#ifdef __cplusplus +} +#endif + + #endif /* _GL_SYS_STAT_H */ #endif /* _GL_SYS_STAT_H */ +#endif