- Made sure some changed behavior is documented in CHANGES.
- Moved the handling of compile-time defaults from crypto.h to
mem_dbg.c, since it doesn't make sense for the library users to try
to affect this without recompiling libcrypto.
- Made sure V_CRYPTO_MDEBUG_TIME and V_CRYPTO_MDEBUG_THREAD had clear
and constant definitions.
- Aesthetic correction.
diff --git a/crypto/mem_dbg.c b/crypto/mem_dbg.c
index 3465ec2..4bddbe0 100644
--- a/crypto/mem_dbg.c
+++ b/crypto/mem_dbg.c
@@ -106,7 +106,29 @@
APP_INFO *app_info;
} MEM;
-static int options = V_CRYPTO_MDEBUG_TIME | V_CRYPTO_MDEBUG_THREAD;
+
+#ifdef CRYPTO_MDEBUG_ALL
+# ifndef CRYPTO_MDEBUG_TIME
+# define CRYPTO_MDEBUG_TIME
+# endif
+# ifndef CRYPTO_MDEBUG_THREAD
+# define CRYPTO_MDEBUG_THREAD
+# endif
+#endif
+
+/* Get defaults that will depend on some macros defined elsewhere */
+#ifdef CRYPTO_MDEBUG_TIME
+#define DEF_V_CRYPTO_MDEBUG_TIME V_CRYPTO_MDEBUG_TIME
+#else
+#define DEF_V_CRYPTO_MDEBUG_TIME 0
+#endif
+#ifdef CRYPTO_MDEBUG_THREAD
+#define DEF_V_CRYPTO_MDEBUG_THREAD V_CRYPTO_MDEBUG_THREAD
+#else
+#define DEF_V_CRYPTO_MDEBUG_THREAD 0
+#endif
+
+static int options = DEF_V_CRYPTO_MDEBUG_TIME | DEF_V_CRYPTO_MDEBUG_THREAD;
int CRYPTO_mem_ctrl(int mode)