diff options
Diffstat (limited to 'apps/plugins/lib/mem_function_wrappers.h')
-rw-r--r-- | apps/plugins/lib/mem_function_wrappers.h | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/apps/plugins/lib/mem_function_wrappers.h b/apps/plugins/lib/mem_function_wrappers.h new file mode 100644 index 0000000000..ec3872c4c1 --- /dev/null +++ b/apps/plugins/lib/mem_function_wrappers.h | |||
@@ -0,0 +1,44 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2007 Nils Wallménius | ||
11 | * | ||
12 | * All files in this archive are subject to the GNU General Public License. | ||
13 | * See the file COPYING in the source tree root for full license agreement. | ||
14 | * | ||
15 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
16 | * KIND, either express or implied. | ||
17 | * | ||
18 | ****************************************************************************/ | ||
19 | #ifndef __MEM_FUNCTION_WRAPPERS_H__ | ||
20 | #define __MEM_FUNCTION_WRAPPERS_H__ | ||
21 | |||
22 | /* Use this macro in plugins where gcc tries to optimize by calling | ||
23 | * these functions directly */ | ||
24 | |||
25 | #define MEM_FUNCTION_WRAPPERS(api) \ | ||
26 | void *memcpy(void *dest, const void *src, size_t n) \ | ||
27 | { \ | ||
28 | return (api)->memcpy(dest, src, n); \ | ||
29 | } \ | ||
30 | void *memset(void *dest, int c, size_t n) \ | ||
31 | { \ | ||
32 | return (api)->memset(dest, c, n); \ | ||
33 | } \ | ||
34 | void *memmove(void *dest, const void *src, size_t n) \ | ||
35 | { \ | ||
36 | return (api)->memmove(dest, src, n); \ | ||
37 | } \ | ||
38 | int memcmp(const void *s1, const void *s2, size_t n) \ | ||
39 | { \ | ||
40 | return (api)->memcmp(s1, s2, n); \ | ||
41 | } | ||
42 | |||
43 | #endif /* __MEM_FUNCTION_WRAPPERS_H__ */ | ||
44 | |||