X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;ds=sidebyside;f=src%2Flib%2Fplatform%2Fposix%2Fserialport.cpp;h=7eb695dc59429327c68268dc82c0148cf223a7ac;hb=31e9723746bb84a4af0a6b2bcd64421c0b690061;hp=0089521caa370ae6a929f0a0f92459435da28416;hpb=dbe84b6e46f78b7bcabd8d7a72b5f2e10812c942;p=deb_libcec.git diff --git a/src/lib/platform/posix/serialport.cpp b/src/lib/platform/posix/serialport.cpp index 0089521..7eb695d 100644 --- a/src/lib/platform/posix/serialport.cpp +++ b/src/lib/platform/posix/serialport.cpp @@ -1,7 +1,7 @@ /* * This file is part of the libCEC(R) library. * - * libCEC(R) is Copyright (C) 2011-2012 Pulse-Eight Limited. All rights reserved. + * libCEC(R) is Copyright (C) 2011-2013 Pulse-Eight Limited. All rights reserved. * libCEC(R) is an original work, containing original code. * * libCEC(R) is a trademark of Pulse-Eight Limited. @@ -48,15 +48,17 @@ #define IUCLC 0 #endif #else +#ifdef HAVE_LOCKDEV #include #endif +#endif using namespace std; using namespace PLATFORM; inline bool RemoveLock(const char *strDeviceName) { - #if !defined(__APPLE__) && !defined(__FreeBSD__) + #if !defined(__APPLE__) && !defined(__FreeBSD__) && defined(HAVE_LOCKDEV) return dev_unlock(strDeviceName, 0) == 0; #else void *tmp = (void*)strDeviceName; // silence unused warning @@ -125,7 +127,7 @@ bool CSerialSocket::Open(uint64_t iTimeoutMs /* = 0 */) return false; } - #if !defined(__APPLE__) && !defined(__FreeBSD__) + #if !defined(__APPLE__) && !defined(__FreeBSD__) && defined(HAVE_LOCKDEV) if (dev_lock(m_strName.c_str()) != 0) { m_strError = "Couldn't lock the serial port";