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 a77eb811e8f6cf6584c8e8668bf8d5402b77ad70..2bd26abc8cf268039baff69a0c66388c96ef316a 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 fe5e1deb36ad6350ea4996c35fa04745cc3b6b89..346b60c3e28aa067bcf867a09899bf22f7bb5cb1 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 d27d7601eb7b19d0c5f765f23b8e918cdcf90e21..1b715ee30369cc8e6af2d97e38d55e1af471bdf2 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 3efda34b875c63e308199f0c1b10f4ff2b0478ff..bf5e9d8c1c07878662b9a614969da2a1d8d2f381 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 81a95b6dc49c1b20151ba0c4301d4fe8d2e55dda..5913429f2ea7f52bebc45b8d8953c692398d30c1 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 8cd2e8157a50272630cb9afb7d8aa93e64ecfb5f..2637903ecda4943725aef3af3bb3cefdc61e719a 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 75daa659401d3945a1c31c5b553db313fa09af05..1bce49bf7a3faa7af438eaf6b17191170b187dd8 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 89f0127c78b5751fec3d1c9f413d7cc5b30b5ed4..2088e00762c5a279483d93acb9872bc6172b3d42 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 b579c5c9dee3408b11ff66e46dd89c6b2c9cc85d..5e737cfd573f14be1ecdb71d846071a530ae80ef 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 cf658eb0714e40c5cbaa87ed96847e6aeab3a9e6..6dc92a81324d993b9dc2ead31d4c69e3a2db47ab 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 f17e64832ff1bd22565ab3c135253dee2752358c..9461392f8d6ade6c8cc4903ab5255cde5e4b0dc0 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 e424b8340f824bad18f6059d8dbf7507c0a7269d..f244b9644548755d25897bec314d18d1c81c50ea 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 4b6585811bbc392fd2369b49da76d887631b691f..5985892c912eb663208a2e80a04a159dc486d72a 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_ */