From 0f5709b1262b17505c5bab06951611968a4bd326 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Tue, 15 Oct 2013 15:46:38 +0300 Subject: [PATCH 1/1] Move Handle::operator void * to the common part --- source/io/handle.cpp | 5 +++++ source/io/unix/handle.cpp | 6 ------ source/io/windows/handle.cpp | 6 ------ 3 files changed, 5 insertions(+), 12 deletions(-) diff --git a/source/io/handle.cpp b/source/io/handle.cpp index c20f067..693f93f 100644 --- a/source/io/handle.cpp +++ b/source/io/handle.cpp @@ -25,6 +25,11 @@ Handle::~Handle() delete priv; } +Handle::operator const void *() const +{ + return priv->handle!=INVALID_HANDLE_VALUE ? this : 0; +} + Handle::Private::Private(): handle(INVALID_HANDLE_VALUE) diff --git a/source/io/unix/handle.cpp b/source/io/unix/handle.cpp index ea8fa4e..307da64 100644 --- a/source/io/unix/handle.cpp +++ b/source/io/unix/handle.cpp @@ -8,12 +8,6 @@ namespace Msp { namespace IO { -Handle::operator const void *() const -{ - return priv->handle!=-1 ? this : 0; -} - - void sys_set_blocking(Handle &handle, bool b) { int flags = fcntl(*handle, F_GETFD); diff --git a/source/io/windows/handle.cpp b/source/io/windows/handle.cpp index 17aabb0..2dac33f 100644 --- a/source/io/windows/handle.cpp +++ b/source/io/windows/handle.cpp @@ -5,12 +5,6 @@ namespace Msp { namespace IO { -Handle::operator const void *() const -{ - return priv->handle!=INVALID_HANDLE_VALUE ? this : 0; -} - - void sys_set_blocking(Handle &, bool) { } -- 2.45.2