aboutsummaryrefslogtreecommitdiffhomepage
path: root/common.h
diff options
context:
space:
mode:
authorGravatar ridiculousfish <corydoras@ridiculousfish.com>2014-04-27 18:27:34 -0700
committerGravatar ridiculousfish <corydoras@ridiculousfish.com>2014-04-27 18:27:34 -0700
commit4948508277e424264a1b6232a6c275dd03fd584d (patch)
tree70cb6a42b079f8c21cd136d740f5d8d2f530dbcc /common.h
parentfb89c762fc909a4b5a5c51f51990185b30ec6857 (diff)
Squelch some more warnings on Linux
Diffstat (limited to 'common.h')
-rw-r--r--common.h13
1 files changed, 8 insertions, 5 deletions
diff --git a/common.h b/common.h
index 057db144..b22720b0 100644
--- a/common.h
+++ b/common.h
@@ -157,6 +157,10 @@ extern bool g_profiling_active;
*/
extern const wchar_t *program_name;
+/* Variants of read() and write() that ignores return values, defeating a warning */
+void read_ignore(int fd, void *buff, size_t count);
+void write_ignore(int fd, const void *buff, size_t count);
+
/**
This macro is used to check that an input argument is not null. It
is a bit lika a non-fatal form of assert. Instead of exit-ing on
@@ -180,11 +184,10 @@ extern const wchar_t *program_name;
*/
#define FATAL_EXIT() \
{ \
- char exit_read_buff; \
- show_stackframe(); \
- int ignore __attribute__((unused)); \
- ignore = read( 0, &exit_read_buff, 1 ); \
- exit_without_destructors( 1 ); \
+ char exit_read_buff; \
+ show_stackframe(); \
+ read_ignore( 0, &exit_read_buff, 1 ); \
+ exit_without_destructors( 1 ); \
} \