49#ifdef OS_SUPPORT_CUSTOM
50#include "os_support_custom.h"
55#ifndef OVERRIDE_SPEEX_ALLOC
61 return calloc(size,1);
66#ifndef OVERRIDE_SPEEX_ALLOC_SCRATCH
70 return calloc(size,1);
75#ifndef OVERRIDE_SPEEX_REALLOC
78 return realloc(ptr, size);
83#ifndef OVERRIDE_SPEEX_FREE
91#ifndef OVERRIDE_SPEEX_FREE_SCRATCH
99#ifndef OVERRIDE_SPEEX_COPY
100#define SPEEX_COPY(dst, src, n) (memcpy((dst), (src), (n)*sizeof(*(dst)) + 0*((dst)-(src)) ))
105#ifndef OVERRIDE_SPEEX_MOVE
106#define SPEEX_MOVE(dst, src, n) (memmove((dst), (src), (n)*sizeof(*(dst)) + 0*((dst)-(src)) ))
110#ifndef OVERRIDE_SPEEX_MEMSET
111#define SPEEX_MEMSET(dst, c, n) (memset((dst), (c), (n)*sizeof(*(dst))))
115#ifndef OVERRIDE_SPEEX_FATAL
116static inline void _speex_fatal(
const char *str,
const char *file,
int line)
118 fprintf (stderr,
"Fatal (internal) error in %s, line %d: %s\n", file, line, str);
123#ifndef OVERRIDE_SPEEX_WARNING
124static inline void speex_warning(
const char *str)
126#ifndef DISABLE_WARNINGS
127 fprintf (stderr,
"warning: %s\n", str);
132#ifndef OVERRIDE_SPEEX_WARNING_INT
133static inline void speex_warning_int(
const char *str,
int val)
135#ifndef DISABLE_WARNINGS
136 fprintf (stderr,
"warning: %s %d\n", str, val);
141#ifndef OVERRIDE_SPEEX_NOTIFY
142static inline void speex_notify(
const char *str)
144#ifndef DISABLE_NOTIFICATIONS
145 fprintf (stderr,
"notification: %s\n", str);
150#ifndef OVERRIDE_SPEEX_PUTC
154 FILE *f = (FILE *)file;
155 fprintf(f,
"%c", ch);
159#define speex_fatal(str) _speex_fatal(str, __FILE__, __LINE__);
163static inline void print_vec(
float *vec,
int len,
char *name)
166 printf (
"%s ", name);
168 printf (
" %f", vec[i]);
static void speex_free_scratch(void *ptr)
Same as speex_free, except that the area is only needed inside a Speex call (might cause problem with...
static void * speex_alloc(int size)
Speex wrapper for calloc.
static void * speex_realloc(void *ptr, int size)
Speex wrapper for realloc.
static void speex_free(void *ptr)
Speex wrapper for calloc.
static void _speex_putc(int ch, void *file)
Speex wrapper for putc.
static void * speex_alloc_scratch(int size)
Same as speex_alloc, except that the area is only needed inside a Speex call (might cause problem wit...