diff options
Diffstat (limited to 'dbus/dbus-sysdeps.h')
-rw-r--r-- | dbus/dbus-sysdeps.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/dbus/dbus-sysdeps.h b/dbus/dbus-sysdeps.h index c9d630a7f..171af7b56 100644 --- a/dbus/dbus-sysdeps.h +++ b/dbus/dbus-sysdeps.h @@ -132,15 +132,18 @@ typedef struct { SOCKET sock; } DBusSocket; # define DBUS_SOCKET_FORMAT "Iu" # define DBUS_SOCKET_INIT { INVALID_SOCKET } +_DBUS_GNUC_WARN_UNUSED_RESULT static inline SOCKET _dbus_socket_printable (DBusSocket s) { return s.sock; } +_DBUS_GNUC_WARN_UNUSED_RESULT static inline dbus_bool_t _dbus_socket_is_valid (DBusSocket s) { return s.sock != INVALID_SOCKET; } static inline void _dbus_socket_invalidate (DBusSocket *s) { s->sock = INVALID_SOCKET; } +_DBUS_GNUC_WARN_UNUSED_RESULT static inline int _dbus_socket_get_int (DBusSocket s) { return (int)s.sock; } @@ -150,20 +153,24 @@ typedef struct { int fd; } DBusSocket; # define DBUS_SOCKET_FORMAT "d" # define DBUS_SOCKET_INIT { -1 } +_DBUS_GNUC_WARN_UNUSED_RESULT static inline int _dbus_socket_printable (DBusSocket s) { return s.fd; } +_DBUS_GNUC_WARN_UNUSED_RESULT static inline dbus_bool_t _dbus_socket_is_valid (DBusSocket s) { return s.fd >= 0; } static inline void _dbus_socket_invalidate (DBusSocket *s) { s->fd = -1; } +_DBUS_GNUC_WARN_UNUSED_RESULT static inline int _dbus_socket_get_int (DBusSocket s) { return s.fd; } #endif /* not DBUS_WIN */ +_DBUS_GNUC_WARN_UNUSED_RESULT static inline DBusSocket _dbus_socket_get_invalid (void) { |