#ifndef __ASN1_ARCH_TBASE_CONFIG_H__
#define __ASN1_ARCH_TBASE_CONFIG_H__

#ifdef __clang__
#include <alloca.h>
#include <stdlib.h>
#else
// Disable including DS-5 stdlib.h because it conflicts with calloc declaration
#define __stdlib_h
#endif

#include <tee_internal_api.h>

#define CALLOC(nmemb, size) TEE_Malloc((nmemb) * (size), HINT_FILL_WITH_ZEROS)
#define MALLOC(size)    TEE_Malloc(size, HINT_DONT_FILL_WITH_ZEROS)
#define REALLOC(oldptr, size) TEE_Realloc(oldptr, size)
#define FREEMEM(ptr)    TEE_Free(ptr)

#ifndef EPERM
#define EPERM  (1)  /* Operation not permitted */
#endif

#endif // __ASN1_ARCH_TBASE_CONFIG_H__
