From 5db7c799055c6ae9c4463f6cf4c88a35597d5d31 Mon Sep 17 00:00:00 2001 From: Haru Date: Sun, 28 Feb 2016 02:17:21 +0100 Subject: Added type-checking for the addHookPre() and addHookPost() macros - The macros will now throw a warning at compile time if a plugin is using a wrong function type for a pre or post hook. This avoids some very subtle, hard to detect, issues. - The macros now require 3 arguments instead of 2. Example: old code: addHookPre("ifname->function" my_hook); becomes: addHookPre(ifname, function, my_hook); Signed-off-by: Haru --- src/plugins/HPMHooking/HPMHooking.Defs.inc | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 src/plugins/HPMHooking/HPMHooking.Defs.inc (limited to 'src/plugins/HPMHooking/HPMHooking.Defs.inc') diff --git a/src/plugins/HPMHooking/HPMHooking.Defs.inc b/src/plugins/HPMHooking/HPMHooking.Defs.inc new file mode 100644 index 000000000..72490c7c1 --- /dev/null +++ b/src/plugins/HPMHooking/HPMHooking.Defs.inc @@ -0,0 +1,24 @@ +/** + * This file is part of Hercules. + * http://herc.ws - http://github.com/HerculesWS/Hercules + * + * Copyright (C) 2013-2016 Hercules Dev Team + * + * Hercules is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +/* + * NOTE: This file was auto-generated and should never be manually edited, + * as it will get overwritten. + */ -- cgit v1.2.3-60-g2f50