From 4fa9fd843e19d041a6b142722e1f2c717a45f625 Mon Sep 17 00:00:00 2001 From: Haru Date: Mon, 12 Jan 2015 18:29:24 +0100 Subject: Blocked compilation of plugins that use unavailable functions - Rather than failing at runtime, plugins that try to access non-interfaced, unavailable functions or variables, will now show an error at compile-time. Signed-off-by: Haru --- src/common/utils.h | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/common/utils.h') diff --git a/src/common/utils.h b/src/common/utils.h index 421698d95..e6102f184 100644 --- a/src/common/utils.h +++ b/src/common/utils.h @@ -13,6 +13,10 @@ /* [HCache] 1-byte key to ensure our method is the latest, we can modify to ensure the method matches */ #define HCACHE_KEY 'k' +//Caps values to min/max +#define cap_value(a, min, max) (((a) >= (max)) ? (max) : ((a) <= (min)) ? (min) : (a)) + +#ifdef HERCULES_CORE // generate a hex dump of the first 'length' bytes of 'buffer' void WriteDump(FILE* fp, const void* buffer, size_t length); void ShowDump(const void* buffer, size_t length); @@ -20,9 +24,6 @@ void ShowDump(const void* buffer, size_t length); void findfile(const char *p, const char *pat, void (func)(const char*)); bool exists(const char* filename); -//Caps values to min/max -#define cap_value(a, min, max) (((a) >= (max)) ? (max) : ((a) <= (min)) ? (min) : (a)) - /// calculates the value of A / B, in percent (rounded down) unsigned int get_percentage(const unsigned int A, const unsigned int B); @@ -49,6 +50,7 @@ extern float GetFloat(const unsigned char* buf); size_t hread(void * ptr, size_t size, size_t count, FILE * stream); size_t hwrite(const void * ptr, size_t size, size_t count, FILE * stream); +#endif // HERCULES_CORE /* [Ind/Hercules] Caching */ struct HCache_interface { @@ -63,6 +65,8 @@ struct HCache_interface { struct HCache_interface *HCache; +#ifdef HERCULES_CORE void HCache_defaults(void); +#endif // HERCULES_CORE #endif /* COMMON_UTILS_H */ -- cgit v1.2.3-70-g09d2