From: Mikko Rasa Date: Tue, 15 Oct 2013 12:46:38 +0000 (+0300) Subject: Move Handle::operator void * to the common part X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=0f5709b1262b17505c5bab06951611968a4bd326;p=libs%2Fcore.git Move Handle::operator void * to the common part --- 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) { }