From patchwork Wed Dec 11 17:26:21 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: 'Darko Komljenovic' via swupdate X-Patchwork-Id: 1208983 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=googlegroups.com (client-ip=2607:f8b0:4864:20::f39; helo=mail-qv1-xf39.google.com; envelope-from=swupdate+bncbdsmnwxtyuprb6pvztxqkgqeed34sni@googlegroups.com; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=googlegroups.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=googlegroups.com header.i=@googlegroups.com header.b="ifehPhJq"; dkim-atps=neutral Received: from mail-qv1-xf39.google.com (mail-qv1-xf39.google.com [IPv6:2607:f8b0:4864:20::f39]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47Z26k1x0xz9sPK for ; Fri, 13 Dec 2019 18:17:16 +1100 (AEDT) Received: by mail-qv1-xf39.google.com with SMTP id 75sf1128323qva.8 for ; Thu, 12 Dec 2019 23:17:16 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1576221433; cv=pass; d=google.com; s=arc-20160816; b=TyoKbAxa7CeRsTrk1uhwtCPnjj9Po0a5Kl0Uyg076G51PehUNFjpSgRZZRy4npyfUv +UB6ZdxZT1G94ED/VovWTF7Tpuoh16AsKlmB+OKebq5G9LQ2edURS4oYIItE3r2oYRNv L6p0Krze9suIMMH2ie0jJq428FFpPl5qP5LioQfKXbk/69C3xBJPteTOIic3fi2l6e5K 0ePJBJ/W2o1kPCLPQkB9xoujWnhhOL39mrMe1MZG+iIioG6JaqZJ9RyC44lAaaPv8aQS 7yr3CdyQ/cQbIXGidDYw47xssgS1TuF7s12tppxrYrGOpFVnib8TiROpUnGKADWThnqt kjiA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:reply-to:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from:dkim-signature; bh=/181zSTCRbihr+BYA4YoUdr0WQuxvAlQXVr9UFjpE2c=; b=nzZqGSeKmf0GgIO0t6aX4tW96gNvMB1PMhO9cneHpdTbKKo2WY+bvr+kw+bSpEmH4v g3wpmpRbCiX9Z/t4Nd4uHRTx7elW60mHR/GFub2BrOIc5mDG6wfRaV8WJNo2LHo8UYuA vlZxwx0gP1dPyVCawCtCr1Ajcqqa75XH9INj/DS4r6NIZn5KO8CyTErNME0JyuvO9+hp PIltIJ8eZe/rBTDDwUAgYVKyltc5O1j5FxIVVxFyo9R+5NNS4SMt4Y/hbykRYaNEh4iB A7nvtp3tJJ7NxQJG7nL3PQxh4w4MhGdCyM/9aaG7yAWsHWIsVsOUMu93x8Njz7psqKFi xh4A== ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@koncepto.io header.s=default header.b=jbSx0Sty; spf=pass (google.com: domain of pjtexier@koncepto.io designates 195.154.119.111 as permitted sender) smtp.mailfrom=pjtexier@koncepto.io; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=koncepto.io DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding:x-original-sender :x-original-authentication-results:reply-to:precedence:mailing-list :list-id:list-post:list-help:list-archive:list-subscribe :list-unsubscribe; bh=/181zSTCRbihr+BYA4YoUdr0WQuxvAlQXVr9UFjpE2c=; b=ifehPhJq12aFv1/uy6gJQl/L+HvSW15Xqa/Jy1AaOGRg6JI4T3UTSH0dQVk/ourHmi fSzIao1OsSN4sdjGDWeawRdn0IZz44xZXbmZcOGAPUu8pVFWl/T9szbYDLMmXpB9Qp1M uhsGmtGn4JogLU2k7hoK+DOPmbUAGQ4GE8/2DbQ2/OJlxsgNfGF78jE3LekZFXXuX78P RNmvCbEULoDFjh//Q8mfR1RVfhXc8wSt9QsJDx4ESNrNj+NK/XwR815+Qmc/YLvoPpFP EqZxiLtMT/IPv0AHcwb+b+Cfzvql1InUiNohdml0pa5B25NqN4dqf09k23TolShE1iBt Sfrg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding:x-original-sender :x-original-authentication-results:reply-to:precedence:mailing-list :list-id:list-post:list-help:list-archive:list-subscribe :list-unsubscribe; bh=/181zSTCRbihr+BYA4YoUdr0WQuxvAlQXVr9UFjpE2c=; b=JPHIf05cHf45Fq55BqQTgARxsU0gwKonafnnRbsUkHFx7pdjgmVrsx1sz2LaVAA40x b+Nb2LJnLiaXi88tsjRoSBJLQC4jEf9eUA8cCTfTnOZMIGO7keoNUEeonn6yI/q0l+dw WrFkEut2EVFi9rQHxkXkG6DSiTTAdHMXnNbTBIO2syoIpQWnVrILk+LVs+sfIqhoHyiT rc4DGkKgw+1rhhABubkBqCptROobqxmUn/3S8Z8JtxueLr768I/g5IJCJLYc9mR2wHmv LtDNnqPRHK0epYVV5Ekhk97udjaKoP8HoEdj2WhgnBei7/ergE2Jq+s9MXQwUS2GvYIv lLkQ== X-Gm-Message-State: APjAAAVuItvYmTnABAFmTPO0iJgqzxqnX9wpHfXgVbAbVItMMh6AgPmS ipTMwSf++zbvvsfZnAXV/ik= X-Google-Smtp-Source: APXvYqx4PNlrrcQDUzAZ0A3Vkswa4e0muXFb2h9lpLg8rUnHFHkb9E3jgSfqGvXWDpHRpuhNUhIMSA== X-Received: by 2002:a37:4e04:: with SMTP id c4mr12039438qkb.75.1576221433564; Thu, 12 Dec 2019 23:17:13 -0800 (PST) X-BeenThere: swupdate@googlegroups.com Received: by 2002:a37:9ec3:: with SMTP id h186ls2663901qke.3.gmail; Thu, 12 Dec 2019 23:17:13 -0800 (PST) X-Received: by 2002:a05:620a:10b2:: with SMTP id h18mr12223216qkk.185.1576221433306; Thu, 12 Dec 2019 23:17:13 -0800 (PST) Received: by 2002:a37:454b:0:0:0:0:0 with SMTP id s72msqka; Wed, 11 Dec 2019 09:26:34 -0800 (PST) X-Received: by 2002:a2e:9610:: with SMTP id v16mr3035049ljh.88.1576085193979; Wed, 11 Dec 2019 09:26:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576085193; cv=none; d=google.com; s=arc-20160816; b=DLRaD0o7yIsw2Nc6M8EwzCSvlVzWuKmm3rZjCURGOtA7nIgNzjX23c6caqfbsn3CXf X3+cRawhXqCRyKnFr5Cs99yvL/knbcOul62nWyYOp7yhLVDRS9rbw1Ddrzmgh+XvTIS1 wWvM0dvuH7XKeS4TyGZ7Cjc7jWty0UX7OgJWInymZVnWG5K46TseClbaVKSZAYL1uuLf FHCpcPqFvTzKby/kwEA1ckA9aipsOVNdiB8QMxXQDtIvsE4jYfqo8oMwnUtLxRR6WCeo cM8lcHVbM9Wq1qNBADLgd+Cxk4D431lnlJlS1XkZLnd5c80KizBkjYilspYdIb73g+TT GxSg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:dkim-signature; bh=3ks36uf6FEfQpe+caGA4bcqfsdPvKb7b6iOpIvXiZyA=; b=C0vPbKKAWolNtF0AoXhe3cV0q0LWYyM4QGIRnwBmDe8rtEhy9ZuzH4f0EMXoo6YsNO QoTTNETynQ8ZLjHB/F6eDAHPBi/X8fEomUNhBXBoVvse91BlHk9DXlnlg7rqLXngvC21 Vb0M6QM7Ciss131vtM0UAdUm26b14xxrii7km/vS1tEG5L4CGCTng+HjdYhhJcp9WVso eWAiyxZDpwhgE+oswjN47q15wTYmC5qK63VHiGYpn0p6YvGq21XIYlbFiAwzxsnqrNLV dsP8OH9Y4ezzNglxZFXeV0rMwHtTF6/Nnaj2QSYtNp8XfCRNPM7/GKTnzFNhVcp7/aCf ISyA== ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@koncepto.io header.s=default header.b=jbSx0Sty; spf=pass (google.com: domain of pjtexier@koncepto.io designates 195.154.119.111 as permitted sender) smtp.mailfrom=pjtexier@koncepto.io; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=koncepto.io Received: from koncepto.io (koncepto.io. [195.154.119.111]) by gmr-mx.google.com with ESMTPS id v16si100979lfd.2.2019.12.11.09.26.33 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Dec 2019 09:26:33 -0800 (PST) Received-SPF: pass (google.com: domain of pjtexier@koncepto.io designates 195.154.119.111 as permitted sender) client-ip=195.154.119.111; Received: from menoah.home (lfbn-1-6734-38.w90-120.abo.wanadoo.fr [90.120.168.38]) by koncepto.io (Postfix) with ESMTPSA id 422C86008E; Wed, 11 Dec 2019 18:26:32 +0100 (CET) X-Patchwork-Original-From: "'Pierre-Jean Texier' via swupdate" From: 'Darko Komljenovic' via swupdate To: swupdate@googlegroups.com Cc: sbabic@denx.de, Pierre-Jean Texier Subject: [swupdate] [libubootenv][PATCH] libuboot: wrap libuboot in extern "C" for C++ Date: Wed, 11 Dec 2019 18:26:21 +0100 Message-Id: <1576085181-10378-1-git-send-email-pjtexier@koncepto.io> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 X-Original-Sender: pjtexier@koncepto.io X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@koncepto.io header.s=default header.b=jbSx0Sty; spf=pass (google.com: domain of pjtexier@koncepto.io designates 195.154.119.111 as permitted sender) smtp.mailfrom=pjtexier@koncepto.io; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=koncepto.io X-Original-From: Pierre-Jean Texier Reply-To: Pierre-Jean Texier Precedence: list Mailing-list: list swupdate@googlegroups.com; contact swupdate+owners@googlegroups.com List-ID: X-Google-Group-Id: 605343134186 List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , This allows linking from C++ applications without the need of using extern "C" when including libuboot header file. This follows the guide line of many other libraries. Fixes: foo.cpp:(.text+0x19) : undefined reference to « libuboot_initialize(uboot_ctx**, uboot_env_device*) » ... Signed-off-by: Pierre-Jean Texier --- src/libuboot.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/libuboot.h b/src/libuboot.h index 227e022..e55b149 100644 --- a/src/libuboot.h +++ b/src/libuboot.h @@ -5,6 +5,9 @@ * SPDX-License-Identifier: LGPL-2.1-or-later */ +#ifdef __cplusplus +extern "C" { +#endif #pragma once @@ -153,3 +156,7 @@ const char *libuboot_getname(void *entry); * @return pointer to name or NULL */ const char *libuboot_getvalue(void *entry); + +#ifdef __cplusplus +} +#endif