diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-04 01:13:15 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-04 01:13:15 +0000 |
commit | bff6c10f6909412899de6ab7c902f96080905550 (patch) | |
tree | 616d06233c652837e0d36657306ed0c157821a9a /ta/ta.h | |
parent | Releasing progress-linux version 0.37.0-1~progress7.99u1. (diff) | |
download | mpv-bff6c10f6909412899de6ab7c902f96080905550.tar.xz mpv-bff6c10f6909412899de6ab7c902f96080905550.zip |
Merging upstream version 0.38.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | ta/ta.h | 23 |
1 files changed, 20 insertions, 3 deletions
@@ -144,9 +144,26 @@ void *ta_xrealloc_size(void *ta_parent, void *ptr, size_t size); #define ta_xrealloc_size(...) ta_dbg_set_loc(ta_xrealloc_size(__VA_ARGS__), TA_LOC) #endif -void ta_oom_b(bool b); -char *ta_oom_s(char *s); -void *ta_oom_p(void *p); +static inline void *ta_oom_p(void *p) +{ + if (!p) + abort(); + return p; +} + +static inline void ta_oom_b(bool b) +{ + if (!b) + abort(); +} + +static inline char *ta_oom_s(char *s) +{ + if (!s) + abort(); + return s; +} + // Generic pointer #define ta_oom_g(ptr) (TA_TYPEOF(ptr))ta_oom_p(ptr) |