Show a patch.

GET /api/patches/25013/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 25013,
    "url": "https://patchwork.libcamera.org/api/patches/25013/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/25013/",
    "project": {
        "id": 1,
        "url": "https://patchwork.libcamera.org/api/projects/1/?format=api",
        "name": "libcamera",
        "link_name": "libcamera",
        "list_id": "libcamera_core",
        "list_email": "libcamera-devel@lists.libcamera.org",
        "web_url": "",
        "scm_url": "",
        "webscm_url": ""
    },
    "msgid": "<20251113110958.1117065-2-naush@raspberrypi.com>",
    "date": "2025-11-13T11:05:31",
    "name": "[RFC,v1,1/1] treewide: Update to the C++20 standard",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "aa6e25fc14978e134d2f5082a3ac556650518c7f",
    "submitter": {
        "id": 34,
        "url": "https://patchwork.libcamera.org/api/people/34/?format=api",
        "name": "Naushir Patuck",
        "email": "naush@raspberrypi.com"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/25013/mbox/",
    "series": [
        {
            "id": 5586,
            "url": "https://patchwork.libcamera.org/api/series/5586/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=5586",
            "date": "2025-11-13T11:05:30",
            "name": "Switch to C++20 standard",
            "version": 1,
            "mbox": "https://patchwork.libcamera.org/series/5586/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/25013/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/25013/checks/",
    "tags": {},
    "headers": {
        "Return-Path": "<libcamera-devel-bounces@lists.libcamera.org>",
        "X-Original-To": "parsemail@patchwork.libcamera.org",
        "Delivered-To": "parsemail@patchwork.libcamera.org",
        "Received": [
            "from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id CFCFBC32DB\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 13 Nov 2025 11:10:06 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id AE8E260AA2;\n\tThu, 13 Nov 2025 12:10:04 +0100 (CET)",
            "from mail-wm1-x32c.google.com (mail-wm1-x32c.google.com\n\t[IPv6:2a00:1450:4864:20::32c])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 52F4C609D8\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 13 Nov 2025 12:10:02 +0100 (CET)",
            "by mail-wm1-x32c.google.com with SMTP id\n\t5b1f17b1804b1-470ff9b5820so349985e9.3\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 13 Nov 2025 03:10:02 -0800 (PST)",
            "from naush-dell.pitowers.org\n\t([2a00:1098:3142:1f:2656:5224:553b:c3da])\n\tby smtp.gmail.com with ESMTPSA id\n\tffacd0b85a97d-42b53e7aea7sm3259935f8f.1.2025.11.13.03.10.01\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tThu, 13 Nov 2025 03:10:01 -0800 (PST)"
        ],
        "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (2048-bit key;\n\tunprotected) header.d=raspberrypi.com header.i=@raspberrypi.com\n\theader.b=\"sOjVRHwF\"; dkim-atps=neutral",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google; t=1763032202; x=1763637002;\n\tdarn=lists.libcamera.org; \n\th=content-transfer-encoding:mime-version:references:in-reply-to\n\t:message-id:date:subject:cc:to:from:from:to:cc:subject:date\n\t:message-id:reply-to;\n\tbh=eLYgfasp6wjRbwdDpzqUSmDnPzR4sNOIiUWmIY2H3S8=;\n\tb=sOjVRHwFx4rLEsulpGJf6G1tWV7Ys9uMqJAp93gjkuRwOoVncaQXTZ1cXTInPxPHB7\n\t+SnxiUFOwahxVlZXuMJF8FcmpiW32XvmMEfKejXmCoNgaZhKdrVoZKxAH/q9xxD6LBrM\n\tUagGZex89Hawar1yK2bjL3JSCQ8HzeEDDzdS0oyXv2gS3ZoWOGN026YtksiHLPj0aUcJ\n\tzDqBhpD/qgQEFWUV35i5s259eRmaufWNR5tNtexRqj6nAvoWf/MVV0tuPx9hhym8XNNj\n\tLDHb1vzGlWo/HhniFH+HdWVTZHBmcfpxXPaAKDW328Ai6SmlS5tjghBhYNox+JFlGRcy\n\tjiAw==",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20230601; t=1763032202; x=1763637002;\n\th=content-transfer-encoding:mime-version:references:in-reply-to\n\t:message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from\n\t:to:cc:subject:date:message-id:reply-to;\n\tbh=eLYgfasp6wjRbwdDpzqUSmDnPzR4sNOIiUWmIY2H3S8=;\n\tb=hWNoSQAKLCJS0vVCnmVufwFJieN+2T9W9PxgT5A3LkRb44y5ewoMRS68ii19rHEBDf\n\thrz+Za4u/mseKqWr+defvJltSB4ZOhOoMXLH8nNzTqpTNcPtqeQK1Al1erJQJgxkLw/U\n\t5UZ5aaMM3oGv8W9zLX8UyOpylkrm2FFN4WgCSGpawxSmdVm3ZIt/bxNhziCa9OiEM4nT\n\tug+nwwmetshmwUNg8tP+pfkMJiykTPWGJEglTvkKoOxN84REKuVVUjrP0xpfW8nLRCV8\n\tfEuyQBNop90DEwM/Wu6Km58D+p9ITzAYC8Net4VVHEKjnLu/To1zvqS499pI6fFTDsqP\n\tMtQw==",
        "X-Gm-Message-State": "AOJu0YxnHvPEA8gp8/c/XUfDHrKJLs1zMZoeadIAL+ar0emt0NzYfRmp\n\tyTQevw/aQEu3rEvqFCKSFlOspfMMsseenuQBTAX/O0bKsSu5ndPGirWPzFTvvIuSbcVTyD5SmeT\n\tx5ENS",
        "X-Gm-Gg": "ASbGnctBJqiCRhV21/z5cbLoZWYW2cms1sZNkKrh6VXtQnL7gJkevnucjTf1i9Brb9I\n\t7S2Zl/FKAtXKj6iq9uiYLV96IZHjxgFF19AGH80SoogIhoI350EoauoUHgFdRtuQaqSq7cJ3PgK\n\tgWq9yTTLigVT9+y2oHKpQUcmBwC0rgjgA3g9Eh1hlUT6Sf2Narw1EfFLNTD9RfdvknaHpkknd5U\n\ti2rCzEP3uQcxcNfsZmLhYxyxUqibM/65dHFX1ZmB/vGZBJTFSpRmX6q8QNQkRHgSCnE2IcrYC8G\n\t7xs+YrHqWVkeZuL1nC8JH4w94rBkMZpUPlvZTFna5GJkKf69CMrXuj2Ruc3+7VvkdK+R5EGi1mI\n\tIIKysR4744Eta7TNXZPV+OqfDVgZ6XiBfQZQaX9+vABduPZB65Xba4djpinMDc0WWDxEgJpJf50\n\tQjMP/3hjvGdmxHPgAP6FG1",
        "X-Google-Smtp-Source": "AGHT+IHbY81bN6eNl1SkxZgxeJU+xowmYj7QaRY36/4BiaNQ2kVzgTT83WV0lVWPei2E6d3/EwDrYw==",
        "X-Received": "by 2002:a05:6000:4022:b0:42b:3746:3b83 with SMTP id\n\tffacd0b85a97d-42b530a4aa3mr1057261f8f.8.1763032201551; \n\tThu, 13 Nov 2025 03:10:01 -0800 (PST)",
        "From": "Naushir Patuck <naush@raspberrypi.com>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Cc": "Naushir Patuck <naush@raspberrypi.com>",
        "Subject": "[RFC PATCH v1 1/1] treewide: Update to the C++20 standard",
        "Date": "Thu, 13 Nov 2025 11:05:31 +0000",
        "Message-ID": "<20251113110958.1117065-2-naush@raspberrypi.com>",
        "X-Mailer": "git-send-email 2.51.0",
        "In-Reply-To": "<20251113110958.1117065-1-naush@raspberrypi.com>",
        "References": "<20251113110958.1117065-1-naush@raspberrypi.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "X-BeenThere": "libcamera-devel@lists.libcamera.org",
        "X-Mailman-Version": "2.1.29",
        "Precedence": "list",
        "List-Id": "<libcamera-devel.lists.libcamera.org>",
        "List-Unsubscribe": "<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>",
        "List-Archive": "<https://lists.libcamera.org/pipermail/libcamera-devel/>",
        "List-Post": "<mailto:libcamera-devel@lists.libcamera.org>",
        "List-Help": "<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>",
        "List-Subscribe": "<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>",
        "Errors-To": "libcamera-devel-bounces@lists.libcamera.org",
        "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"
    },
    "content": "Switch to using the C++20 standard when compiling libcamera. This causes\na build error due to the deprecation of the following specialisation [1]\n\nstd::shared_ptr<T> atomic_load(const std::shared_ptr<T>* p)\n\n../src/libcamera/base/log.cpp: In member function 'void libcamera::Logger::write(const libcamera::LogMessage&)':\n../src/libcamera/base/log.cpp:468:61: error: 'std::shared_ptr<_Tp> std::atomic_load(const shared_ptr<_Tp>*) [with _Tp = libcamera::LogOutput]' is deprecated: use 'std::atomic<std::shared_ptr<T>>' instead [-Werror=deprecated-declarations]\n  468 |         std::shared_ptr<LogOutput> output = std::atomic_load(&output_);\n      |                                             ~~~~~~~~~~~~~~~~^~~~~~~~~~\n\nThis error is fixed by switching to the std::atomic<std::shared_ptr<T>>\nspecialisation instead. Unfortunately, this is not backward compatible\nwith C++17, so the fix must be included in this commit.\n\n[1]: https://en.cppreference.com/w/cpp/memory/shared_ptr/atomic.html\nSigned-off-by: Naushir Patuck <naush@raspberrypi.com>\n---\n meson.build                | 2 +-\n src/libcamera/base/log.cpp | 6 +++---\n 2 files changed, 4 insertions(+), 4 deletions(-)",
    "diff": "diff --git a/meson.build b/meson.build\nindex fd508fd7f6b5..74153e1e6ce9 100644\n--- a/meson.build\n+++ b/meson.build\n@@ -6,7 +6,7 @@ project('libcamera', 'c', 'cpp',\n     default_options : [\n         'werror=true',\n         'warning_level=2',\n-        'cpp_std=c++17',\n+        'cpp_std=c++20',\n     ],\n     license : 'LGPL 2.1+')\n \ndiff --git a/src/libcamera/base/log.cpp b/src/libcamera/base/log.cpp\nindex 81b550e21402..e65d83739315 100644\n--- a/src/libcamera/base/log.cpp\n+++ b/src/libcamera/base/log.cpp\n@@ -325,7 +325,7 @@ private:\n \tstd::vector<std::unique_ptr<LogCategory>> categories_ LIBCAMERA_TSA_GUARDED_BY(mutex_);\n \tstd::list<std::pair<std::string, LogSeverity>> levels_;\n \n-\tstd::shared_ptr<LogOutput> output_;\n+\tstd::atomic<std::shared_ptr<LogOutput>> output_;\n };\n \n bool Logger::destroyed_ = false;\n@@ -465,7 +465,7 @@ Logger *Logger::instance()\n  */\n void Logger::write(const LogMessage &msg)\n {\n-\tstd::shared_ptr<LogOutput> output = std::atomic_load(&output_);\n+\tstd::shared_ptr<LogOutput> output = output_.load();\n \tif (!output)\n \t\treturn;\n \n@@ -477,7 +477,7 @@ void Logger::write(const LogMessage &msg)\n  */\n void Logger::backtrace()\n {\n-\tstd::shared_ptr<LogOutput> output = std::atomic_load(&output_);\n+\tstd::shared_ptr<LogOutput> output = output_.load();\n \tif (!output)\n \t\treturn;\n \n",
    "prefixes": [
        "RFC",
        "v1",
        "1/1"
    ]
}