diff options
author | wukong <rebirthmonkey@gmail.com> | 2015-11-23 17:48:48 +0100 |
---|---|---|
committer | wukong <rebirthmonkey@gmail.com> | 2015-11-23 17:48:48 +0100 |
commit | fca74d4bc3569506a6659880a89aa009dc11f552 (patch) | |
tree | 4cefd06af989608ea8ebd3bc6306889e2a1ad175 /moon-abe/pbc-0.5.14/include/pbc_utils.h | |
parent | 840ac3ebca7af381132bf7e93c1e4c0430d6b16a (diff) |
moon-abe cleanup
Change-Id: Ie1259856db03f0b9e80de3e967ec6bd1f03191b3
Diffstat (limited to 'moon-abe/pbc-0.5.14/include/pbc_utils.h')
-rw-r--r-- | moon-abe/pbc-0.5.14/include/pbc_utils.h | 86 |
1 files changed, 0 insertions, 86 deletions
diff --git a/moon-abe/pbc-0.5.14/include/pbc_utils.h b/moon-abe/pbc-0.5.14/include/pbc_utils.h deleted file mode 100644 index 62c02b07..00000000 --- a/moon-abe/pbc-0.5.14/include/pbc_utils.h +++ /dev/null @@ -1,86 +0,0 @@ -#ifndef __PBC_UTILS_H__ -#define __PBC_UTILS_H__ - -#ifdef PBC_DEBUG - -/*@manual debug -Macro: if `expr` evaluates to 0, print `msg` and exit. -*/ -#define PBC_ASSERT(expr, msg) \ - (pbc_assert(expr, msg, __func__)) - -/*@manual debug -Macro: if elements `a` and `b` are from different fields then exit. -*/ -#define PBC_ASSERT_MATCH2(a, b) \ - (pbc_assert_match2(a, b, __func__)) - -/*@manual debug -Macro: if elements `a`, `b` and `c` are from different fields then exit. -*/ -#define PBC_ASSERT_MATCH3(a, b, c) \ - (pbc_assert_match3(a, b, c, __func__)) - -#else - -#define PBC_ASSERT(expr, msg) ((void) (0)) -#define PBC_ASSERT_MATCH2(a, b) ((void) (0)) -#define PBC_ASSERT_MATCH3(a, b, c) ((void) (0)) - -#endif - -// die, warn and info based on Git code. - -/*@manual log -By default error messages are printed to standard error. -Call `pbc_set_msg_to_stderr(0)` to suppress messages. -*/ -int pbc_set_msg_to_stderr(int i); - -/*@manual log -Reports error message and exits with code 128. -*/ -void pbc_die(const char *err, ...) - __attribute__((__noreturn__)) - __attribute__((format (printf, 1, 2))); - -/*@manual log -Reports informational message. -*/ -void pbc_info(const char *err, ...) - __attribute__((format (printf, 1, 2))); - -/*@manual log -Reports warning message. -*/ -void pbc_warn(const char *err, ...) - __attribute__((format (printf, 1, 2))); - -/*@manual log -Reports error message. -*/ -void pbc_error(const char *err, ...) - __attribute__((format (printf, 1, 2))); - -#ifndef UNUSED_VAR -#if defined(__GNUC__) -// We could use __attribute__((unused)) instead. -#define UNUSED_VAR(a) (void) a -#else -// From the ACE project: http://www.cs.wustl.edu/~schmidt/ACE.html -// silences warnings, and generates no code for many compilers -// See ACE_wrappers/ace/ace/config-macros.h:391 -// -// Not anymore: gcc no longer likes it -blynn -#define UNUSED_VAR(a) do { /* nothing */ } while (&a == 0) -#endif -#endif - -// For storing small integers in void * -// C99 standard introduced the intptr_t and uintptr_t types, -// guaranteed to be able to hold pointers -static inline void *int_to_voidp(intptr_t i) { - return (void *) i; -} - -#endif //__PBC_UTILS_H__ |