From patchwork Fri Jan 3 14:02:50 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mattijs Korpershoek X-Patchwork-Id: 22452 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 89413BDB1C for ; Fri, 3 Jan 2025 14:03:00 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id A5297684DF; Fri, 3 Jan 2025 15:02:59 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b="z0IRqQg/"; dkim-atps=neutral Received: from mail-wr1-x42e.google.com (mail-wr1-x42e.google.com [IPv6:2a00:1450:4864:20::42e]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id F2582684D0 for ; Fri, 3 Jan 2025 15:02:57 +0100 (CET) Received: by mail-wr1-x42e.google.com with SMTP id ffacd0b85a97d-385e0e224cbso6168591f8f.2 for ; Fri, 03 Jan 2025 06:02:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1735912977; x=1736517777; darn=lists.libcamera.org; h=cc:to:message-id:content-transfer-encoding:mime-version:subject :date:from:from:to:cc:subject:date:message-id:reply-to; bh=Lzv6R5L8ZxGVeeOnn8wbXFB7GeDmV2RzI+JYHrzegJI=; b=z0IRqQg/z4wYl95KX8bXSTgzFcF44TI6olb2u9ShBKXHmF/P6NZioT3krE//TfTz1T t68CYT1cHDNIz/7EFDZ1Hl7DLJEKeNQVO08LBv6fjjfx2k8lBvm2MpvT4XRsJdiShjas q2SNyHOeHruIBzZDU8EdlyfDU7i7zgXaTrunxZCR+xCMqTas5dPGamvMC6P0ob0L8i87 XDKVFpes4/XuHIt4DVontk/QQOMPJVkKgn5VvyXaxjAsWimRObU/0Xhb8JssYI/1x2nf zRPaCh3qR77mgcoIQz7MftbU0JI9R0G08wHDjFGT+clTC8siuwolKwWMjsBEVRXTSq7x RrvA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735912977; x=1736517777; h=cc:to:message-id:content-transfer-encoding:mime-version:subject :date:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=Lzv6R5L8ZxGVeeOnn8wbXFB7GeDmV2RzI+JYHrzegJI=; b=IAOC7Th0VUCOJtZ1edZown52RdIQSbmoOc5GnhiY6sZwTFJZJMv1h97K0/yAEW1AiN vJ/BHkFTS7Aev4xT9RK/tKAwJ00fwAxVkrX+N56drUunGVeq/z6XQsthblexBxbpG5r4 19hZtysON3IOtPZqk5EZ+Iaq50tTLxnPre5hm3ZvW9D4E5/WgUWcWWeyivagywmcmkDu fnH1vxW4V7JlA4xaEJr0SITBUC5u+3rGJ2vsQyGdvhzPHMCks1HKwc/Og0G+YbMv4aX4 M/x4ALHXsMlfk4F1BJzIOiKcfBF+juzi5HetWfUj6m5IpoJLR9gzAMYg02qQ9NGJRuIa Ok4Q== X-Gm-Message-State: AOJu0YycuAsXPw36i6nlbjypKbMuh4r0Vre+NZwWqcOVl72h5nnfTH3H xreGPbt1iGV/bMlTgupT/NSfEOJt61VDcuk3xImmV1ZPbaGy5c5eRhkCvNP70CxnMFocJl/8h/e k X-Gm-Gg: ASbGncuQMyeMB8OPvsmeAGpxSZGi+kR5uQZ/x1zW8psRca3U8QbRTvk4hjC2mXlD32q IzmI9QdGrt+SedYpewDmi+n1jKBJjcPoItXglfWzOdkjzd5V+oKFaPrXMJvcH92belVNs8W6cPw CkvQhLjD0pFz0FV0aT9Cd0eZMAmGgAHtkeBsZXi4MM2RCnrXRAtgeDuc88g40yiriS0m2sSjjtP igsuA132OjZnJT89xfGk1N19nNJAaFwFH01Wj9yHcdwqmgBOG/BxFmCcOcIwIJjKIetEbX6 X-Google-Smtp-Source: AGHT+IH8kP3CfBidp+M/Jjz+TUSKhZBTGfjwmdwow5pi+BG+bBdGlfMWaLk3aJMzL0uc/lhdlWFMkA== X-Received: by 2002:a05:6000:481e:b0:382:49f9:74bb with SMTP id ffacd0b85a97d-38a2220120dmr44244438f8f.35.1735912977198; Fri, 03 Jan 2025 06:02:57 -0800 (PST) Received: from [192.168.1.20] ([2a01:cb19:95ba:5000:d6dd:417f:52ac:335b]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38a1c829120sm41879238f8f.6.2025.01.03.06.02.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Jan 2025 06:02:56 -0800 (PST) From: Mattijs Korpershoek Date: Fri, 03 Jan 2025 15:02:50 +0100 Subject: [PATCH] libcamera: base: Don't redefine __nodiscard MIME-Version: 1.0 Message-Id: <20250103-nodiscard-redef-v1-1-aa7559c8ebe3@baylibre.com> X-B4-Tracking: v=1; b=H4sIAAnud2cC/x3MTQqAIBBA4avErBP8QbCuEi3CGWs2GiNEIN49a fkt3mtQSZgqrFMDoYcrlzxg5gnideSTFOMwWG29NtqpXJBrPASVEFJSi/GBQsLokodR3UKJ3/+ 47b1/8xw+rmEAAAA= X-Change-ID: 20250103-nodiscard-redef-9158e8fdc3f5 To: libcamera-devel@lists.libcamera.org Cc: Guillaume La Roque , Mattijs Korpershoek X-Mailer: b4 0.14.3-dev-86319 X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Some libc implementations (like bionic) already define the __nodiscard macro [1]. Building with bionic results in compiler error since libcamera redefines the __nodiscard macro. Don't redefine __nodiscard if it's already defined. [1] https://android-review.googlesource.com/c/platform/bionic/+/3254860 Signed-off-by: Mattijs Korpershoek --- Hi, it's been a while. I've found a (trivial) build issue when building against recent bionic versions. I hope this is the right fix. Thanks for your review! --- include/libcamera/base/compiler.h | 2 ++ 1 file changed, 2 insertions(+) --- base-commit: 35ed4b91291d9f3d08e4b51acfb51163e65df8f8 change-id: 20250103-nodiscard-redef-9158e8fdc3f5 Best regards, diff --git a/include/libcamera/base/compiler.h b/include/libcamera/base/compiler.h index fda8fdfdc543f86c5554e38ef790c00d72d60389..946e20d835b216446e4099b6ab6865638d9aaf26 100644 --- a/include/libcamera/base/compiler.h +++ b/include/libcamera/base/compiler.h @@ -7,8 +7,10 @@ #pragma once +#ifndef __nodiscard #if __cplusplus >= 201703L #define __nodiscard [[nodiscard]] #else #define __nodiscard #endif +#endif