Add "extern C {...} to header files for C++ builds.
[freeradius.git] / src / include / sysutmp.h
index da26265..27d5cdd 100644 (file)
@@ -7,11 +7,14 @@
 #ifndef SYSUTMP_H_INCLUDED
 #define SYSUTMP_H_INCLUDED
 
+#include <freeradius-devel/ident.h>
+RCSIDH(sysutmp_h, "$Id$")
+
 /*
  *  If we have BOTH utmp.h and utmpx.h, then
  *  we prefer to use utmp.h, but only on systems other than Solaris.
  */
-#ifndef sun
+#if !defined(sun) && !defined(sgi) && !defined(hpux)
 #ifdef HAVE_UTMP_H
 #undef HAVE_UTMPX_H
 #endif
 #  define UT_NAMESIZE  32
 #  define UT_LINESIZE  32
 #  define UT_HOSTSIZE  257
+#ifdef hpux
+#  define ut_name ut_user
+#endif
 #else
 #  include <utmp.h>
 #endif
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #ifdef __osf__
 #  define UT_NAMESIZE  32
 #  define UT_LINESIZE  32
 #  define UT_HOSTSIZE  64
 #endif
 
-#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(bsdi) || defined(__OpenBSD__)
+#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(bsdi) || defined(__OpenBSD__) || defined(__APPLE__)
 #  ifndef UTMP_FILE
 #    define UTMP_FILE "/var/run/utmp"
 #  endif
@@ -92,4 +102,8 @@ struct utmp {
 
 #endif /* HAVE_UTMP_H */
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* SYSUTMP_H_INCLUDED */