Skip to content

Commit

Permalink
Use gnu_printf for Windows build
Browse files Browse the repository at this point in the history
Signed-off-by: Stefan Weil <sw@weilnetz.de>
  • Loading branch information
stweil committed May 19, 2024
1 parent 4328400 commit adf7ee5
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/ccutil/errcode.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class TESS_API ERRCODE { // error handler class
const char *caller, // function location
TessErrorLogCode action, // action to take
const char *format, ... // fprintf format
) const __attribute__((format(printf, 4, 5)));
) const __attribute__((format(gnu_printf, 4, 5)));
void error(const char *caller, TessErrorLogCode action) const;
constexpr ERRCODE(const char *string) : message(string) {} // initialize with string
};
Expand Down
2 changes: 1 addition & 1 deletion src/ccutil/tprintf.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ extern TESS_API INT_VAR_H(log_level);
// Main logging function.
extern TESS_API void tprintf( // Trace printf
const char *format, ...) // Message
__attribute__((format(printf, 1, 2)));
__attribute__((format(gnu_printf, 1, 2)));

} // namespace tesseract

Expand Down
4 changes: 2 additions & 2 deletions src/viewer/scrollview.h
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ class TESS_API ScrollView {
// ...which can be added by this command.
// This is intended as an "debug" output window.
void AddMessage(const char *message);
void AddMessageF(const char *format, ...) __attribute__((format(printf, 2, 3)));
void AddMessageF(const char *format, ...) __attribute__((format(gnu_printf, 2, 3)));

// Zoom the window to the rectangle given upper left corner and
// lower right corner.
Expand All @@ -311,7 +311,7 @@ class TESS_API ScrollView {
// this just for fun will likely break your application!
// It is public so you can actually take use of the LUA functionalities, but
// be careful!
void SendMsg(const char* msg, ...) __attribute__((format(printf, 2, 3)));
void SendMsg(const char* msg, ...) __attribute__((format(gnu_printf, 2, 3)));

// Custom messages (manipulating java code directly) can be send through this.
// Send a message to the server without adding the
Expand Down

0 comments on commit adf7ee5

Please sign in to comment.