summaryrefslogtreecommitdiffstats
path: root/lib/rbcodec/codecs/libopus/ogg/os_types.h
blob: 55f0bf559cc381dcc270ac96f8c3a66ce7977b73 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#include "config.h"
#include <stdint.h>
#include "codeclib.h"

#ifdef SIMULATOR

#include <stdio.h>

static inline void* _ogg_malloc(size_t size)
{
    void *buf;

    printf("ogg_malloc %d", size);
    buf = codec_malloc(size);
    printf(" = %p\n", buf);
    
    return buf;
}

static inline void* _ogg_calloc(size_t nmemb, size_t size)
{
    printf("ogg_calloc %d %d\n", nmemb, size);
    return codec_calloc(nmemb, size);
}

static inline void* _ogg_realloc(void *ptr, size_t size)
{
    void *buf;

    printf("ogg_realloc %p %d", ptr, size);
    buf = codec_realloc(ptr, size);
    printf(" = %p\n", buf);
    return buf;
}

static inline void _ogg_free(void *ptr)
{
    printf("ogg_free %p\n", ptr);
    codec_free(ptr);
}

#else

#define _ogg_malloc  codec_malloc
#define _ogg_calloc  codec_calloc
#define _ogg_realloc codec_realloc
#define _ogg_free    codec_free

#endif

typedef int16_t ogg_int16_t;
typedef uint16_t ogg_uint16_t;
typedef int32_t ogg_int32_t;
typedef uint32_t ogg_uint32_t;
typedef int64_t ogg_int64_t;