Skip to content

Commit 4a39a49

Browse files
committed
Restore non templated tprint() using va_args.
1 parent d6805c2 commit 4a39a49

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/ccutil/tprintf.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121

2222
#include "params.h" // for INT_VAR_H
2323
#include <tesseract/export.h> // for TESS_API
24+
#include <cstdarg>
2425
#include <utility> // for std::forward
2526

2627
namespace tesseract {
@@ -32,12 +33,11 @@ extern TESS_API INT_VAR_H(log_level);
3233
TESS_API FILE *get_debugfp();
3334

3435
// Main logging function. Trace printf.
35-
template <typename ... Types>
36-
auto tprintf(Types && ... args) {
37-
#pragma clang diagnostic push
38-
#pragma clang diagnostic ignored "-Wformat-security"
39-
return fprintf(get_debugfp(), std::forward<Types>(args)...);
40-
#pragma clang diagnostic pop
36+
inline void tprintf(const char *format, ...) {
37+
va_list args;
38+
va_start(args, format);
39+
vfprintf(get_debugfp(), format, args);
40+
va_end(args);
4141
}
4242

4343
} // namespace tesseract

0 commit comments

Comments
 (0)