From 9779055889c2715b593930e39ead552759b5ddc2 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Fri, 14 Jan 2011 10:01:04 +0100 Subject: [PATCH] filemode: Make function declarations usable in C++ mode. * lib/filemode.h: Enclose function declarations in extern "C" block. Reported by John W. Eaton . --- ChangeLog | 6 ++++++ lib/filemode.h | 19 +++++++++++++++---- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8cffb3a43..d68bd778c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2011-01-14 Bruno Haible + + filemode: Make function declarations usable in C++ mode. + * lib/filemode.h: Enclose function declarations in extern "C" block. + Reported by John W. Eaton . + 2011-01-12 Rob Vermaas save-cwd: no longer include "xgetcwd.h" diff --git a/lib/filemode.h b/lib/filemode.h index 2948f1389..1a5030270 100644 --- a/lib/filemode.h +++ b/lib/filemode.h @@ -21,13 +21,24 @@ # include # include +/* Get the declaration of strmode. */ # if HAVE_DECL_STRMODE -# include /* FreeBSD, OpenBSD */ +# include /* MacOS X, FreeBSD, OpenBSD */ # include /* NetBSD */ -# else -void strmode (mode_t mode, char *str); # endif -void filemodestring (struct stat const *statp, char *str); +# ifdef __cplusplus +extern "C" { +# endif + +# if !HAVE_DECL_STRMODE +extern void strmode (mode_t mode, char *str); +# endif + +extern void filemodestring (struct stat const *statp, char *str); + +# ifdef __cplusplus +} +# endif #endif -- 2.11.0