From patchwork Fri Mar 22 10:43:50 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kieran Bingham X-Patchwork-Id: 787 Return-Path: Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 84469611A2 for ; Fri, 22 Mar 2019 11:44:00 +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 DEAF111BE; Fri, 22 Mar 2019 11:43:55 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1553251436; bh=ovX6/D4vHLNwrP4WLTjXURiz1kcNHxYHUGxPg+rPDyg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dIMm8KF2paPezzCozOr3qyEu9WcUcsFfu30dNWWtN5RxzV3gE/hK5ItfyDneKs4Ui 4pOtwxS1IblYmEe9JBUbd0F6zm3ZTZ3KEAlHhidPEdixr6E6je8ZPYSjbB5x1qQnZj Vmt9eKGiPq3ThRscf5IHT1xrV50ovYBCaSs6jJ98= From: Kieran Bingham To: LibCamera Devel Date: Fri, 22 Mar 2019 10:43:50 +0000 Message-Id: <20190322104350.31091-5-kieran.bingham@ideasonboard.com> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190322104350.31091-1-kieran.bingham@ideasonboard.com> References: <20190322104350.31091-1-kieran.bingham@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 4/4] libcamera: log: Fallback to getenv on non-gnu systems 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: Fri, 22 Mar 2019 10:44:01 -0000 The secure_getenv() call is not provided by all toolchains. Support compilation without this feature by falling back to the default getenv() functionality. Signed-off-by: Kieran Bingham --- src/libcamera/log.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/libcamera/log.cpp b/src/libcamera/log.cpp index 7d930cd6b99e..a44bd941e615 100644 --- a/src/libcamera/log.cpp +++ b/src/libcamera/log.cpp @@ -49,6 +49,15 @@ namespace libcamera { + +/* + * secure_getenv is a GNU-specific extension to the C-Library. + * fall back to the default getenv when it is not available. + */ +#ifndef HAVE_SECURE_GETENV +#define secure_getenv getenv +#endif + /** * \brief Message logger *