1 /*****************************************************************************
2  *
3  * Copyright (c) 2008-2010, CoreCodec, Inc.
4  * All rights reserved.
5  *
6  * Redistribution and use in source and binary forms, with or without
7  * modification, are permitted provided that the following conditions are met:
8  *     * Redistributions of source code must retain the above copyright
9  *       notice, this list of conditions and the following disclaimer.
10  *     * Redistributions in binary form must reproduce the above copyright
11  *       notice, this list of conditions and the following disclaimer in the
12  *       documentation and/or other materials provided with the distribution.
13  *     * Neither the name of CoreCodec, Inc. nor the
14  *       names of its contributors may be used to endorse or promote products
15  *       derived from this software without specific prior written permission.
16  *
17  * THIS SOFTWARE IS PROVIDED BY CoreCodec, Inc. ``AS IS'' AND ANY
18  * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
19  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20  * DISCLAIMED. IN NO EVENT SHALL CoreCodec, Inc. BE LIABLE FOR ANY
21  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
22  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
23  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
24  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
26  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27  *
28  ****************************************************************************/
29 
30 #ifndef __PORTAB_H
31 #define __PORTAB_H
32 
33 #if defined(__GNUC__) && defined(__palmos__)
34 #undef __WCHAR_TYPE__
35 #define __WCHAR_TYPE__ unsigned short
36 #endif
37 
38 #include <string.h>
39 #include <ctype.h>
40 #include <stdarg.h>
41 #include <stddef.h>
42 #include <limits.h>
43 
44 #undef INLINE
45 #undef NOINLINE
46 #undef IS_LITTLE_ENDIAN
47 #undef IS_BIG_ENDIAN
48 
49 #if defined(__palmos__)
50 
51 #define TARGET_PALMOS
52 #define NO_FLOATINGPOINT
53 #define CONFIG_BLOCK_RDONLY
54 
55 #elif defined(_EE)
56 
57 #define TARGET_PS2SDK
58 #define TARGET_DESKTOP
59 #define RESOURCE_COREC
60 
61 #elif defined(__SYMBIAN32__)
62 
63 #if defined(__SERIES60_3X__)
64 #define SYMBIAN90
65 #define SERIES60
66 #elif defined(__SERIES60_10__)
67 #define SYMBIAN60
68 #define SERIES60
69 #elif defined(__SERIES60_20__)
70 #define SYMBIAN70
71 #define SERIES60
72 #elif defined(__SERIES80__)
73 #define SYMBIAN70
74 #define SERIES80
75 #elif defined(__SERIES90__)
76 #define SYMBIAN70
77 #define SERIES90
78 #elif defined(__UIQ3__)
79 #define SYMBIAN90
80 #define UIQ
81 #elif defined(__UIQ__)
82 #define SYMBIAN70
83 #define UIQ
84 #endif
85 
86 #define TARGET_SYMBIAN
87 #ifndef UNICODE
88 #define UNICODE
89 #endif
90 
91 #ifdef __MARM__
92 #define ARM
93 #endif
94 
95 #elif defined(_WIN32_WCE)
96 
97 #if !defined(CONFIG_WINCE2) && (_WIN32_WCE>=200 && _WIN32_WCE<300)
98 #define CONFIG_WINCE2
99 #endif
100 
101 #if defined(WIN32_PLATFORM_WFSP)
102 #define TARGET_SMARTPHONE
103 #endif
104 
105 #define TARGET_WINCE
106 #define TARGET_WIN
107 
108 #ifndef UNICODE
109 #define UNICODE
110 #endif
111 
112 #elif defined(_WIN64)
113 
114 #define TARGET_WIN64
115 #define TARGET_WIN
116 #define TARGET_DESKTOP
117 
118 #elif defined(_WIN32)
119 
120 #define TARGET_WIN32
121 #define TARGET_WIN
122 #define TARGET_DESKTOP
123 
124 #elif defined(__APPLE__)
125 
126 #ifndef TARGET_IPHONE
127 #include <TargetConditionals.h> // iPhone information is defined within the SDK in which Xcode is pointed to
128 #endif
129 
130 #define TARGET_OSX
131 #undef UNICODE // tchar_t is UTF-8 for OS X
132 
133 #ifdef TARGET_OS_IPHONE // defined in TargetConditionals.h
134 #define TARGET_IPHONE
135 #define TARGET_IPHONE_SDK
136 
137 #if !TARGET_IPHONE_SIMULATOR
138 #define TARGET_IPHONE_DEVICE
139 #endif
140 
141 
142 #if defined(__arm__)
143 #define ARM
144 #endif
145 
146 #endif
147 
148 #ifndef TARGET_IPHONE
149 #define TARGET_DESKTOP // only for dekstop (not iPhone or Apple TV)
150 #endif
151 
152 #elif defined(ANDROID)
153 
154 #define TARGET_ANDROID
155 
156 #if defined(__arm__)
157 #define ARM
158 #endif
159 
160 #elif defined(__linux__) || defined(__CYGWIN__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)
161 
162 #if defined(__FreeBSD__)
163 #define TARGET_FREEBSD
164 #endif
165 #define TARGET_LINUX
166 
167 #ifndef TARGET_QTOPIA // qtopia defines desktop manually
168 #define TARGET_DESKTOP // not necessarily
169 #endif
170 
171 #else
172 #error Platform not supported by Core-C!
173 #endif
174 
175 #if defined(__powerpc__) || defined(__PPC__) || defined(__POWERPC__)
176 #define POWERPC
177 #define IS_BIG_ENDIAN
178 #endif
179 
180 #if defined(__sparc)
181 #if defined(_LP64)
182 #define SPARC64
183 #define CPU_64BITS
184 #else
185 #define SPARC32
186 #endif
187 #define IS_BIG_ENDIAN
188 #endif
189 
190 #if defined(TARGET_LINUX) || defined(TARGET_ANDROID)
191 #if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)
192 #include <sys/endian.h>
193 #else
194 #include <endian.h>
195 #endif
196 #if __BYTE_ORDER == __LITTLE_ENDIAN
197 #define IS_LITTLE_ENDIAN
198 #elif __BYTE_ORDER == __BIG_ENDIAN
199 #define IS_BIG_ENDIAN
200 #endif
201 #endif
202 
203 #if defined(_M_X64) || defined(__amd64__)
204 #define IX86_64
205 #define CPU_64BITS
206 #endif
207 
208 #if defined(_M_IA64)
209 #define IA64
210 #define CPU_64BITS
211 #endif
212 
213 #if defined(__mips) && !defined(MIPS)
214 #define MIPS
215 #endif
216 
217 #ifdef MIPS
218 #if defined(__mips64) || defined(CONFIG_MIPS64)
219 #define MIPS64
220 #else
221 #define MIPS32
222 #endif
223 #endif
224 
225 #if defined(_M_IX86) || defined(__i386) || defined(__i686)
226 #define IX86
227 #endif
228 
229 #if !defined(IS_LITTLE_ENDIAN) && !defined(IS_BIG_ENDIAN)
230 #define IS_LITTLE_ENDIAN
231 #endif
232 
233 #define TICKSPERSEC			16384
234 #define TIMEPERSEC          (TICKSPERSEC>>4)
235 
236 #ifndef M_PI
237 #define M_PI    3.14159265358979323846264338327950288
238 #endif
239 
240 #ifdef _MSC_VER
241 
242 #define _CRTDBG_MAP_ALLOC
243 #include <stdlib.h>
244 #include <malloc.h>
245 #ifndef TARGET_WINCE
246 #include <crtdbg.h>
247 #endif
248 
249 #ifndef strncasecmp
250 #define strncasecmp(x,y,z) _strnicmp(x,y,z)
251 #endif
252 #ifndef strcasecmp
253 #define strcasecmp(x,y)    _stricmp(x,y)
254 #endif
255 #ifndef stricmp
256 #define stricmp(x,y)       _stricmp(x,y)
257 #endif
258 #ifndef strnicmp
259 #define strnicmp(x,y,z)    _strnicmp(x,y,z)
260 #endif
261 
262 #if _MSC_VER >= 1400
263 #pragma comment(linker, "/nodefaultlib:libc.lib")
264 #pragma comment(linker, "/nodefaultlib:libcd.lib")
265 //#pragma comment(linker, "/nodefaultlib:oldnames.lib")
266 #elif defined(_WIN32_WCE)
267 // allow evc3/evc4 compiling with vs2005 object files
268 #pragma comment(linker, "/nodefaultlib:libcmt.lib")
269 #pragma comment(linker, "/nodefaultlib:oldnames.lib")
270 #endif
271 
272 #ifndef alloca
273 #define alloca _alloca
274 #endif
275 
276 #ifndef inline
277 #define inline __inline
278 #endif
279 
280 #ifndef _UINTPTR_T_DEFINED
281 typedef unsigned int uintptr_t;
282 #define _UINTPTR_T_DEFINED
283 #endif
284 
285 #ifndef _INTPTR_T_DEFINED
286 typedef signed int intptr_t;
287 #define _INTPTR_T_DEFINED
288 #endif
289 
290 #if _MSC_VER >= 1400
291 #define NOINLINE __declspec(noinline)
292 #else
293 #define NOINLINE
294 #endif
295 
296 #define INLINE __forceinline
297 
298 #ifndef STDCALL
299 #define STDCALL __stdcall
300 #endif
301 
302 #ifndef CDECL
303 #define CDECL __cdecl
304 #endif
305 
306 #if !defined(COMPILER_MSVC)
307 #define COMPILER_MSVC
308 #endif
309 
310 #if defined(__cplusplus)
311 #define SORTPP_PASS // to avoid a problem if winnt.h is included after us
312 #define NOMINMAX // conflict with <algorithm>
313 #endif
314 
315 #else /* _MSC_VER */
316 
317 #include <stdlib.h>
318 
319 #if defined(TARGET_SYMBIAN)
320 
321 typedef signed long int32_t;
322 typedef unsigned long uint32_t;
323 typedef signed short int16_t;
324 typedef unsigned short uint16_t;
325 typedef signed char int8_t;
326 typedef unsigned char uint8_t;
327 typedef signed long long int64_t;
328 typedef unsigned long long uint64_t;
329 typedef uint32_t uintptr_t;
330 typedef int32_t intptr_t;
331 typedef signed int int_fast32_t;
332 typedef unsigned int uint_fast32_t;
333 typedef signed int int_fast16_t;
334 typedef unsigned int uint_fast16_t;
335 typedef signed char int_fast8_t;
336 typedef unsigned char uint_fast8_t;
337 typedef signed long long int_fast64_t;
338 typedef unsigned long long uint_fast64_t;
339 
340 #elif !defined(__GLIBC__) && !defined(__MINGW32__) && !defined(TARGET_PS2SDK) && !defined(TARGET_IPHONE) && !defined(TARGET_ANDROID) && !defined(__FreeBSD__)
341 
342 #include <inttypes.h>
343 
344 #ifdef SPARC64
345   typedef int64_t int_fast32_t;
346   typedef uint64_t uint_fast32_t;
347   typedef int64_t int_fast16_t;
348   typedef uint64_t uint_fast16_t;
349 #else
350   typedef int32_t int_fast32_t;
351   typedef uint32_t uint_fast32_t;
352 # ifndef __APPLE__
353   typedef int32_t int_fast16_t;
354   typedef uint32_t uint_fast16_t;
355 # endif
356 #endif
357 
358 typedef int8_t int_fast8_t;
359 typedef uint8_t uint_fast8_t;
360 typedef int64_t int_fast64_t;
361 typedef uint64_t uint_fast64_t;
362 
363 #else
364 #include <stdint.h>
365 #endif
366 
367 #if defined(__GNUC__) && (__GNUC__ > 3 || __GNUC__ == 3 && __GNUC_MINOR__ > 0) && !defined(always_inline)
368 #define INLINE __attribute__((always_inline)) inline
369 #else
370 #define INLINE inline
371 #endif
372 
373 #if __GNUC__ >= 3
374   #define NOINLINE __attribute__((noinline))
375 #else
376   #define NOINLINE
377 #endif
378 
379 #if !defined(IX86) || defined(__CW32__)
380 #define __stdcall
381 #define __cdecl
382 #define STDCALL
383 #define CDECL
384 #else
385 #ifndef STDCALL
386 #define STDCALL __attribute__((stdcall))
387 #endif
388 #ifndef CDECL
389 #define CDECL __attribute__((cdecl))
390 #endif
391 #endif
392 
393 #if !defined(COMPILER_GCC) && defined(__GNUC__)
394 #define COMPILER_GCC
395 #endif
396 
397 #endif /* _MSC_VER */
398 
399 #if !defined(_STDINT_H) && !defined(_STDINT_H_) && !defined(_UINT64_T_DECLARED) // could be used elsewhere
400 
401 typedef signed long int32_t;
402 typedef unsigned long uint32_t;
403 typedef signed short int16_t;
404 typedef unsigned short uint16_t;
405 typedef signed char int8_t;
406 typedef unsigned char uint8_t;
407 typedef signed __int64 int64_t;
408 typedef unsigned __int64 uint64_t;
409 
410 #if defined(IX86_64) || defined(IA64)
411 typedef signed __int64 int_fast32_t;
412 typedef unsigned __int64 uint_fast32_t;
413 typedef signed __int64 int_fast16_t;
414 typedef unsigned __int64 uint_fast16_t;
415 typedef signed char int_fast8_t;
416 typedef unsigned char uint_fast8_t;
417 typedef signed __int64 int_fast64_t;
418 typedef unsigned __int64 uint_fast64_t;
419 #else
420 #if _MSC_VER >= 1400
421 typedef __w64 signed int int_fast32_t;
422 typedef __w64 unsigned int uint_fast32_t;
423 typedef __w64 signed int int_fast16_t;
424 typedef __w64 unsigned int uint_fast16_t;
425 #else
426 typedef signed int int_fast32_t;
427 typedef unsigned int uint_fast32_t;
428 typedef signed int int_fast16_t;
429 typedef unsigned int uint_fast16_t;
430 #endif
431 typedef signed char int_fast8_t;
432 typedef unsigned char uint_fast8_t;
433 typedef signed __int64 int_fast64_t;
434 typedef unsigned __int64 uint_fast64_t;
435 #endif
436 #endif
437 
438 #ifdef _MSC_VER
439 #define LL(x)   x##i64
440 #define ULL(x)  x##ui64
441 #define PRId64  "I64d"
442 #define PRIu64  "I64u"
443 #define PRIx64  "I64x"
444 #define TPRId64  L"I64d"
445 #define TPRIu64  L"I64u"
446 #define TPRIx64  L"I64x"
447 #else
448 #define LL(x)   x##ll
449 #define ULL(x)  x##ull
450 #ifndef PRId64
451 #define PRId64  "lld"
452 #endif
453 #ifndef PRIu64
454 #define PRIu64  "llu"
455 #endif
456 #ifndef PRIx64
457 #define PRIx64  "llx"
458 #endif
459 #define TPRId64  PRId64
460 #define TPRIu64  PRIu64
461 #define TPRIx64  PRIx64
462 #endif
463 
464 #define MAX_INT64 LL(0x7fffffffffffffff)
465 
466 #define MAX_TICK INT_MAX
467 
468 typedef int_fast32_t err_t;
469 typedef int_fast32_t bool_t;
470 typedef int_fast32_t tick_t;
471 typedef uint8_t boolmem_t; /* unsigned so ":1" bitmode should work */
472 typedef uint32_t fourcc_t;
473 typedef uint32_t rgbval_t;
474 
475 typedef struct cc_guid
476 {
477     uint32_t v1;
478     uint16_t v2;
479     uint16_t v3;
480     uint8_t v4[8];
481 } cc_guid;
482 
483 typedef struct cc_fraction
484 {
485 	int_fast32_t Num;
486 	int_fast32_t Den;
487 } cc_fraction;
488 
489 typedef struct cc_fraction64
490 {
491 	int_fast64_t Num;
492 	int_fast64_t Den;
493 } cc_fraction64;
494 
495 typedef struct cc_point
496 {
497 	int x;
498 	int y;
499 
500 } cc_point;
501 
502 typedef struct cc_point16
503 {
504 	int16_t x;
505 	int16_t y;
506 
507 } cc_point16;
508 
509 typedef struct cc_rect
510 {
511 	int x;
512 	int y;
513 	int Width;
514 	int Height;
515 
516 } cc_rect;
517 
518 #ifndef ZLIB_INTERNAL
519 
520 #undef T
521 #define TSIZEOF(name)	(sizeof(name)/sizeof(tchar_t))
522 
523 #if defined(UNICODE)
524 
525 #if defined(__GNUC__) && !defined(TARGET_SYMBIAN) && !defined(TARGET_PALMOS)
526 #include <wchar.h>
527 #endif
528 
529 #if defined(__GNUC__) && (__GNUC__<3) && defined(__cplusplus)
530 typedef __wchar_t tchar_t;
531 #else
532 typedef wchar_t tchar_t;
533 #endif
534 
535 #define tcsstr wcsstr
536 #define tcslen wcslen
537 #define tcschr wcschr
538 #define tcsrchr wcsrchr
539 #define tcscoll wcscoll
540 #define tcstod wcstod
541 #define tcscspn wcscspn
542 #define tcspbrk wcspbrk
543 #define tcstoul wcstoul
544 #define tcsftime wcsftime
545 #define T(a) L ## a
546 #else /* UNICODE */
547 typedef char tchar_t;
548 #define tcsstr strstr
549 #define tcslen strlen
550 #define tcschr strchr
551 #define tcsrchr strrchr
552 #define tcscoll strcoll
553 #define tcstod strtod
554 #define tcscspn strcspn
555 #define tcspbrk strpbrk
556 #define tcstoul strtoul
557 #define tcsftime strftime
558 #define T(a) a
559 #endif /* UNICODE */
560 
561 #define T__(x) T(x)
562 #endif
563 
564 #ifndef SIZEOF_WCHAR
565 #if defined(TARGET_OSX) || defined(TARGET_LINUX) || defined(TARGET_PS2SDK)
566 #define SIZEOF_WCHAR    4
567 #else
568 #define SIZEOF_WCHAR    2
569 #endif
570 #endif
571 
572 #if SIZEOF_WCHAR==2
573 typedef wchar_t utf16_t;
574 #else
575 typedef uint16_t utf16_t;
576 #endif
577 
578 #define tcscpy !UNSAFE!
579 #define tcscat !UNSAFE!
580 #define stprintf !UNSAFE!
581 #define vstprintf !UNSAFE!
582 
583 #if defined(_WIN32) || defined(TARGET_SYMBIAN)
584 #define DLLEXPORT __declspec(dllexport)
585 #define DLLIMPORT __declspec(dllimport)
586 #define DLLHIDDEN
587 #elif defined(__GNUC__) && ((__GNUC__*100 + __GNUC_MINOR__) >= 340)
588 #define DLLEXPORT __attribute__ ((visibility("default")))
589 #define DLLIMPORT __attribute__ ((visibility("default")))
590 #define DLLHIDDEN __attribute__ ((visibility("hidden")))
591 #else
592 #define DLLEXPORT
593 #define DLLIMPORT
594 #define DLLHIDDEN
595 #endif
596 
597 #ifdef __cplusplus
598 #define INTERNAL_C_API extern "C"
599 #else
600 #define INTERNAL_C_API extern
601 #endif
602 
603 
604 #if defined(TARGET_WINCE) && (defined(SH3) || defined(SH4) || defined(MIPS))
605 #define _INLINE
606 #define _CONST
607 #else
608 #define _INLINE INLINE
609 #define _CONST const
610 #endif
611 
612 /* todo: needs more testing, that nothing broke... */
613 #if defined(MAX_PATH)
614 #define MAXPATH MAX_PATH
615 #elif defined(PATH_MAX)
616 #define MAXPATH PATH_MAX
617 #else
618 #define MAXPATH 256
619 #endif
620 #define MAXPROTOCOL 16
621 
622 #if MAXPATH < 1024
623 #define MAXPATHFULL 1024
624 #else
625 #define MAXPATHFULL MAXPATH
626 #endif
627 
628 #define MAXPLANES 4
629 typedef void* planes[MAXPLANES];
630 typedef const void* constplanes[MAXPLANES];
631 #define CONST_CONSTPLANES(name) const void* const (name)[MAXPLANES]
632 #define CONSTPLANES(name) const void* (name)[MAXPLANES]
633 #define CONST_PLANES(name) void* const (name)[MAXPLANES]
634 
635 #define FOURCCBE(a,b,c,d) \
636 	(((uint8_t)(a) << 24) | ((uint8_t)(b) << 16) | \
637 	((uint8_t)(c) << 8) | ((uint8_t)(d) << 0))
638 
639 #define FOURCCLE(a,b,c,d) \
640 	(((uint8_t)(a) << 0) | ((uint8_t)(b) << 8) | \
641 	((uint8_t)(c) << 16) | ((uint8_t)(d)<< 24))
642 
643 #ifdef IS_BIG_ENDIAN
644 #define FOURCC(a,b,c,d) (fourcc_t)FOURCCBE(a,b,c,d)
645 #else
646 #define FOURCC(a,b,c,d) (fourcc_t)FOURCCLE(a,b,c,d)
647 #endif
648 
649 #if defined(TARGET_WINCE)
650 #undef strdup
651 #define strdup(x) _strdup(x)
652 #define wcscoll(x,y) tcscmp(x,y)
653 #endif
654 
655 #if defined(__CW32__)
656 void * __alloca(size_t size);
657 #ifndef alloca
658 #define alloca(size) __alloca(size)
659 #endif
660 #endif
661 
662 #if defined(__GNUC__)
663 
664 #ifndef alloca
665 #define alloca(size) __builtin_alloca(size)
666 #endif
667 
668 #if defined(TARGET_PALMOS)
669 extern int rand();
670 extern void srand(unsigned int);
671 extern void qsort(void* const base,size_t,size_t,int(*cmp)(const void*,const void*));
672 #endif
673 
674 #if defined(ARM) && !defined(TARGET_WINCE)
675 //fixed size stack:
676 //  symbian
677 //  palm os
678 #define SWAPSP
SwapSP(void * in)679 static INLINE void* SwapSP(void* in)
680 {
681 	void* out;
682 	asm volatile(
683 		"mov %0, sp\n\t"
684 		"mov sp, %1\n\t"
685 		: "=&r"(out) : "r"(in) : "cc");
686 	return out;
687 }
688 #endif
689 
690 #endif /* __GNUC__ */
691 
692 #if defined(TARGET_PALMOS) && defined(IX86)
693 extern void* malloc_palmos(size_t);
694 extern void* realloc_palmos(void*,size_t);
695 extern void free_palmos(void*);
696 #define malloc(n) malloc_palmos(n)
697 #define realloc(p,n) realloc_palmos(p,n)
698 #define free(p) free_palmos(p)
699 #endif
700 
701 #if defined(_MSC_VER) && defined(TARGET_WIN)
702 #define TRY_BEGIN __try {
703 #define TRY_END   ;} __except (1) {}
704 #define TRY_END_FUNC(func) ;} __except (1) { func; }
705 #else
706 #define TRY_BEGIN {
707 #define TRY_END   }
708 #define TRY_END_FUNC(func) }
709 #endif
710 
711 #ifndef NDEBUG
712 #if defined(TARGET_OSX)
713 #include </usr/include/assert.h>
714 #elif !defined(TARGET_WINCE) && !defined(TARGET_PALMOS)
715 #include <assert.h>
716 #else
717 #ifdef LIBC_EXPORTS
718 #define ASSERT_DLL DLLEXPORT
719 #else
720 #define ASSERT_DLL
721 #endif
722 ASSERT_DLL void _Assert(const char* Exp, const char* File, int Line);
723 #define assert(x)   ((x) ? (void)0 : _Assert(#x, __FILE__, __LINE__))
724 #endif
725 #else // NDEBUG
726 #ifndef assert
727 #define assert(x)   ((void)0)
728 #endif
729 #endif // NDEBUG
730 
731 #if defined(__palmos__)
732 #if _MSC_VER > 1000
733 #pragma warning( disable:4068 4204 )
734 #endif
735 #undef BIG_ENDIAN
736 #define USE_TRAPS 0
737 #endif
738 
739 #if defined(COMPILER_GCC) && (!defined(TARGET_SYMBIAN) || defined(SYMBIAN90))
740 #define UNUSED_PARAM(x) (x) __attribute__ ((unused))
741 #elif (defined(TARGET_SYMBIAN) && !defined(ARM)) || defined(__cplusplus)
742 #define UNUSED_PARAM(x)
743 #else
744 #define UNUSED_PARAM(x) (x)
745 #endif
746 
747 #include "config.h"
748 #if defined(COREMAKE_CONFIG_HELPER)
749 #include "config_helper.h"
750 #else /* COREMAKE_CONFIG_HELPER */
751 #include "confhelper.h"
752 #endif /* COREMAKE_CONFIG_HELPER */
753 
754 #if defined(TARGET_IPHONE) && !defined(__ARM_NEON__)
755 #undef CONFIG_NEON
756 #endif
757 
758 #ifdef CONFIG_FILEPOS_64
759 typedef int_fast64_t filepos_t;
760 #define MAX_FILEPOS MAX_INT64
761 #else
762 typedef int_fast32_t filepos_t;
763 #define MAX_FILEPOS INT_MAX
764 #endif
765 
766 #define INVALID_FILEPOS_T  ((filepos_t)-1)
767 
768 typedef int systick_t;
769 #define INVALID_SYSTICK_T  ((int)-1)
770 
771 #if defined(CONFIG_SAFE_C)
772 // change the low level APIs to be safer on windows and other OSes
773 #include "banned.h"
774 #endif /* CONFIG_SAFE_C */
775 
776 #endif
777