summaryrefslogtreecommitdiffstats
path: root/ta/ta.h
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 01:13:15 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 01:13:15 +0000
commitbff6c10f6909412899de6ab7c902f96080905550 (patch)
tree616d06233c652837e0d36657306ed0c157821a9a /ta/ta.h
parentReleasing progress-linux version 0.37.0-1~progress7.99u1. (diff)
downloadmpv-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.h23
1 files changed, 20 insertions, 3 deletions
diff --git a/ta/ta.h b/ta/ta.h
index 4baac8f..485f38f 100644
--- a/ta/ta.h
+++ b/ta/ta.h
@@ -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)