mirror of
https://github.com/znc/znc.git
synced 2026-03-28 17:42:41 +01:00
Fix an ODR violation
Building with CFLAGS="-flto -Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing" CXXFLAGS="-flto -Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing" LDFLAGS=-flto fails due to a violation of the one definition rule. There are two different definitions of TOption that are both linked into the znc binary. Fix this by putting them into anonymous namespaces. Fixes: https://github.com/znc/znc/issues/1834 Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit is contained in:
@@ -135,11 +135,13 @@ CUser::~CUser() {
|
||||
CZNC::Get().AddBytesWritten(m_uBytesWritten);
|
||||
}
|
||||
|
||||
namespace {
|
||||
template <class T>
|
||||
struct TOption {
|
||||
const char* name;
|
||||
void (CUser::*pSetter)(T);
|
||||
};
|
||||
}
|
||||
|
||||
bool CUser::ParseConfig(CConfig* pConfig, CString& sError) {
|
||||
TOption<const CString&> StringOptions[] = {
|
||||
|
||||
Reference in New Issue
Block a user