From bc37553ce1ad852a8ba1f2ce4ed7b12bb44093de Mon Sep 17 00:00:00 2001
From: Bruno Haible <bruno@clisp.org>
Date: Sat, 27 Mar 2010 14:30:20 +0100
Subject: [PATCH] Fix a compilation error on Cygwin with g++ >= 4.3.

---
 ChangeLog         | 9 +++++++++
 lib/sys_stat.in.h | 4 ++++
 2 files changed, 13 insertions(+)

diff --git a/ChangeLog b/ChangeLog
index 945954adc5..2be3ce11cb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2010-03-27  Bruno Haible  <bruno@clisp.org>
+
+	Fix a compilation error on Cygwin with g++ >= 4.3.
+	* lib/sys_stat.in.h (lchmod): Don't warn about the use of this function
+	if it is undefined or if we alias it to chmod.
+	(lstat): Don't warn about the use of this function if it is undefined
+	or if we alias it to stat.
+	Reported by Simon Josefsson.
+
 2010-03-27  Bruno Haible  <bruno@clisp.org>
 
 	* m4/getlogin.m4 (gl_FUNC_GETLOGIN): Renamed from gl_GETLOGIN.
diff --git a/lib/sys_stat.in.h b/lib/sys_stat.in.h
index 3156ee62f7..89724c3972 100644
--- a/lib/sys_stat.in.h
+++ b/lib/sys_stat.in.h
@@ -398,7 +398,9 @@ _GL_FUNCDECL_SYS (lchmod, int, (const char *filename, mode_t mode)
 #  endif
 _GL_CXXALIAS_SYS (lchmod, int, (const char *filename, mode_t mode));
 # endif
+# if @HAVE_LCHMOD@
 _GL_CXXALIASWARN (lchmod);
+# endif
 #elif defined GNULIB_POSIXCHECK
 # undef lchmod
 # if HAVE_RAW_DECL_LCHMOD
@@ -427,7 +429,9 @@ _GL_CXXALIAS_RPL (lstat, int, (const char *name, struct stat *buf));
 # else
 _GL_CXXALIAS_SYS (lstat, int, (const char *name, struct stat *buf));
 # endif
+# if @HAVE_LSTAT@
 _GL_CXXALIASWARN (lstat);
+# endif
 #elif defined GNULIB_POSIXCHECK
 # undef lstat
 # if HAVE_RAW_DECL_LSTAT
-- 
2.39.5