From: Lennart Poettering Date: Mon, 11 Nov 2013 22:40:00 +0000 (+0100) Subject: bus: export utf8 validator calls as pure functions X-Git-Tag: v209~1463 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=98f91566cc7d43c6b86a711fa1d196ed5876b2f3;p=elogind.git bus: export utf8 validator calls as pure functions --- diff --git a/src/systemd/_sd-common.h b/src/systemd/_sd-common.h index b0c48aab9..594ff3db2 100644 --- a/src/systemd/_sd-common.h +++ b/src/systemd/_sd-common.h @@ -40,6 +40,10 @@ # define _sd_packed_ __attribute__((packed)) #endif +#ifndef _sd_pure_ +# define _sd_pure_ __attribute__((pure)) +#endif + #ifndef _SD_STRINGIFY # define _SD_XSTRINGIFY(x) #x # define _SD_STRINGIFY(x) _SD_XSTRINGIFY(x) diff --git a/src/systemd/sd-utf8.h b/src/systemd/sd-utf8.h index 4a43eb7c2..205ee4221 100644 --- a/src/systemd/sd-utf8.h +++ b/src/systemd/sd-utf8.h @@ -26,8 +26,8 @@ _SD_BEGIN_DECLARATIONS; -const char *sd_utf8_is_valid(const char *s); -const char *sd_ascii_is_valid(const char *s); +_sd_pure_ const char *sd_utf8_is_valid(const char *s); +_sd_pure_ const char *sd_ascii_is_valid(const char *s); _SD_END_DECLARATIONS;