diff options
Diffstat (limited to 'include/my_global.h')
-rw-r--r-- | include/my_global.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/include/my_global.h b/include/my_global.h index 4ad851e9e5d..e7d0026ac53 100644 --- a/include/my_global.h +++ b/include/my_global.h @@ -564,6 +564,25 @@ int __void__; #define PURIFY_OR_LINT_INIT(var) #endif +/* + Suppress uninitialized variable warning without generating code. + + The _cplusplus is a temporary workaround for C++ code pending a fix + for a g++ bug (http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34772). +*/ +#if defined(_lint) || defined(FORCE_INIT_OF_VARS) || defined(__cplusplus) || \ + !defined(__GNUC__) +#define UNINIT_VAR(x) x= 0 +#else +#define UNINIT_VAR(x) x= x +#endif + +/* Define some useful general macros */ +#if !defined(max) +#define max(a, b) ((a) > (b) ? (a) : (b)) +#define min(a, b) ((a) < (b) ? (a) : (b)) +#endif + #if !defined(HAVE_UINT) #undef HAVE_UINT #define HAVE_UINT |