From: Bruno Haible Date: Fri, 14 Jan 2011 09:01:04 +0000 (+0100) Subject: filemode: Make function declarations usable in C++ mode. X-Git-Tag: v0.1~3349 X-Git-Url: http://erislabs.net/gitweb/?a=commitdiff_plain;h=9779055889c2715b593930e39ead552759b5ddc2;p=gnulib.git filemode: Make function declarations usable in C++ mode. * lib/filemode.h: Enclose function declarations in extern "C" block. Reported by John W. Eaton . --- 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