Hi, noticed that output_api.h lack extern "C" wrappers, would like to
add the attached patch.
/MF
Index: include/net-snmp/output_api.h
===================================================================
--- include/net-snmp/output_api.h (revision 19383)
+++ include/net-snmp/output_api.h (working copy)
@@ -9,6 +9,10 @@
#include <net-snmp/types.h>
#include <stdarg.h> /* for va_list */
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/* Error reporting */
NETSNMP_IMPORT
void snmp_error(netsnmp_session *sess, int *clib_errorno,
@@ -137,6 +141,10 @@
* Hence they are listed here:
*/
+#ifdef __cplusplus
+}
+#endif
+
#include <net-snmp/library/snmp_api.h>
#include <net-snmp/library/snmp_client.h>
#include <net-snmp/library/snmp_debug.h>
Index: include/net-snmp/library/snmp_logging.h
===================================================================
--- include/net-snmp/library/snmp_logging.h (revision 19383)
+++ include/net-snmp/library/snmp_logging.h (working copy)
@@ -1,10 +1,6 @@
#ifndef SNMP_LOGGING_H
#define SNMP_LOGGING_H
-#ifdef __cplusplus
-extern "C" {
-#endif
-
#include <net-snmp/types.h>
#include <net-snmp/output_api.h>
@@ -14,6 +10,10 @@
#include <stdio.h>
#include <stdarg.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#ifndef LOG_ERR
#define LOG_EMERG 0 /* system is unusable */
#define LOG_ALERT 1 /* action must be taken immediately */
@@ -43,22 +43,13 @@
} while(0)
void init_snmp_logging(void);
-/* Moved to output_api.h
- void shutdown_snmp_logging(void);
NETSNMP_IMPORT
- int snmp_get_do_logging(void);
- */
- NETSNMP_IMPORT
void snmp_disable_syslog(void);
void snmp_disable_filelog(void);
NETSNMP_IMPORT
void snmp_disable_stderrlog(void);
void snmp_disable_calllog(void);
-/* Moved to output_api.h
NETSNMP_IMPORT
- void snmp_disable_log(void);
- */
- NETSNMP_IMPORT
void snmp_enable_syslog(void);
NETSNMP_IMPORT
void snmp_enable_syslog_ident(const char *ident,
@@ -73,19 +64,6 @@
NETSNMP_IMPORT
int snmp_stderrlog_status(void);
-/* Moved to output_api.h
-#if !defined(__GNUC__) || __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 8)
- NETSNMP_IMPORT
- int snmp_log(int priority, const char *format, ...);
-#else
- NETSNMP_IMPORT
- int snmp_log(int priority, const char *format, ...)
- __attribute__ ((__format__ (__printf__, 2, 3)));
-#endif
- int snmp_vlog(int priority, const char *format,
- va_list ap);
- */
-
/*
* 0 - successful message formatting
* -1 - Could not format log-string
@@ -93,12 +71,7 @@
* -3 - Log-message too long!
*/
-/* Moved to output_api.h
- NETSNMP_IMPORT
- void snmp_log_perror(const char *s);
- */
-
#define NETSNMP_LOGHANDLER_STDOUT 1
#define NETSNMP_LOGHANDLER_STDERR 2
#define NETSNMP_LOGHANDLER_FILE 3
@@ -154,7 +127,9 @@
void netsnmp_disable_this_loghandler( netsnmp_log_handler *logh );
NETSNMP_IMPORT
void netsnmp_logging_restart(void);
+
#ifdef __cplusplus
}
#endif
+
#endif /* SNMP_LOGGING_H */
------------------------------------------------------------------------------
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders