From 87e1739a852c2aff264c6c90c3b508129e3cae70 Mon Sep 17 00:00:00 2001 From: Wildan M Date: Fri, 10 Apr 2026 16:38:32 +0700 Subject: [PATCH] Fix malloc conflict --- src/header/malloc/cbindgen.toml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/header/malloc/cbindgen.toml b/src/header/malloc/cbindgen.toml index 2d6db57254..18db86526d 100644 --- a/src/header/malloc/cbindgen.toml +++ b/src/header/malloc/cbindgen.toml @@ -1,12 +1,25 @@ sys_includes = ["features.h", "stddef.h"] include_guard = "_RELIBC_MALLOC_H" trailer = """ +#ifndef _RELIBC_MALLOC_EXTRA_H +#define _RELIBC_MALLOC_EXTRA_H + +#ifdef __cplusplus +extern "C" { +#endif + void *calloc(size_t nelem, size_t elsize); void free(void *ptr); void *malloc(size_t size); void *memalign(size_t alignment, size_t size); void *realloc(void *ptr, size_t size); void *valloc(size_t size); + +#ifdef __cplusplus +} +#endif + +#endif """ language = "C" style = "Type"