Add 'extern "C"' for C++ compatibility; also check for __cplusplus
authorTheodore Tso <tytso@mit.edu>
Tue, 18 Mar 1997 20:08:48 +0000 (20:08 +0000)
committerTheodore Tso <tytso@mit.edu>
Tue, 18 Mar 1997 20:08:48 +0000 (20:08 +0000)
since some C++ compilers don't set __STDC__

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@10009 dc483132-0cff-0310-8789-dd5450dbe970

src/util/et/ChangeLog
src/util/et/com_err.h

index 086fad587062487e00d0aeaa4fa02f3f6decee41..e886e3a889486229df691b5909c40e2cc52ca8ae 100644 (file)
@@ -1,3 +1,8 @@
+Tue Mar 18 15:07:40 1997  Theodore Ts'o  <tytso@rsts-11.mit.edu>
+
+       * com_err.h: Add 'extern "C"' for C++ compatibility; also check for
+               __cplusplus since some C++ compilers don't set __STDC__
+
 Mon Mar  3 14:57:35 1997  Ezra Peisach  <epeisach@mit.edu>
 
        * error_message.c: Don't declare sys_nerr on Macintosh.
index b425c802325918c4c89f385246a6e4d73f62deb8..26c673b6f9fb145544ef1f2dfca0e0e26bfe2825 100644 (file)
@@ -36,7 +36,7 @@
 #define NEAR
 #endif
 
-#if defined(__STDC__) || defined(_MSDOS) || defined(_WIN32) || defined(_MACINTOSH)
+#if defined(__STDC__) || defined(__cplusplus) || defined(_MSDOS) || defined(_WIN32) || defined(_MACINTOSH)
 
 /* End-user programs may need this -- oh well */
 #ifndef HAVE_STDARG_H
@@ -68,6 +68,10 @@ struct error_table {
        unsigned int n_msgs;
 };
 
+#ifdef __cplusplus
+#extern "C" {
+#endif
+
 KRB5_DLLIMP extern void KRB5_CALLCONV_C com_err
        ET_STDARG_P((const char FAR *, errcode_t, const char FAR *, ...));
 KRB5_DLLIMP extern void KRB5_CALLCONV com_err_va
@@ -93,5 +97,9 @@ extern et_old_error_hook_func reset_com_err_hook
        ET_P((void));
 #endif
 
+#ifdef __cplusplus
+}
+#endif
+
 #define __COM_ERR_H
 #endif /* ! defined(__COM_ERR_H) */