Skip to content
This repository has been archived by the owner on Oct 15, 2024. It is now read-only.

Commit

Permalink
Merge pull request #3763 from mpranj/kdb_long_double_t
Browse files Browse the repository at this point in the history
Fix ARM builds
  • Loading branch information
mpranj authored Apr 8, 2021
2 parents 5f6c852 + 4189a21 commit 97d945d
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 1 deletion.
4 changes: 4 additions & 0 deletions doc/news/_preparation_next_release.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,10 @@ 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ć)_
- <<TODO>>
- <<TODO>>
Expand Down
2 changes: 2 additions & 0 deletions src/libs/notification/notification.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
7 changes: 6 additions & 1 deletion src/plugins/internalnotification/internalnotification.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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)
{
Expand Down Expand Up @@ -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 ();
Expand Down

0 comments on commit 97d945d

Please sign in to comment.