diff options
author | jsorg71 <jay.sorg@gmail.com> | 2016-03-16 20:51:58 -0700 |
---|---|---|
committer | jsorg71 <jay.sorg@gmail.com> | 2016-03-16 20:51:58 -0700 |
commit | 034ee36f9c3aa93098fac08d2da901d032460c78 (patch) | |
tree | 095d42574a819ff3d3e117b6798b39d0f1ed5099 /common | |
parent | 6b3fc5a373e818227c6bad8074952ac078eb37f5 (diff) | |
parent | 9091c3eef25734ff77185cb997334abaf5487404 (diff) | |
download | xrdp-proprietary-034ee36f9c3aa93098fac08d2da901d032460c78.tar.gz xrdp-proprietary-034ee36f9c3aa93098fac08d2da901d032460c78.zip |
Merge pull request #341 from proski/sanity-checks
Sanity checks
Diffstat (limited to 'common')
-rw-r--r-- | common/os_calls.h | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/common/os_calls.h b/common/os_calls.h index c7b6cb09..5f107f47 100644 --- a/common/os_calls.h +++ b/common/os_calls.h @@ -41,17 +41,26 @@ #define g_tcp_select g_sck_select #define g_close_wait_obj g_delete_wait_obj +#if defined(HAVE_FUNC_ATTRIBUTE_FORMAT) +#define printflike(arg_format, arg_first_check) \ + __attribute__((__format__(__printf__, arg_format, arg_first_check))) +#else +#define printflike(arg_format, arg_first_check) +#endif + int APP_CC g_rm_temp_dir(void); int APP_CC g_mk_temp_dir(const char* app_name); void APP_CC g_init(const char* app_name); void APP_CC g_deinit(void); void* APP_CC g_malloc(int size, int zero); void APP_CC g_free(void* ptr); -void DEFAULT_CC g_printf(const char *format, ...); -void DEFAULT_CC g_sprintf(char* dest, const char* format, ...); -void DEFAULT_CC g_snprintf(char* dest, int len, const char* format, ...); -void DEFAULT_CC g_writeln(const char* format, ...); -void DEFAULT_CC g_write(const char* format, ...); +void DEFAULT_CC g_printf(const char *format, ...) printflike(1, 2); +void DEFAULT_CC g_sprintf(char* dest, const char* format, ...) \ + printflike(2, 3); +void DEFAULT_CC g_snprintf(char* dest, int len, const char* format, ...) \ + printflike(3, 4); +void DEFAULT_CC g_writeln(const char* format, ...) printflike(1, 2); +void DEFAULT_CC g_write(const char* format, ...) printflike(1, 2); void APP_CC g_hexdump(char* p, int len); void APP_CC g_memset(void* ptr, int val, int size); void APP_CC g_memcpy(void* d_ptr, const void* s_ptr, int size); |