# HG changeset patch # User David Demelier # Date 1614186842 -3600 # Node ID bab959e4a55abc8fff72d4e463644610ca1f9ef1 # Parent 724ecacb5a171930d0f77b3f20106ed022e56758 lib: add extern C {} for those who write C++ plugins diff -r 724ecacb5a17 -r bab959e4a55a lib/CMakeLists.txt --- a/lib/CMakeLists.txt Wed Feb 24 10:19:18 2021 +0100 +++ b/lib/CMakeLists.txt Wed Feb 24 18:14:02 2021 +0100 @@ -23,6 +23,7 @@ set( HEADERS irccd/channel.h + irccd/conn.h irccd/event.h irccd/hook.h irccd/irccd.h diff -r 724ecacb5a17 -r bab959e4a55a lib/irccd/channel.h --- a/lib/irccd/channel.h Wed Feb 24 10:19:18 2021 +0100 +++ b/lib/irccd/channel.h Wed Feb 24 18:14:02 2021 +0100 @@ -24,6 +24,10 @@ #include "limits.h" +#if defined(__cplusplus) +extern "C" { +#endif + struct irc_channel_user { char nickname[IRC_NICKNAME_LEN]; int modes; @@ -58,4 +62,8 @@ void irc_channel_finish(struct irc_channel *); +#if defined(__cplusplus) +} +#endif + #endif /* !IRCCD_CHANNEL_H */ diff -r 724ecacb5a17 -r bab959e4a55a lib/irccd/conn.h --- a/lib/irccd/conn.h Wed Feb 24 10:19:18 2021 +0100 +++ b/lib/irccd/conn.h Wed Feb 24 18:14:02 2021 +0100 @@ -27,6 +27,10 @@ #include "limits.h" +#if defined(__cplusplus) +extern "C" { +#endif + struct addrinfo; struct pollfd; @@ -101,4 +105,8 @@ void irc_conn_finish(struct irc_conn *); +#if defined(__cplusplus) +} +#endif + #endif /* !IRCCD_CONN_H */ diff -r 724ecacb5a17 -r bab959e4a55a lib/irccd/event.h --- a/lib/irccd/event.h Wed Feb 24 10:19:18 2021 +0100 +++ b/lib/irccd/event.h Wed Feb 24 18:14:02 2021 +0100 @@ -23,6 +23,10 @@ #include "limits.h" +#if defined(__cplusplus) +extern "C" { +#endif + struct irc_server; /* @@ -148,4 +152,8 @@ void irc_event_finish(struct irc_event *); +#if defined(__cplusplus) +} +#endif + #endif /* !IRCCD_EVENT_H */ diff -r 724ecacb5a17 -r bab959e4a55a lib/irccd/hook.h --- a/lib/irccd/hook.h Wed Feb 24 10:19:18 2021 +0100 +++ b/lib/irccd/hook.h Wed Feb 24 18:14:02 2021 +0100 @@ -24,6 +24,10 @@ #include "limits.h" +#if defined(__cplusplus) +extern "C" { +#endif + struct irc_event; struct irc_hook { @@ -43,4 +47,8 @@ void irc_hook_finish(struct irc_hook *); +#if defined(__cplusplus) +} +#endif + #endif /* !IRCCD_HOOK_H */ diff -r 724ecacb5a17 -r bab959e4a55a lib/irccd/irccd.h --- a/lib/irccd/irccd.h Wed Feb 24 10:19:18 2021 +0100 +++ b/lib/irccd/irccd.h Wed Feb 24 18:14:02 2021 +0100 @@ -26,6 +26,10 @@ #include "rule.h" #include "server.h" +#if defined(__cplusplus) +extern "C" { +#endif + extern struct irc { struct irc_server_list servers; struct irc_plugin_list plugins; @@ -115,4 +119,8 @@ void irc_bot_finish(void); +#if defined(__cplusplus) +} +#endif + #endif /* !IRCCD_H */ diff -r 724ecacb5a17 -r bab959e4a55a lib/irccd/log.h --- a/lib/irccd/log.h Wed Feb 24 10:19:18 2021 +0100 +++ b/lib/irccd/log.h Wed Feb 24 18:14:02 2021 +0100 @@ -19,6 +19,10 @@ #ifndef IRCCD_LOG_H #define IRCCD_LOG_H +#if defined(__cplusplus) +extern "C" { +#endif + void irc_log_to_syslog(void); @@ -46,4 +50,8 @@ void irc_log_finish(void); +#if defined(__cplusplus) +} +#endif + #endif /* !IRCCD_LOG_H */ diff -r 724ecacb5a17 -r bab959e4a55a lib/irccd/plugin.h --- a/lib/irccd/plugin.h Wed Feb 24 10:19:18 2021 +0100 +++ b/lib/irccd/plugin.h Wed Feb 24 18:14:02 2021 +0100 @@ -23,6 +23,10 @@ #include "limits.h" +#if defined(__cplusplus) +extern "C" { +#endif + struct irc_event; struct irc_plugin { @@ -116,4 +120,8 @@ void irc_plugin_loader_finish(struct irc_plugin_loader *); +#if defined(__cplusplus) +} +#endif + #endif /* !IRCCD_PLUGIN_H */ diff -r 724ecacb5a17 -r bab959e4a55a lib/irccd/rule.h --- a/lib/irccd/rule.h Wed Feb 24 10:19:18 2021 +0100 +++ b/lib/irccd/rule.h Wed Feb 24 18:14:02 2021 +0100 @@ -23,6 +23,10 @@ #include "limits.h" +#if defined(__cplusplus) +extern "C" { +#endif + enum irc_rule_action { IRC_RULE_ACCEPT, IRC_RULE_DROP @@ -68,4 +72,8 @@ void irc_rule_finish(struct irc_rule *); +#if defined(__cplusplus) +} +#endif + #endif /* !IRCCD_RULE_H */ diff -r 724ecacb5a17 -r bab959e4a55a lib/irccd/server.h --- a/lib/irccd/server.h Wed Feb 24 10:19:18 2021 +0100 +++ b/lib/irccd/server.h Wed Feb 24 18:14:02 2021 +0100 @@ -27,6 +27,10 @@ #include "event.h" #include "limits.h" +#if defined(__cplusplus) +extern "C" { +#endif + struct pollfd; struct irc_conn; @@ -178,4 +182,8 @@ void irc_server_decref(struct irc_server *); +#if defined(__cplusplus) +} +#endif + #endif /* !IRCCD_SERVER_H */ diff -r 724ecacb5a17 -r bab959e4a55a lib/irccd/subst.h --- a/lib/irccd/subst.h Wed Feb 24 10:19:18 2021 +0100 +++ b/lib/irccd/subst.h Wed Feb 24 18:14:02 2021 +0100 @@ -23,6 +23,10 @@ #include #include +#if defined(__cplusplus) +extern "C" { +#endif + enum irc_subst_flags { IRC_SUBST_DATE = (1 << 0), IRC_SUBST_KEYWORDS = (1 << 1), @@ -47,4 +51,8 @@ ssize_t irc_subst(char *, size_t, const char *, const struct irc_subst *); +#if defined(__cplusplus) +} +#endif + #endif /* !IRCCD_SUBST_H */ diff -r 724ecacb5a17 -r bab959e4a55a lib/irccd/util.h --- a/lib/irccd/util.h Wed Feb 24 10:19:18 2021 +0100 +++ b/lib/irccd/util.h Wed Feb 24 18:14:02 2021 +0100 @@ -21,6 +21,10 @@ #include +#if defined(__cplusplus) +extern "C" { +#endif + #define IRC_UTIL_SIZE(x) (sizeof (x) / sizeof (x[0])) /* Suitable convenient typedef for bsearch/qsort. */ @@ -59,4 +63,8 @@ char * irc_util_printf(char *, size_t, const char *, ...); +#if defined(__cplusplus) +} +#endif + #endif /* !IRCCD_UTIL_H */