MP4v2

platform.h
1#ifndef MP4V2_PLATFORM_H
2#define MP4V2_PLATFORM_H
3
4/*****************************************************************************/
5
6#include <stddef.h>
7#include <stdio.h>
8#include <stdarg.h>
9#include <stdint.h>
10
11#if defined( _WIN32 ) || defined( __MINGW32__ )
12# if defined( MP4V2_EXPORTS )
13# define MP4V2_EXPORT __declspec(dllexport)
14# elif defined( MP4V2_USE_DLL_IMPORT ) || !defined( MP4V2_USE_STATIC_LIB )
15# define MP4V2_EXPORT __declspec(dllimport)
16# else
17# define MP4V2_EXPORT
18# endif
19#else
20# define MP4V2_EXPORT __attribute__((visibility("default")))
21#endif
22
23#if defined( __GNUC__ )
24# define MP4V2_DEPRECATED __attribute__((deprecated))
25#else
26# define MP4V2_DEPRECATED
27#endif
28
29/******************************************************************************
30 *
31 * TODO-KB: cleanup -- absolutely no need for a C-API to fuss with reserved
32 * C++ keywords. This will involve changing the public interface and current
33 * plan of action:
34 *
35 * typdef enum {
36 * mp4_false,
37 * mp4_true,
38 * } mp4_bool_t;
39 *
40 * followed by updating all public signatures and implementation.
41 */
42
43#ifndef FALSE
44#define FALSE 0
45#endif
46
47#ifndef TRUE
48#define TRUE 1
49#endif
50
51#if !defined( __cplusplus )
52#ifndef bool
53#if SIZEOF_BOOL == 8
54 typedef uint64_t bool;
55#else
56#if SIZEOF_BOOL == 4
57 typedef uint32_t bool;
58#else
59#if SIZEOF_BOOL == 2
60 typedef uint16_t bool;
61#else
62 typedef unsigned char bool;
63#endif
64#endif
65#endif
66#ifndef false
67#define false FALSE
68#endif
69#ifndef true
70#define true TRUE
71#endif
72#endif
73#endif
74
75/*****************************************************************************/
76
77#endif /* MP4V2_PLATFORM_H */