From caa1e87410fb74606f2ec91b5fd1b897053149bf Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Sun, 8 Nov 2015 02:31:01 -0800 Subject: Use ws_{read,write,fdopen,close}. Be more consistent about using the ws_ routines, as we suggest in README.developer. In C++ on UN*X, define ws_close as ::close rather than close, so that it works even in classes with methods or members named "close". Change-Id: Ide2652229e6b6b4624cbddae0e909a4ea1efa591 Reviewed-on: https://code.wireshark.org/review/11637 Reviewed-by: Guy Harris --- wsutil/file_util.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'wsutil') diff --git a/wsutil/file_util.h b/wsutil/file_util.h index dff51bbe83..813c349cfc 100644 --- a/wsutil/file_util.h +++ b/wsutil/file_util.h @@ -182,7 +182,14 @@ WS_DLL_PUBLIC void create_app_running_mutex(); #define ws_read read #define ws_write write +#ifdef __cplusplus +/* + * Just in case this is used in a class with a close method or member. + */ +#define ws_close ::close +#else #define ws_close close +#endif #define ws_dup dup #define ws_fstat64 fstat /* AC_SYS_LARGEFILE should make off_t 64-bit */ #define ws_lseek64 lseek /* AC_SYS_LARGEFILE should make off_t 64-bit */ -- cgit v1.2.3