File tree Expand file tree Collapse file tree 2 files changed +8
-21
lines changed
Expand file tree Collapse file tree 2 files changed +8
-21
lines changed Original file line number Diff line number Diff line change @@ -70,15 +70,6 @@ FILE *get_debugfp() {
7070 return debugfp;
7171}
7272
73- // Trace printf.
74- void tprintf (const char *format, ...) {
75- FILE *f = get_debugfp ();
76- va_list args; // variable args
77- va_start (args, format); // variable list
78- vfprintf (f, format, args);
79- va_end (args);
80- }
81-
8273TessErrStream tesserr;
8374
8475} // namespace tesseract
Original file line number Diff line number Diff line change 2121
2222#include " params.h" // for INT_VAR_H
2323#include < tesseract/export.h> // for TESS_API
24+ #include < utility> // for std::forward
2425
2526namespace tesseract {
2627
27- #if !defined(__GNUC__) && !defined(__attribute__)
28- # define __attribute__ (attr ) // compiler without support for __attribute__
29- #endif
30-
3128// Disable some log messages by setting log_level > 0.
3229extern TESS_API INT_VAR_H (log_level);
3330
34- // Main logging function.
35- extern TESS_API void tprintf ( // Trace printf
36- const char *format, ...) // Message
37- __attribute__((format(printf, 1 , 2 )));
38-
3931// Get file for debug output.
40- FILE *get_debugfp ();
32+ TESS_API FILE *get_debugfp ();
4133
42- } // namespace tesseract
34+ // Main logging function. Trace printf.
35+ template <typename ... Types>
36+ auto tprintf (Types && ... args) {
37+ return fprintf (get_debugfp (), std::forward<Types>(args)...);
38+ }
4339
44- # undef __attribute__
40+ } // namespace tesseract
4541
4642#endif // define TESSERACT_CCUTIL_TPRINTF_H
You can’t perform that action at this time.
0 commit comments