# HG changeset patch # User Bruno Haible # Date 1294995664 -3600 # Node ID 97273629690f09065b52f8b310e87f497d41a400 # Parent d256c4a2fbf111407aa4b321c971e604f16bc53a 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 --- 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 --- 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 + +# ifdef __cplusplus +extern "C" { # endif -void filemodestring (struct stat const *statp, char *str); +# 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