filemode: Make function declarations usable in C++ mode.
authorBruno Haible <bruno@clisp.org>
Fri, 14 Jan 2011 09:01:04 +0000 (10:01 +0100)
committerBruno Haible <bruno@clisp.org>
Fri, 14 Jan 2011 09:01:04 +0000 (10:01 +0100)
* lib/filemode.h: Enclose function declarations in extern "C" block.
Reported by John W. Eaton <jwe@gnu.org>.

ChangeLog
lib/filemode.h

index 8cffb3a..d68bd77 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2011-01-14  Bruno Haible  <bruno@clisp.org>
+
+       filemode: Make function declarations usable in C++ mode.
+       * lib/filemode.h: Enclose function declarations in extern "C" block.
+       Reported by John W. Eaton <jwe@gnu.org>.
+
 2011-01-12  Rob Vermaas  <rob.vermaas@gmail.com>
 
        save-cwd: no longer include "xgetcwd.h"
index 2948f13..1a50302 100644 (file)
 # include <sys/types.h>
 # include <sys/stat.h>
 
+/* Get the declaration of strmode.  */
 # if HAVE_DECL_STRMODE
-#  include <string.h> /* FreeBSD, OpenBSD */
+#  include <string.h> /* MacOS X, FreeBSD, OpenBSD */
 #  include <unistd.h> /* 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