mirror of
https://github.com/znc/znc.git
synced 2026-07-21 09:03:32 +02:00
Add defines.h for Csocket and make Csocket use ZNC's DEBUG()
This adds a new file defines.h and moves all the Csocket specific stuff from main.h into this new file. Then this makes Csocket use ZNC's DEBUG() macro for its debug output which means this can now also be enabled by running znc --debug. git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1445 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
@@ -85,7 +85,7 @@
|
||||
#include <set>
|
||||
#include <map>
|
||||
|
||||
#include "main.h" // require this as a general rule, most projects have a defines.h or the like
|
||||
#include "defines.h" // require this as a general rule, most projects have a defines.h or the like
|
||||
|
||||
#ifndef CS_STRING
|
||||
# ifdef _HAS_CSTRING_
|
||||
@@ -103,11 +103,13 @@
|
||||
#endif /* __DEBUG__ */
|
||||
#endif /* CS_DEBUG */
|
||||
|
||||
#ifndef PERROR
|
||||
#ifdef __DEBUG__
|
||||
# define PERROR( f ) __Perror( f, __FILE__, __LINE__ )
|
||||
#else
|
||||
# define PERROR( f ) (void)0
|
||||
#endif /* __DEBUG__ */
|
||||
#endif
|
||||
|
||||
#ifndef _NO_CSOCKET_NS // some people may not want to use a namespace
|
||||
namespace Csocket
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
/*
|
||||
* Copyright (C) 2004-2009 See the AUTHORS file for details.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 as published
|
||||
* by the Free Software Foundation.
|
||||
*/
|
||||
|
||||
#ifndef _DEFINES_H
|
||||
#define _DEFINES_H
|
||||
|
||||
// This header file is just for Csocket
|
||||
|
||||
#include "main.h"
|
||||
#include "Utils.h"
|
||||
|
||||
#define CS_STRING CString
|
||||
#define _NO_CSOCKET_NS
|
||||
|
||||
#ifdef _DEBUG
|
||||
#define __DEBUG__
|
||||
#endif
|
||||
|
||||
// Redefine some Csocket debugging mechanisms to use znc's
|
||||
#define CS_DEBUG(f) DEBUG(__FILE__ << ":" << __LINE__ << " " << f)
|
||||
#define PERROR(f) DEBUG(__FILE__ << ":" << __LINE__ << " " << f << ": " << strerror(GetSockError()))
|
||||
|
||||
|
||||
#endif // !_DEFINES_H
|
||||
@@ -53,24 +53,9 @@
|
||||
#define MODULECALL(macFUNC, macUSER, macCLIENT, macEXITER)
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef CS_STRING
|
||||
#define CS_STRING CString
|
||||
#endif
|
||||
|
||||
#ifndef _NO_CSOCKET_NS
|
||||
#define _NO_CSOCKET_NS
|
||||
#endif
|
||||
|
||||
#ifdef _DEBUG
|
||||
#define __DEBUG__
|
||||
#endif
|
||||
|
||||
#include <iostream>
|
||||
using std::cout;
|
||||
using std::cerr;
|
||||
using std::endl;
|
||||
|
||||
#include "ZNCString.h"
|
||||
|
||||
#endif // !_MAIN_H
|
||||
|
||||
Reference in New Issue
Block a user