|
| 1 | +From 1d3f4daa3a9a357612cdd2dbc6e22f6f73d1173f Mon Sep 17 00:00:00 2001 |
| 2 | +From: Sam Gardner <sam@wx4stg.com> |
| 3 | +Date: Wed, 19 Feb 2025 19:27:18 -0600 |
| 4 | +Subject: [PATCH] patches for emscripten-forge build |
| 5 | + |
| 6 | +--- |
| 7 | + lib/obstack.c | 10 ++++++++-- |
| 8 | + lib/obstack.h | 6 +++++- |
| 9 | + 2 files changed, 13 insertions(+), 3 deletions(-) |
| 10 | + |
| 11 | +diff --git a/lib/obstack.c b/lib/obstack.c |
| 12 | +index 6e7b52c..66b4f1f 100644 |
| 13 | +--- a/lib/obstack.c |
| 14 | ++++ b/lib/obstack.c |
| 15 | +@@ -76,6 +76,12 @@ |
| 16 | + MAX (sizeof (uintmax_t), \ |
| 17 | + sizeof (void *))) |
| 18 | + |
| 19 | ++__attribute__((noreturn)) void obstack_default_failed_handler(void) { |
| 20 | ++ abort(); |
| 21 | ++} |
| 22 | ++ |
| 23 | ++__attribute__((noreturn)) void (*obstack_alloc_failed_handler)(void) = obstack_default_failed_handler; |
| 24 | ++ |
| 25 | + /* Call functions with either the traditional malloc/free calling |
| 26 | + interface, or the mmalloc/mfree interface (that adds an extra first |
| 27 | + argument), based on the value of use_extra_arg. */ |
| 28 | +@@ -348,7 +354,7 @@ print_and_abort (void) |
| 29 | + abort gracefully or use longjump - but shouldn't return. This |
| 30 | + variable by default points to the internal function |
| 31 | + 'print_and_abort'. */ |
| 32 | +-__attribute_noreturn__ void (*obstack_alloc_failed_handler) (void) |
| 33 | +- = print_and_abort; |
| 34 | ++// __attribute_noreturn__ void (*obstack_alloc_failed_handler) (void) |
| 35 | ++// = print_and_abort; |
| 36 | + # endif /* !_OBSTACK_NO_ERROR_HANDLER */ |
| 37 | + #endif /* !_OBSTACK_ELIDE_CODE */ |
| 38 | +diff --git a/lib/obstack.h b/lib/obstack.h |
| 39 | +index e558133..f9033b3 100644 |
| 40 | +--- a/lib/obstack.h |
| 41 | ++++ b/lib/obstack.h |
| 42 | +@@ -227,7 +227,11 @@ extern _OBSTACK_SIZE_T _obstack_memory_used (struct obstack *) |
| 43 | + more memory. This can be set to a user defined function which |
| 44 | + should either abort gracefully or use longjump - but shouldn't |
| 45 | + return. The default action is to print a message and abort. */ |
| 46 | +-extern __attribute_noreturn__ void (*obstack_alloc_failed_handler) (void); |
| 47 | ++//extern __attribute_noreturn__ void (*obstack_alloc_failed_handler) (void); |
| 48 | ++#ifndef obstack_alloc_failed_handler |
| 49 | ++extern __attribute__((noreturn)) void (*obstack_alloc_failed_handler)(void); |
| 50 | ++#endif |
| 51 | ++ |
| 52 | + |
| 53 | + /* Exit value used when 'print_and_abort' is used. */ |
| 54 | + extern int obstack_exit_failure; |
0 commit comments