From patchwork Mon Jan 7 17:09:02 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kieran Bingham X-Patchwork-Id: 162 Return-Path: Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id D7F73600CC for ; Mon, 7 Jan 2019 18:09:06 +0100 (CET) Received: from localhost.localdomain (cpc89242-aztw30-2-0-cust488.18-1.cable.virginm.net [86.31.129.233]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 093F9E22; Mon, 7 Jan 2019 18:09:05 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1546880946; bh=fOksaluZ3xZDaQQ4g7dDh6NqzuXPTr+Pz+2S/A+zEpQ=; h=From:To:Cc:Subject:Date:From; b=rZOKTGlQC4WT0h85YTQCZomIjCIWh0UKFqldwEC/+mzVW4fs4WU0RvjqTvLJk/b+a bC8Ef8qn+mm0l5NXmITYeNR/7OKBWSsFdDOeFcm8kwWKc81+ubxXfLeWBVvTqoPFuU CuJZWjXXJB4LHcuATlDM0pZ0bVTiO8xpwRCM0phQ= From: Kieran Bingham To: LibCamera Devel Date: Mon, 7 Jan 2019 17:09:02 +0000 Message-Id: <20190107170902.13618-1-kieran.bingham@ideasonboard.com> X-Mailer: git-send-email 2.17.1 Subject: [libcamera-devel] [PATCH] libcamera: media_object: Rename major/minor functions X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Jan 2019 17:09:07 -0000 The system libraries define macro's for major/minor through on some versions of GCC/GLibc. To prevent namespace collisions with these macros, rename our major and minor device node accessors. Signed-off-by: Kieran Bingham Reviewed-by: Laurent Pinchart --- src/libcamera/device_enumerator.cpp | 4 ++-- src/libcamera/include/media_object.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/libcamera/device_enumerator.cpp b/src/libcamera/device_enumerator.cpp index 7ad1c501ff3d..c088f3e5d243 100644 --- a/src/libcamera/device_enumerator.cpp +++ b/src/libcamera/device_enumerator.cpp @@ -208,10 +208,10 @@ int DeviceEnumerator::addDevice(const std::string &devnode) /* Associate entities to device node paths. */ for (MediaEntity *entity : media->entities()) { - if (entity->major() == 0 && entity->minor() == 0) + if (entity->deviceMajor() == 0 && entity->deviceMinor() == 0) continue; - std::string devnode = lookupDevnode(entity->major(), entity->minor()); + std::string devnode = lookupDevnode(entity->deviceMajor(), entity->deviceMinor()); if (devnode.empty()) return -EINVAL; diff --git a/src/libcamera/include/media_object.h b/src/libcamera/include/media_object.h index 950a33286690..04b9a8909465 100644 --- a/src/libcamera/include/media_object.h +++ b/src/libcamera/include/media_object.h @@ -80,8 +80,8 @@ class MediaEntity : public MediaObject { public: const std::string &name() const { return name_; } - unsigned int major() const { return major_; } - unsigned int minor() const { return minor_; } + unsigned int deviceMajor() const { return major_; } + unsigned int deviceMinor() const { return minor_; } const std::vector &pads() const { return pads_; }