mirror of
https://github.com/tesseract-ocr/tesseract.git
synced 2025-06-07 09:52:40 +08:00
Restore non templated tprint() using va_args.
This commit is contained in:
parent
d6805c2608
commit
4a39a49607
@ -21,6 +21,7 @@
|
||||
|
||||
#include "params.h" // for INT_VAR_H
|
||||
#include <tesseract/export.h> // for TESS_API
|
||||
#include <cstdarg>
|
||||
#include <utility> // for std::forward
|
||||
|
||||
namespace tesseract {
|
||||
@ -32,12 +33,11 @@ extern TESS_API INT_VAR_H(log_level);
|
||||
TESS_API FILE *get_debugfp();
|
||||
|
||||
// Main logging function. Trace printf.
|
||||
template <typename ... Types>
|
||||
auto tprintf(Types && ... args) {
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wformat-security"
|
||||
return fprintf(get_debugfp(), std::forward<Types>(args)...);
|
||||
#pragma clang diagnostic pop
|
||||
inline void tprintf(const char *format, ...) {
|
||||
va_list args;
|
||||
va_start(args, format);
|
||||
vfprintf(get_debugfp(), format, args);
|
||||
va_end(args);
|
||||
}
|
||||
|
||||
} // namespace tesseract
|
||||
|
Loading…
Reference in New Issue
Block a user