summaryrefslogtreecommitdiff
path: root/apps/codecs/libwmapro/libavutil/internal.h
diff options
context:
space:
mode:
authorMohamed Tarek <mt@rockbox.org>2010-07-15 05:38:09 +0000
committerMohamed Tarek <mt@rockbox.org>2010-07-15 05:38:09 +0000
commit387af97a26105fce79e6a8726752cf183d40939e (patch)
tree25c7898bbf08963b9c7688c8937061b4b3491dec /apps/codecs/libwmapro/libavutil/internal.h
parent5d2969c94e97c81e3eb88211b921be80b66bd691 (diff)
downloadrockbox-387af97a26105fce79e6a8726752cf183d40939e.tar.gz
rockbox-387af97a26105fce79e6a8726752cf183d40939e.zip
Initial cleanup for libwmapro.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27425 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/codecs/libwmapro/libavutil/internal.h')
-rw-r--r--apps/codecs/libwmapro/libavutil/internal.h210
1 files changed, 0 insertions, 210 deletions
diff --git a/apps/codecs/libwmapro/libavutil/internal.h b/apps/codecs/libwmapro/libavutil/internal.h
deleted file mode 100644
index 87a4d3ec10..0000000000
--- a/apps/codecs/libwmapro/libavutil/internal.h
+++ /dev/null
@@ -1,210 +0,0 @@
1/*
2 * copyright (c) 2006 Michael Niedermayer <michaelni@gmx.at>
3 *
4 * This file is part of FFmpeg.
5 *
6 * FFmpeg is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
10 *
11 * FFmpeg is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with FFmpeg; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 */
20
21/**
22 * @file libavutil/internal.h
23 * common internal API header
24 */
25
26#ifndef AVUTIL_INTERNAL_H
27#define AVUTIL_INTERNAL_H
28
29#if !defined(DEBUG) && !defined(NDEBUG)
30# define NDEBUG
31#endif
32
33#include <limits.h>
34#include <stdint.h>
35#include <stddef.h>
36//#include <assert.h>
37//#include "config.h"
38#include "attributes.h"
39//#include "timer.h"
40
41#ifndef attribute_align_arg
42#if (!defined(__ICC) || __ICC > 1110) && AV_GCC_VERSION_AT_LEAST(4,2)
43# define attribute_align_arg __attribute__((force_align_arg_pointer))
44#else
45# define attribute_align_arg
46#endif
47#endif
48
49#ifndef attribute_used
50#if AV_GCC_VERSION_AT_LEAST(3,1)
51# define attribute_used __attribute__((used))
52#else
53# define attribute_used
54#endif
55#endif
56
57#ifndef av_alias
58//#if HAVE_ATTRIBUTE_MAY_ALIAS && (!defined(__ICC) || __ICC > 1110) && AV_GCC_VERSION_AT_LEAST(3,3)
59#if 0
60# define av_alias __attribute__((may_alias))
61#else
62# define av_alias
63#endif
64#endif
65
66#ifndef INT16_MIN
67#define INT16_MIN (-0x7fff - 1)
68#endif
69
70#ifndef INT16_MAX
71#define INT16_MAX 0x7fff
72#endif
73
74#ifndef INT32_MIN
75#define INT32_MIN (-0x7fffffff - 1)
76#endif
77
78#ifndef INT32_MAX
79#define INT32_MAX 0x7fffffff
80#endif
81
82#ifndef UINT32_MAX
83#define UINT32_MAX 0xffffffff
84#endif
85
86#ifndef INT64_MIN
87#define INT64_MIN (-0x7fffffffffffffffLL - 1)
88#endif
89
90#ifndef INT64_MAX
91#define INT64_MAX INT64_C(9223372036854775807)
92#endif
93
94#ifndef UINT64_MAX
95#define UINT64_MAX UINT64_C(0xFFFFFFFFFFFFFFFF)
96#endif
97
98#ifndef INT_BIT
99# define INT_BIT (CHAR_BIT * sizeof(int))
100#endif
101
102#ifndef offsetof
103# define offsetof(T, F) ((unsigned int)((char *)&((T *)0)->F))
104#endif
105
106/* Use to export labels from asm. */
107#define LABEL_MANGLE(a) EXTERN_PREFIX #a
108
109// Use rip-relative addressing if compiling PIC code on x86-64.
110//#if ARCH_X86_64 && defined(PIC)
111#if 0
112# define LOCAL_MANGLE(a) #a "(%%rip)"
113#else
114# define LOCAL_MANGLE(a) #a
115#endif
116
117#define MANGLE(a) EXTERN_PREFIX LOCAL_MANGLE(a)
118
119/* debug stuff */
120
121/* dprintf macros */
122#ifdef DEBUG
123# define dprintf(pctx, ...) av_log(pctx, AV_LOG_DEBUG, __VA_ARGS__)
124#else
125# define dprintf(pctx, ...)
126#endif
127
128#define av_abort() do { av_log(NULL, AV_LOG_ERROR, "Abort at %s:%d\n", __FILE__, __LINE__); abort(); } while (0)
129
130/* math */
131
132//#if ARCH_X86
133#if 0
134#define MASK_ABS(mask, level)\
135 __asm__ volatile(\
136 "cltd \n\t"\
137 "xorl %1, %0 \n\t"\
138 "subl %1, %0 \n\t"\
139 : "+a" (level), "=&d" (mask)\
140 );
141#else
142#define MASK_ABS(mask, level)\
143 mask = level >> 31;\
144 level = (level ^ mask) - mask;
145#endif
146
147/* avoid usage of dangerous/inappropriate system functions */
148//#undef malloc
149//#define malloc please_use_av_malloc
150#undef free
151#define free please_use_av_free
152#undef realloc
153#define realloc please_use_av_realloc
154#undef time
155#define time time_is_forbidden_due_to_security_issues
156#undef rand
157#define rand rand_is_forbidden_due_to_state_trashing_use_av_lfg_get
158#undef srand
159#define srand srand_is_forbidden_due_to_state_trashing_use_av_lfg_init
160#undef random
161#define random random_is_forbidden_due_to_state_trashing_use_av_lfg_get
162#undef sprintf
163#define sprintf sprintf_is_forbidden_due_to_security_issues_use_snprintf
164#undef strcat
165#define strcat strcat_is_forbidden_due_to_security_issues_use_av_strlcat
166#undef exit
167#define exit exit_is_forbidden
168#ifndef LIBAVFORMAT_BUILD
169//#undef printf
170//#define printf please_use_av_log_instead_of_printf
171#undef fprintf
172#define fprintf please_use_av_log_instead_of_fprintf
173#undef puts
174#define puts please_use_av_log_instead_of_puts
175#undef perror
176#define perror please_use_av_log_instead_of_perror
177#endif
178
179#define FF_ALLOC_OR_GOTO(ctx, p, size, label)\
180{\
181 p = av_malloc(size);\
182 if (p == NULL && (size) != 0) {\
183 av_log(ctx, AV_LOG_ERROR, "Cannot allocate memory.\n");\
184 goto label;\
185 }\
186}
187
188#define FF_ALLOCZ_OR_GOTO(ctx, p, size, label)\
189{\
190 p = av_mallocz(size);\
191 if (p == NULL && (size) != 0) {\
192 av_log(ctx, AV_LOG_ERROR, "Cannot allocate memory.\n");\
193 goto label;\
194 }\
195}
196
197//#include "libm.h"
198
199/**
200 * Returns NULL if CONFIG_SMALL is true, otherwise the argument
201 * without modification. Used to disable the definition of strings
202 * (for example AVCodec long_names).
203 */
204//#if CONFIG_SMALL
205//# define NULL_IF_CONFIG_SMALL(x) NULL
206//#else
207//# define NULL_IF_CONFIG_SMALL(x) x
208//#endif
209
210#endif /* AVUTIL_INTERNAL_H */