From afcbe7c406702fce3abd41fc6e945abd846a91dc Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
Date: Mon, 28 Oct 2024 09:13:10 +0100
Subject: [PATCH 0972/1160] sd-common: add __const__

const is stronger than pure, see
https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#index-pure-function-attribute
and
https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#index-const-function-attribute.

(cherry picked from commit 955c51c087f1fb6d0b7a0091db943ad05ba3095e)
(cherry picked from commit a5e128ca26cab912b4e404dbd6ad9cb6f60c67da)
---
 src/systemd/_sd-common.h | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/systemd/_sd-common.h b/src/systemd/_sd-common.h
index d4381d90f4..1e1ce35418 100644
--- a/src/systemd/_sd-common.h
+++ b/src/systemd/_sd-common.h
@@ -45,6 +45,10 @@ typedef void (*_sd_destroy_t)(void *userdata);
 #  define _sd_pure_ __attribute__((__pure__))
 #endif
 
+#ifndef _sd_const_
+#  define _sd_const_ __attribute__((__const__))
+#endif
+
 /* Note that strictly speaking __deprecated__ has been available before GCC 6. However, starting with GCC 6
  * it also works on enum values, which we are interested in. Since this is a developer-facing feature anyway
  * (as opposed to build engineer-facing), let's hence conditionalize this to gcc 6, given that the developers
-- 
2.33.0