Add extern "C" for C++.
authorBruno Haible <bruno@clisp.org>
Fri, 16 Jul 2004 16:28:48 +0000 (16:28 +0000)
committerBruno Haible <bruno@clisp.org>
Fri, 16 Jul 2004 16:28:48 +0000 (16:28 +0000)
13 files changed:
lib/ChangeLog
lib/backupfile.h
lib/closeout.h
lib/copy-file.h
lib/findprog.h
lib/full-write.h
lib/pathname.h
lib/progname.h
lib/stpcpy.h
lib/stpncpy.h
lib/strcase.h
lib/strstr.h
lib/xalloc.h

index a77eb81..2bd26ab 100644 (file)
@@ -1,5 +1,18 @@
 2004-07-16  Bruno Haible  <bruno@clisp.org>
 
+       * backupfile.h: Add extern "C" for C++.
+       * closeout.h: Likewise.
+       * copy-file.h: Likewise.
+       * findprog.h: Likewise.
+       * full-write.h: Likewise.
+       * pathname.h: Likewise.
+       * progname.h: Likewise.
+       * stpcpy.h: Likewise.
+       * stpncpy.h: Likewise.
+       * strcase.h: Likewise.
+       * strstr.h: Likewise.
+       * xalloc.h: Likewise.
+
        * mbswidth.h: Add extern "C" for C++.
        Reported by Albert Chin-A-Young <china@thewrittenword.com>.
 
index fe5e1de..346b60c 100644 (file)
@@ -1,6 +1,6 @@
 /* backupfile.h -- declarations for making Emacs style backup file names
 
-   Copyright (C) 1990, 1991, 1992, 1997, 1998, 1999, 2003 Free
+   Copyright (C) 1990, 1991, 1992, 1997, 1998, 1999, 2003, 2004 Free
    Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
 #ifndef BACKUPFILE_H_
 # define BACKUPFILE_H_
 
+# ifdef __cplusplus
+extern "C" {
+# endif
+
+
 /* When to make backup files. */
 enum backup_type
 {
@@ -51,4 +56,9 @@ enum backup_type get_version (char const *context, char const *arg);
 enum backup_type xget_version (char const *context, char const *arg);
 void addext (char *, char const *, int);
 
+
+# ifdef __cplusplus
+}
+# endif
+
 #endif /* ! BACKUPFILE_H_ */
index d27d760..1b715ee 100644 (file)
@@ -1,6 +1,6 @@
 /* Close standard output.
 
-   Copyright (C) 1998, 2000, 2003 Free Software Foundation, Inc.
+   Copyright (C) 1998, 2000, 2003, 2004 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
 #ifndef CLOSEOUT_H
 # define CLOSEOUT_H 1
 
+# ifdef __cplusplus
+extern "C" {
+# endif
+
 void close_stdout_set_file_name (const char *file);
 void close_stdout (void);
 
+# ifdef __cplusplus
+}
+# endif
+
 #endif
index 3efda34..bf5e9d8 100644 (file)
    along with this program; if not, write to the Free Software Foundation,
    Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
 /* Copy a regular file: from src_filename to dest_filename.
    The destination file is assumed to be a backup file.
    Modification times, owner, group and access permissions are preserved as
    far as possible.
    Exit upon failure.  */
 extern void copy_file_preserving (const char *src_filename, const char *dest_filename);
+
+
+#ifdef __cplusplus
+}
+#endif
index 81a95b6..5913429 100644 (file)
    along with this program; if not, write to the Free Software Foundation,
    Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
 /* Look up a program in the PATH.
    Attempt to determine the pathname that would be called by execlp/execvp
    of PROGNAME.  If successful, return a pathname containing a slash
@@ -25,3 +31,8 @@
    execl/execv on the returned pathname.
    The returned string is freshly malloc()ed if it is != PROGNAME.  */
 extern const char *find_in_path (const char *progname);
+
+
+#ifdef __cplusplus
+}
+#endif
index 8cd2e81..2637903 100644 (file)
@@ -1,6 +1,6 @@
 /* An interface to write() that writes all it is asked to write.
 
-   Copyright (C) 2002 Free Software Foundation, Inc.
+   Copyright (C) 2002-2003 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
 
 #include <stddef.h>
 
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
 /* Write COUNT bytes at BUF to descriptor FD, retrying if interrupted
    or if partial writes occur.  Return the number of bytes successfully
    written, setting errno if that is less than COUNT.  */
 extern size_t full_write (int fd, const void *buf, size_t count);
