pseudotalloc: turn talloc_steal() into #define

Any non-anciant version of talloc implements talloc_steal()
as a #define using the _talloc_steal_loc() symbol.  Let's be
more compatible.

This fix is relevant to using osmo_fsm inside the osmo-ccid-firmware
builds for Cortex-M4.  In this situation, for some strange reason,
libosmcoore is compiled using src/pseudotalloc/talloc.h, but later then
linked against the real libtalloc.

Change-Id: I1ee7f5e9b1002cff37bb8341ad870e1da5f1f9ff
This commit is contained in:
Harald Welte 2019-05-17 21:06:51 +02:00
parent 753ae497c7
commit 5f46605aee
2 changed files with 3 additions and 2 deletions

View File

@ -97,7 +97,7 @@ char *talloc_asprintf(const void *ctx, const char *fmt, ...)
return buf;
}
void *talloc_steal(const void *new_ctx, const void *obj)
void *_talloc_steal_loc(const void *new_ctx, const void *obj, const char *location)
{
/* as we don't do hierarchical allocations, this is simply a NOP */
return (void *)obj;

View File

@ -60,5 +60,6 @@ void *_talloc_zero_array(const void *ctx,
const char *name);
char *talloc_asprintf(const void *ctx, const char *fmt, ...);
void *talloc_steal(const void *new_ctx, const void *obj);
#define talloc_steal(ctx, ptr) _talloc_steal_loc((ctx), (ptr), __location__)
void *_talloc_steal_loc(const void *new_ctx, const void *obj, const char *location);
char *talloc_vasprintf(const void *t, const char *fmt, va_list ap);