Skip to content
This repository was archived by the owner on Feb 16, 2025. It is now read-only.

Commit 97d945d

Browse files
authored
Merge pull request #3763 from mpranj/kdb_long_double_t
Fix ARM builds
2 parents 5f6c852 + 4189a21 commit 97d945d

File tree

4 files changed

+16
-1
lines changed

4 files changed

+16
-1
lines changed

doc/news/_preparation_next_release.md

+4
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,10 @@ The following section lists news about the [plugins](https://www.libelektra.org/
8181
- The `cache` plugin now only caches the parts of the global keyset that are below `system:/elektra/cache` or below
8282
`system:/elektra/cached`. The part below `system:/elektra/cache` is meant for internal data of the `cache`, so you
8383
should put data below `system:/elektra/cached`, if you want it to be cached. _(Klemens Böswirth)_
84+
85+
### internalnotification
86+
87+
- Fix use of `kdb_long_double_t` on armel platforms ([#3450](https://github.com/ElektraInitiative/libelektra/issues/3450)). _(Mihael Pranjić)_
8488
- <<TODO>>
8589
- <<TODO>>
8690

src/libs/notification/notification.c

+2
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,9 @@ ELEKTRA_NOTIFICATION_TYPE_DEFINITION (kdb_long_long_t, KdbLongLong)
8989
ELEKTRA_NOTIFICATION_TYPE_DEFINITION (kdb_unsigned_long_long_t, KdbUnsignedLongLong)
9090
ELEKTRA_NOTIFICATION_TYPE_DEFINITION (kdb_float_t, KdbFloat)
9191
ELEKTRA_NOTIFICATION_TYPE_DEFINITION (kdb_double_t, KdbDouble)
92+
#ifdef ELEKTRA_HAVE_KDB_LONG_DOUBLE
9293
ELEKTRA_NOTIFICATION_TYPE_DEFINITION (kdb_long_double_t, KdbLongDouble)
94+
#endif // ELEKTRA_HAVE_KDB_LONG_DOUBLE
9395

9496
int elektraNotificationRegisterCallback (KDB * kdb, Key * key, ElektraNotificationChangeCallback callback, void * context)
9597
{

src/plugins/internalnotification/internalnotification.c

+6-1
Original file line numberDiff line numberDiff line change
@@ -455,11 +455,13 @@ void elektraInternalnotificationUpdateRegisteredKeys (Plugin * plugin, KeySet *
455455
#define CHECK_CONVERSION ELEKTRA_TYPE_CHECK_CONVERSION
456456
#include "macros/add_type.h"
457457

458+
#ifdef ELEKTRA_HAVE_KDB_LONG_DOUBLE
458459
#define TYPE kdb_long_double_t
459460
#define TYPE_NAME KdbLongDouble
460461
#define TO_VALUE (strtold (string, &end))
461462
#define CHECK_CONVERSION ELEKTRA_TYPE_CHECK_CONVERSION
462463
#include "macros/add_type.h"
464+
#endif // ELEKTRA_HAVE_KDB_LONG_DOUBLE
463465

464466
/**
465467
* @see kdbnotificationinternal.h ::ElektraNotificationPluginRegisterCallback
@@ -538,7 +540,10 @@ int elektraInternalnotificationGet (Plugin * handle, KeySet * returned, Key * pa
538540
INTERNALNOTIFICATION_EXPORT_FUNCTION (KdbUnsignedShort), INTERNALNOTIFICATION_EXPORT_FUNCTION (KdbLong),
539541
INTERNALNOTIFICATION_EXPORT_FUNCTION (KdbUnsignedLong), INTERNALNOTIFICATION_EXPORT_FUNCTION (KdbLongLong),
540542
INTERNALNOTIFICATION_EXPORT_FUNCTION (KdbUnsignedLongLong), INTERNALNOTIFICATION_EXPORT_FUNCTION (KdbFloat),
541-
INTERNALNOTIFICATION_EXPORT_FUNCTION (KdbDouble), INTERNALNOTIFICATION_EXPORT_FUNCTION (KdbLongDouble),
543+
INTERNALNOTIFICATION_EXPORT_FUNCTION (KdbDouble),
544+
#ifdef ELEKTRA_HAVE_KDB_LONG_DOUBLE
545+
INTERNALNOTIFICATION_EXPORT_FUNCTION (KdbLongDouble),
546+
#endif // ELEKTRA_HAVE_KDB_LONG_DOUBLE
542547

543548
keyNew ("system:/elektra/modules/internalnotification/exports/registerCallback", KEY_FUNC,
544549
elektraInternalnotificationRegisterCallback, KEY_END),

src/plugins/internalnotification/testmod_internalnotification.c

+4
Original file line numberDiff line numberDiff line change
@@ -706,6 +706,7 @@ static void test_doUpdateShouldNotUpdateUnregisteredKey (void)
706706
#define CHECK_INVALID ((int) value == 0)
707707
#include "macros/create_type_tests.h"
708708

709+
#ifdef ELEKTRA_HAVE_KDB_LONG_DOUBLE
709710
#define TYPE kdb_long_double_t
710711
#define TYPE_NAME KdbLongDouble
711712
#define FORMAT_STRING "%1.8f"
@@ -714,6 +715,7 @@ static void test_doUpdateShouldNotUpdateUnregisteredKey (void)
714715
#define INVALID_VALUE "4.a"
715716
#define CHECK_INVALID ((int) value == 0)
716717
#include "macros/create_type_tests.h"
718+
#endif // ELEKTRA_HAVE_KDB_LONG_DOUBLE
717719

718720
int main (int argc, char ** argv)
719721
{
@@ -763,7 +765,9 @@ int main (int argc, char ** argv)
763765
RUN_TYPE_TESTS (KdbUnsignedLongLong)
764766
RUN_TYPE_TESTS (KdbFloat)
765767
RUN_TYPE_TESTS (KdbDouble)
768+
#ifdef ELEKTRA_HAVE_KDB_LONG_DOUBLE
766769
RUN_TYPE_TESTS (KdbLongDouble)
770+
#endif // ELEKTRA_HAVE_KDB_LONG_DOUBLE
767771

768772
printf ("\nelektraInternalnotificationDoUpdate\n-----------------------------------\n");
769773
test_doUpdateShouldUpdateKey ();

0 commit comments

Comments
 (0)