summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/internal/refcount.h18
-rw-r--r--include/openssl/e_os2.h2
-rw-r--r--include/openssl/trace.h4
3 files changed, 9 insertions, 15 deletions
diff --git a/include/internal/refcount.h b/include/internal/refcount.h
index ee506e592d..7412d62f56 100644
--- a/include/internal/refcount.h
+++ b/include/internal/refcount.h
@@ -11,13 +11,7 @@
# pragma once
# include <openssl/e_os2.h>
-
-/* Used to checking reference counts, most while doing perl5 stuff :-) */
-# if defined(OPENSSL_NO_STDIO)
-# if defined(REF_PRINT)
-# error "REF_PRINT requires stdio"
-# endif
-# endif
+# include <openssl/trace.h>
# ifndef OPENSSL_DEV_NO_ATOMICS
# if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L \
@@ -176,11 +170,9 @@ typedef int CRYPTO_REF_COUNT;
# define REF_ASSERT_ISNT(i)
# endif
-# ifdef REF_PRINT
-# define REF_PRINT_COUNT(a, b) \
- fprintf(stderr, "%p:%4d:%s\n", (void*)b, b->references, a)
-# else
-# define REF_PRINT_COUNT(a, b)
-# endif
+# define REF_PRINT_EX(text, count, object) \
+ OSSL_TRACE3(REF_COUNT, "%p:%4d:%s\n", (object), (count), (text));
+# define REF_PRINT_COUNT(text, object) \
+ REF_PRINT_EX(text, object->references, (void *)object)
#endif
diff --git a/include/openssl/e_os2.h b/include/openssl/e_os2.h
index 4ee41cad26..49e6dad73c 100644
--- a/include/openssl/e_os2.h
+++ b/include/openssl/e_os2.h
@@ -210,7 +210,7 @@ extern "C" {
# endif
# endif
-# ifdef DEBUG_UNUSED
+# if defined(UNUSEDRESULT_DEBUG)
# define __owur __attribute__((__warn_unused_result__))
# else
# define __owur
diff --git a/include/openssl/trace.h b/include/openssl/trace.h
index ad57babe4f..58e5cc8f11 100644
--- a/include/openssl/trace.h
+++ b/include/openssl/trace.h
@@ -56,7 +56,9 @@ extern "C" {
# define OSSL_TRACE_CATEGORY_STORE 14
# define OSSL_TRACE_CATEGORY_DECODER 15
# define OSSL_TRACE_CATEGORY_ENCODER 16
-# define OSSL_TRACE_CATEGORY_NUM 17
+# define OSSL_TRACE_CATEGORY_REF_COUNT 17
+/* Count of available categories. */
+# define OSSL_TRACE_CATEGORY_NUM 18
/* Returns the trace category number for the given |name| */
int OSSL_trace_get_category_num(const char *name);