+
+
+#ifdef __cplusplus
+}
+#endif
index 75daa65..1bce49b 100644 (file)
 #ifndef _PATHNAME_H
 #define _PATHNAME_H
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
 /* Pathname support.
    ISSLASH(C)           tests whether C is a directory separator character.
    IS_ABSOLUTE_PATH(P)  tests whether P is an absolute path.  If it is not,
@@ -47,4 +52,8 @@
 extern char *concatenated_pathname (const char *directory,
                                    const char *filename, const char *suffix);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* _PATHNAME_H */
index 89f0127..2088e00 100644 (file)
@@ -1,5 +1,5 @@
 /* Program name management.
-   Copyright (C) 2001-2003 Free Software Foundation, Inc.
+   Copyright (C) 2001-2004 Free Software Foundation, Inc.
    Written by Bruno Haible <haible@clisp.cons.org>, 2001.
 
    This program is free software; you can redistribute it and/or modify
      set_program_name (argv[0]);
  */
 
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
 /* String containing name the program is called with.  */
 extern const char *program_name;
 
@@ -47,4 +53,10 @@ extern char *get_full_program_name (void);
 
 #endif
 
+
+#ifdef __cplusplus
+}
+#endif
+
+
 #endif /* _PROGNAME_H */
index b579c5c..5e737cf 100644 (file)
 
 #else
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 /* Copy SRC to DST, returning the address of the terminating '\0' in DST.  */
 extern char *stpcpy (char *dst, const char *src);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif
 
 #endif /* _STPCPY_H */
index cf658eb..6dc92a8 100644 (file)
@@ -1,5 +1,5 @@
 /* String copying.
-   Copyright (C) 1995, 2001-2003 Free Software Foundation, Inc.
+   Copyright (C) 1995, 2001-2004 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
 
 #include <string.h>
 
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
 #if !HAVE_STPNCPY
 
 /* Copy no more than N bytes of SRC to DST, returning a pointer past the
@@ -31,4 +37,10 @@ extern char *gnu_stpncpy (char *dst, const char *src, size_t n);
 
 #endif
 
+
+#ifdef __cplusplus
+}
+#endif
+
+
 #endif /* _STPNCPY_H */
index f17e648..9461392 100644 (file)
 
 #include <stddef.h>
 
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
 /* Compare strings S1 and S2, ignoring case, returning less than, equal to or
    greater than zero if S1 is lexicographically less than, equal to or greater
    than S2.
@@ -32,4 +38,10 @@ extern int strcasecmp (const char *s1, const char *s2);
    Note: This function can not work correctly in multibyte locales.  */
 extern int strncasecmp (const char *s1, const char *s2, size_t n);
 
+
+#ifdef __cplusplus
+}
+#endif
+
+
 #endif /* _STRCASE_H */
index e424b83..f244b96 100644 (file)
@@ -1,5 +1,5 @@
 /* Searching in a string.
-   Copyright (C) 2001, 2002 Free Software Foundation, Inc.
+   Copyright (C) 2001-2003 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
 
 #else
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 /* Find the first occurrence of NEEDLE in HAYSTACK.  */
 extern char *strstr (const char *haystack, const char *needle);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif
index 4b65858..5985892 100644 (file)
@@ -1,7 +1,7 @@
 /* xalloc.h -- malloc with out-of-memory checking
 
    Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
-   1999, 2000, 2003 Free Software Foundation, Inc.
+   1999, 2000, 2003, 2004 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
 
 # include <stddef.h>
 
+
+# ifdef __cplusplus
+extern "C" {
+# endif
+
+
 # ifndef __attribute__
 #  if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 8) || __STRICT_ANSI__
 #   define __attribute__(x)
@@ -32,6 +38,7 @@
 #  define ATTRIBUTE_NORETURN __attribute__ ((__noreturn__))
 # endif
 
+
 /* If this pointer is non-zero, run the specified function upon each
    allocation failure.  It is initialized to zero. */
 extern void (*xalloc_fail_func) (void);
@@ -84,4 +91,10 @@ char *xstrdup (const char *str);
 # define XREALLOC(p, type, n) xnrealloc (p, n, sizeof (type))
 # define XFREE(p) free (p)
 
+
+# ifdef __cplusplus
+}
+# endif
+
+
 #endif /* !XALLOC_H_ */