diff options
author | Rich Salz <rsalz@akamai.com> | 2016-01-30 12:04:25 -0500 |
---|---|---|
committer | Rich Salz <rsalz@openssl.org> | 2016-02-11 12:40:32 -0500 |
commit | f3f1cf8444f439c0be9de04bf3821a20d00fd956 (patch) | |
tree | 50d0fc624d4680e6cd734328126cd60a9dc128be /e_os.h | |
parent | 7823d792d0cad3b44ad5389a8d3381becefe7f44 (diff) |
Move to REF_DEBUG, for consistency.
Add utility macros REF_ASSERT_NOT and REF_PRINT_COUNT
This is also RT 4181
Reviewed-by: Richard Levitte <levitte@openssl.org>
Diffstat (limited to 'e_os.h')
-rw-r--r-- | e_os.h | 25 |
1 files changed, 18 insertions, 7 deletions
@@ -71,15 +71,26 @@ extern "C" { #endif /* Used to checking reference counts, most while doing perl5 stuff :-) */ -# ifdef REF_PRINT -# undef REF_PRINT -# define REF_PRINT(a,b) fprintf(stderr,"%08X:%4d:%s\n",(int)b,b->references,a) +# if defined(OPENSSL_NO_STDIO) +# if defined(REF_DEBUG) +# error "REF_DEBUG requires stdio" +# endif +# if defined(REF_PRINT) +# error "REF_PRINT requires stdio" +# endif # endif -# if defined(OPENSSL_NO_STDIO) && defined(REF_CHECK) -# error "Cannot have REF_CHECK with no-stdio" + +# if defined(REF_DEBUG) +# define REF_ASSERT_ISNT(test) \ + (void)((test) ? (OpenSSLDie(__FILE__, __LINE__, "refcount error"), 1) : 0) +# else +# define REF_ASSERT_ISNT(i) # endif -# if defined(OPENSSL_NO_STDIO) && defined(REF_PRINT) -# error "Cannot have REF_PRINT with no-stdio" +# ifdef REF_PRINT +# define REF_PRINT_COUNT(a, b) \ + fprintf(stderr, "%p:%4d:%s\n", b, b->references, a) +# else +# define REF_PRINT_COUNT(a, b) # endif # ifndef DEVRANDOM |