From 831e69f33e6ccae70c59763df35b26b7288b066e Mon Sep 17 00:00:00 2001 From: Mihael Pranjic Date: Mon, 2 Nov 2020 12:04:35 +0100 Subject: [PATCH 1/2] internalnotification: fix use of kdb_long_double_t on armel platforms, closes #3450 --- doc/news/_preparation_next_release.md | 3 +++ src/libs/notification/notification.c | 2 ++ src/plugins/internalnotification/internalnotification.c | 7 ++++++- .../internalnotification/testmod_internalnotification.c | 4 ++++ 4 files changed, 15 insertions(+), 1 deletion(-) diff --git a/doc/news/_preparation_next_release.md b/doc/news/_preparation_next_release.md index 184116f2883..49872c4273a 100644 --- a/doc/news/_preparation_next_release.md +++ b/doc/news/_preparation_next_release.md @@ -81,6 +81,9 @@ The following section lists news about the [plugins](https://www.libelektra.org/ - The `cache` plugin now only caches the parts of the global keyset that are below `system:/elektra/cache` or below `system:/elektra/cached`. The part below `system:/elektra/cache` is meant for internal data of the `cache`, so you should put data below `system:/elektra/cached`, if you want it to be cached. _(Klemens Böswirth)_ +### internalnotification + +- Fix use of `kdb_long_double_t` on armel platforms ([#3450](https://github.com/ElektraInitiative/libelektra/issues/3450)). _(Mihael Pranjić)_ - <> - <> diff --git a/src/libs/notification/notification.c b/src/libs/notification/notification.c index 660fefda1e4..16324fe5cca 100644 --- a/src/libs/notification/notification.c +++ b/src/libs/notification/notification.c @@ -89,7 +89,9 @@ ELEKTRA_NOTIFICATION_TYPE_DEFINITION (kdb_long_long_t, KdbLongLong) ELEKTRA_NOTIFICATION_TYPE_DEFINITION (kdb_unsigned_long_long_t, KdbUnsignedLongLong) ELEKTRA_NOTIFICATION_TYPE_DEFINITION (kdb_float_t, KdbFloat) ELEKTRA_NOTIFICATION_TYPE_DEFINITION (kdb_double_t, KdbDouble) +#ifdef ELEKTRA_HAVE_KDB_LONG_DOUBLE ELEKTRA_NOTIFICATION_TYPE_DEFINITION (kdb_long_double_t, KdbLongDouble) +#endif // ELEKTRA_HAVE_KDB_LONG_DOUBLE int elektraNotificationRegisterCallback (KDB * kdb, Key * key, ElektraNotificationChangeCallback callback, void * context) { diff --git a/src/plugins/internalnotification/internalnotification.c b/src/plugins/internalnotification/internalnotification.c index 280c9a28fde..8a00c8afd3d 100644 --- a/src/plugins/internalnotification/internalnotification.c +++ b/src/plugins/internalnotification/internalnotification.c @@ -455,11 +455,13 @@ void elektraInternalnotificationUpdateRegisteredKeys (Plugin * plugin, KeySet * #define CHECK_CONVERSION ELEKTRA_TYPE_CHECK_CONVERSION #include "macros/add_type.h" +#ifdef ELEKTRA_HAVE_KDB_LONG_DOUBLE #define TYPE kdb_long_double_t #define TYPE_NAME KdbLongDouble #define TO_VALUE (strtold (string, &end)) #define CHECK_CONVERSION ELEKTRA_TYPE_CHECK_CONVERSION #include "macros/add_type.h" +#endif // ELEKTRA_HAVE_KDB_LONG_DOUBLE /** * @see kdbnotificationinternal.h ::ElektraNotificationPluginRegisterCallback @@ -538,7 +540,10 @@ int elektraInternalnotificationGet (Plugin * handle, KeySet * returned, Key * pa INTERNALNOTIFICATION_EXPORT_FUNCTION (KdbUnsignedShort), INTERNALNOTIFICATION_EXPORT_FUNCTION (KdbLong), INTERNALNOTIFICATION_EXPORT_FUNCTION (KdbUnsignedLong), INTERNALNOTIFICATION_EXPORT_FUNCTION (KdbLongLong), INTERNALNOTIFICATION_EXPORT_FUNCTION (KdbUnsignedLongLong), INTERNALNOTIFICATION_EXPORT_FUNCTION (KdbFloat), - INTERNALNOTIFICATION_EXPORT_FUNCTION (KdbDouble), INTERNALNOTIFICATION_EXPORT_FUNCTION (KdbLongDouble), + INTERNALNOTIFICATION_EXPORT_FUNCTION (KdbDouble), +#ifdef ELEKTRA_HAVE_KDB_LONG_DOUBLE + INTERNALNOTIFICATION_EXPORT_FUNCTION (KdbLongDouble), +#endif // ELEKTRA_HAVE_KDB_LONG_DOUBLE keyNew ("system:/elektra/modules/internalnotification/exports/registerCallback", KEY_FUNC, elektraInternalnotificationRegisterCallback, KEY_END), diff --git a/src/plugins/internalnotification/testmod_internalnotification.c b/src/plugins/internalnotification/testmod_internalnotification.c index 74e4856b98e..d077681f6f7 100644 --- a/src/plugins/internalnotification/testmod_internalnotification.c +++ b/src/plugins/internalnotification/testmod_internalnotification.c @@ -706,6 +706,7 @@ static void test_doUpdateShouldNotUpdateUnregisteredKey (void) #define CHECK_INVALID ((int) value == 0) #include "macros/create_type_tests.h" +#ifdef ELEKTRA_HAVE_KDB_LONG_DOUBLE #define TYPE kdb_long_double_t #define TYPE_NAME KdbLongDouble #define FORMAT_STRING "%1.8f" @@ -714,6 +715,7 @@ static void test_doUpdateShouldNotUpdateUnregisteredKey (void) #define INVALID_VALUE "4.a" #define CHECK_INVALID ((int) value == 0) #include "macros/create_type_tests.h" +#endif // ELEKTRA_HAVE_KDB_LONG_DOUBLE int main (int argc, char ** argv) { @@ -763,7 +765,9 @@ int main (int argc, char ** argv) RUN_TYPE_TESTS (KdbUnsignedLongLong) RUN_TYPE_TESTS (KdbFloat) RUN_TYPE_TESTS (KdbDouble) +#ifdef ELEKTRA_HAVE_KDB_LONG_DOUBLE RUN_TYPE_TESTS (KdbLongDouble) +#endif // ELEKTRA_HAVE_KDB_LONG_DOUBLE printf ("\nelektraInternalnotificationDoUpdate\n-----------------------------------\n"); test_doUpdateShouldUpdateKey (); From 4189a216ec66ebd54de32ab67611fc4da2b95c63 Mon Sep 17 00:00:00 2001 From: Mihael Pranjic Date: Thu, 8 Apr 2021 17:20:49 +0200 Subject: [PATCH 2/2] doc: update release notes --- doc/news/_preparation_next_release.md | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/news/_preparation_next_release.md b/doc/news/_preparation_next_release.md index 49872c4273a..57f7d04a985 100644 --- a/doc/news/_preparation_next_release.md +++ b/doc/news/_preparation_next_release.md @@ -81,6 +81,7 @@ The following section lists news about the [plugins](https://www.libelektra.org/ - The `cache` plugin now only caches the parts of the global keyset that are below `system:/elektra/cache` or below `system:/elektra/cached`. The part below `system:/elektra/cache` is meant for internal data of the `cache`, so you should put data below `system:/elektra/cached`, if you want it to be cached. _(Klemens Böswirth)_ + ### internalnotification - Fix use of `kdb_long_double_t` on armel platforms ([#3450](https://github.com/ElektraInitiative/libelektra/issues/3450)). _(Mihael Pranjić)_