Diverse ERR fixes
1.  There are still references to the removed ERR_put_func_error().
2.  ERR_put_error() is deprecated as off version 3.0, so should
ERR_PUT_error().
3.  'no-err' didn't affect what was passed to ERR_set_debug().
Fixes
extern "C" {
#endif
+# if !OPENSSL_API_3
# ifndef OPENSSL_NO_ERR
# define ERR_PUT_error(l,f,r,fn,ln) ERR_put_error(l,f,r,fn,ln)
-# define ERR_PUT_func_error(l,f,r,fn,ln) ERR_put_func_error(l,f,r,fn,ln)
# else
# define ERR_PUT_error(l,f,r,fn,ln) ERR_put_error(l,f,r,NULL,0)
-# define ERR_PUT_func_error(l,f,r,fn,ln) ERR_put_func_error(l,f,r,NULL,0)
+# endif
# endif
# include <errno.h>
@@ -244,11 +244,21 @@ void ERR_set_debug(const char *file, int line, const char *func);
void ERR_set_error(int lib, int reason, const char *fmt, ...);
void ERR_vset_error(int lib, int reason, const char *fmt, va_list args);
+# ifndef OPENSSL_NO_ERR
+# define ERR_DBG_FILE OPENSSL_FILE
+# define ERR_DBG_LINE OPENSSL_LINE
+# define ERR_DBG_FUNC OPENSSL_FUNC
+# else
+# define ERR_DBG_FILE NULL
+# define ERR_DBG_LINE 0
+# define ERR_DBG_FUNC NULL
+# endif
+
/* Main error raising functions */
# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
# define ERR_raise_data \
(ERR_new(), \
- ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC), \
+ ERR_set_debug(ERR_DBG_FILE,ERR_DBG_LINE,ERR_DBG_FUNC), \
ERR_set_error)
# if !OPENSSL_API_3
