-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcompiler.h
More file actions
67 lines (59 loc) · 1.34 KB
/
compiler.h
File metadata and controls
67 lines (59 loc) · 1.34 KB
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
57
58
59
60
61
62
63
64
65
66
67
/*
* compiler.h
*
* Copyright 2014 Fernando Rodriguez (support@fernansoft.com).
* All rights reserved
*
*/
#ifndef MP3_COMPILER_H
#define MP3_COMPILER_H
#include <string.h>
#if defined(__C30__) || defined(__XC16__)
/*
// fast memcpy and memmove implementations
*/
void memcpy_fast(void *dst, void const*src, size_t size);
void memmove_fast(void *dst, void const *src, size_t size);
#define memcpy memcpy_fast
#define memmove memmove_fast
/*
// debug symbols
*/
#if !defined(__DEBUG)
#define NDEBUG
#endif
/* #define inline __attribute__((always_inline)) */
#define PTR_M
#define ROM
#define HALT() __asm__ volatile (".pword 0xDA4000\nnop\nnop\nnop")
#if !defined(_ASSERT)
#if defined(NDEBUG)
#define _ASSERT(c)
#else
#define _ASSERT(c) if (!(c)) HALT()
#endif
#endif
typedef unsigned int uintptr_t;
#else
#define inline __inline
#define PTR_M
#define ROM
#if defined(_MSC_VER)
//#define _W64
//#define int short
//#define long __int32
typedef unsigned int uintptr_t ;
#else
/* todo: add define for 32 bits */
typedef unsigned long uintptr_t ;
#endif
#if !defined(_ASSERT)
#if defined(__XC32__)
#define _ASSERT(c) if (!(c)) while (1);
#else
#include <assert.h>
#define _ASSERT(c) assert((c))
#endif
#endif
#endif
#endif