mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge.git
synced 2025-01-10 17:11:56 +01:00
Fossil/Skagen hybrids: patch jerryscript for gcc 12+ in watchface build script
This commit is contained in:
parent
8f5bbec881
commit
ecb71a6dc5
2
external/build_fossil_hr_watchface.sh
vendored
2
external/build_fossil_hr_watchface.sh
vendored
@ -1,5 +1,7 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
pushd jerryscript
|
pushd jerryscript
|
||||||
|
gcc_version="$(gcc -v 2>&1 | grep -oe '^gcc version [0-9][0-9\.]*[0-9]' | sed 's|^.* ||;s|\..*||')"
|
||||||
|
(( gcc_version > 11 )) && git apply ../patches/jerryscript-gcc-12-build-fix.patch
|
||||||
python3 tools/build.py --jerry-cmdline-snapshot ON
|
python3 tools/build.py --jerry-cmdline-snapshot ON
|
||||||
popd
|
popd
|
||||||
pushd fossil-hr-watchface
|
pushd fossil-hr-watchface
|
||||||
|
35
external/patches/jerryscript-gcc-12-build-fix.patch
vendored
Normal file
35
external/patches/jerryscript-gcc-12-build-fix.patch
vendored
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
diff --git a/jerry-ext/handler/handler-register.c b/jerry-ext/handler/handler-register.c
|
||||||
|
index ad35d8c3..d808061f 100644
|
||||||
|
--- a/jerry-ext/handler/handler-register.c
|
||||||
|
+++ b/jerry-ext/handler/handler-register.c
|
||||||
|
@@ -63,7 +63,13 @@ jerryx_set_properties (const jerry_value_t target_object, /**< target object */
|
||||||
|
{
|
||||||
|
#define JERRYX_SET_PROPERTIES_RESULT(VALUE, IDX) ((jerryx_register_result) { VALUE, IDX })
|
||||||
|
uint32_t idx = 0;
|
||||||
|
- for (; ((entries + idx) != NULL) && (entries[idx].name != NULL); idx++)
|
||||||
|
+
|
||||||
|
+ if (entries == NULL)
|
||||||
|
+ {
|
||||||
|
+ return JERRYX_SET_PROPERTIES_RESULT (jerry_create_undefined (), 0);
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ for (; (entries[idx].name != NULL); idx++)
|
||||||
|
{
|
||||||
|
const jerryx_property_entry *entry = &entries[idx];
|
||||||
|
|
||||||
|
@@ -99,9 +105,12 @@ void
|
||||||
|
jerryx_release_property_entry (const jerryx_property_entry entries[], /**< list of property entries */
|
||||||
|
const jerryx_register_result register_result) /**< previous result of registration */
|
||||||
|
{
|
||||||
|
- for (uint32_t idx = register_result.registered;
|
||||||
|
- ((entries + idx) != NULL) && (entries[idx].name != NULL);
|
||||||
|
- idx++)
|
||||||
|
+ if (entries == NULL)
|
||||||
|
+ {
|
||||||
|
+ return;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ for (uint32_t idx = register_result.registered; entries[idx].name != NULL; idx++)
|
||||||
|
{
|
||||||
|
jerry_release_value (entries[idx].value);
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user