Mercurial > hg > th-libs
comparison th_ioctx.h @ 577:70d44ba005ac
Define a helper macro for __attribute__ ((__format__ (__printf__, 2, 3)))
TH_ATTR_PRINTF_FMT(2, 3) and use it, conditionally using a stub for MINGW64
to avoid "useless" warnings.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Thu, 09 Jan 2020 18:27:48 +0200 |
parents | 262411458cde |
children | 594f197f7005 |
comparison
equal
deleted
inserted
replaced
576:e4ae9ef86332 | 577:70d44ba005ac |
---|---|
88 void (*msg)(th_ioctx *, const int, const char *msg)); | 88 void (*msg)(th_ioctx *, const int, const char *msg)); |
89 | 89 |
90 int th_io_error_v(th_ioctx *ctx, const int err, const char *fmt, va_list ap); | 90 int th_io_error_v(th_ioctx *ctx, const int err, const char *fmt, va_list ap); |
91 void th_io_msg_v(th_ioctx *ctx, const int level, const char *fmt, va_list ap); | 91 void th_io_msg_v(th_ioctx *ctx, const int level, const char *fmt, va_list ap); |
92 int th_io_error(th_ioctx *ctx, const int err, const char *fmt, ...) | 92 int th_io_error(th_ioctx *ctx, const int err, const char *fmt, ...) |
93 __attribute__ ((__format__ (__printf__, 3, 4))); | 93 TH_ATTR_PRINTF_FMT(3, 4); |
94 void th_io_msg(th_ioctx *ctx, const int level, const char *fmt, ...) | 94 void th_io_msg(th_ioctx *ctx, const int level, const char *fmt, ...) |
95 __attribute__ ((__format__ (__printf__, 3, 4))); | 95 TH_ATTR_PRINTF_FMT(3, 4); |
96 | 96 |
97 | 97 |
98 // | 98 // |
99 // Basic I/O operations | 99 // Basic I/O operations |
100 // | 100 // |
110 size_t thfwrite(const void *, const size_t, const size_t, th_ioctx *ctx); | 110 size_t thfwrite(const void *, const size_t, const size_t, th_ioctx *ctx); |
111 char * thfgets(char *ptr, int size, th_ioctx *ctx); | 111 char * thfgets(char *ptr, int size, th_ioctx *ctx); |
112 int thfputs(const char *ptr, th_ioctx *ctx); | 112 int thfputs(const char *ptr, th_ioctx *ctx); |
113 int thvfprintf(th_ioctx *ctx, const char *fmt, va_list ap); | 113 int thvfprintf(th_ioctx *ctx, const char *fmt, va_list ap); |
114 int thfprintf(th_ioctx *ctx, const char *fmt, ...) | 114 int thfprintf(th_ioctx *ctx, const char *fmt, ...) |
115 __attribute__ ((__format__ (__printf__, 2, 3))); | 115 TH_ATTR_PRINTF_FMT(2, 3); |
116 | 116 |
117 int thfread_str(th_ioctx *ctx, void *ptr, const size_t len); | 117 int thfread_str(th_ioctx *ctx, void *ptr, const size_t len); |
118 BOOL thfread_u8(th_ioctx *ctx, uint8_t *); | 118 BOOL thfread_u8(th_ioctx *ctx, uint8_t *); |
119 int thfwrite_str(th_ioctx *ctx, const void *ptr, const size_t len); | 119 int thfwrite_str(th_ioctx *ctx, const void *ptr, const size_t len); |
120 BOOL thfwrite_u8(th_ioctx *ctx, const uint8_t); | 120 BOOL thfwrite_u8(th_ioctx *ctx, const uint8_t); |