diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-08-11 12:28:57 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-08-11 12:28:57 +0000 |
commit | 187c9208f119904d2da292670d5858e99d1306e2 (patch) | |
tree | 6edd8d7b8dde87a46924095e9ea2f70bf75dca9b | |
parent | e84bf9f3ec5a60078c32b272d3d7885c0708c544 (diff) |
Fix FOREACH_MOD macros
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@4881 e03df62e-2008-0410-955e-edbf42e46eb7
-rw-r--r-- | include/inspircd.h | 11 | ||||
-rw-r--r-- | include/modules.h | 8 |
2 files changed, 4 insertions, 15 deletions
diff --git a/include/inspircd.h b/include/inspircd.h index 3800c09ab..2ae54134e 100644 --- a/include/inspircd.h +++ b/include/inspircd.h @@ -47,17 +47,6 @@ enum DebugLevel NONE = 50, }; -/* I'm not entirely happy with this, the ## before 'args' is a g++ extension. - * The problem is that if you #define log(l, x, args...) and then call it - * with only two parameters, you get do_log(l, x, ), which is a syntax error... - * The ## tells g++ to remove the trailing comma... - * If this is ever an issue, we can just have an #ifndef GCC then #define log(a...) do_log(a) - */ -#define STRINGIFY2(x) #x -#define STRINGIFY(x) STRINGIFY2(x) -#define log(l, x, args...) ServerInstance->Log(l, __FILE__ ":" STRINGIFY(__LINE__) ": " x, ##args) -#define ilog(i, l, x, args...) i->Log(l, __FILE__ ":" STRINGIFY(__LINE__) ": " x, ##args) - /* This define is used in place of strcmp when we * want to check if a char* string contains only one * letter. Pretty fast, its just two compares and an diff --git a/include/modules.h b/include/modules.h index 6142af17a..5f7815605 100644 --- a/include/modules.h +++ b/include/modules.h @@ -97,7 +97,7 @@ typedef std::map<std::string,Module*> featurelist; } \ catch (ModuleException& modexcept) \ { \ - log(DEBUG,"Module exception caught: %s",modexcept.GetReason()); \ + ServerInstance->Log(DEBUG,"Module exception caught: %s",modexcept.GetReason()); \ } \ } \ } @@ -111,7 +111,7 @@ typedef std::map<std::string,Module*> featurelist; } \ catch (ModuleException& modexcept) \ { \ - ilog(z,DEBUG,"Module exception caught: %s",modexcept.GetReason()); \ + z->Log(DEBUG,"Module exception caught: %s",modexcept.GetReason()); \ } \ } \ } @@ -134,7 +134,7 @@ typedef std::map<std::string,Module*> featurelist; } \ catch (ModuleException& modexcept) \ { \ - log(DEBUG,"Module exception cought: %s",modexcept.GetReason()); \ + ServerInstance->Log(DEBUG,"Module exception cought: %s",modexcept.GetReason()); \ } \ } \ } \ @@ -155,7 +155,7 @@ typedef std::map<std::string,Module*> featurelist; } \ catch (ModuleException& modexcept) \ { \ - ilog(z,DEBUG,"Module exception cought: %s",modexcept.GetReason()); \ + z->Log(DEBUG,"Module exception cought: %s",modexcept.GetReason()); \ } \ } \ } \ |