MP4v2

platform_posix.h
1#ifndef MP4V2_PLATFORM_POSIX_H
2#define MP4V2_PLATFORM_POSIX_H
3
5
6#include "libplatform/config.h"
7
9
10// constant macros are not usually used with C++ so the standard mechanism to
11// activate it is to define before stdint.h
12#ifndef __STDC_CONSTANT_MACROS
13# define __STDC_CONSTANT_MACROS
14#endif
15
16// format macros are not usually used with C++ so the standard mechanism to
17// activate it is to define before inttypes.h
18#ifndef __STDC_FORMAT_MACROS
19# define __STDC_FORMAT_MACROS
20#endif
21
22#ifdef NEED_LFS_ACTIVATION
23# ifndef _LARGEFILE_SOURCE
24# define _LARGEFILE_SOURCE
25# define _FILE_OFFSET_BITS 64
26# endif
27#endif
28
30
31#include "libplatform/platform_base.h"
32#include <inttypes.h>
33#include <stdint.h>
34#include <fcntl.h>
35#include <unistd.h>
36
37#include <mp4v2/mp4v2.h>
38
40
41 namespace mp4v2 { namespace platform {
42 using namespace std;
43
44 using ::int8_t;
45 using ::int16_t;
46 using ::int32_t;
47 using ::int64_t;
48
49 using ::uint8_t;
50 using ::uint16_t;
51 using ::uint32_t;
52 using ::uint64_t;
53}} // namespace mp4v2::platform
54
56
57// ARM seems to require integer instructions operands to have 4-byte alignment
58// so we set this macro to for some int<->string code to manually copy string
59// bytes into an int which aligns it. This is much easier than trying to
60// align pertinent string data (constants) from in text sections.
61#if defined( __arm__ )
62# define MP4V2_INTSTRING_ALIGNMENT 1
63#else
64# undef MP4V2_INTSTRING_ALIGNMENT
65#endif
66
68
69#endif // MP4V2_PLATFORM_POSIX_H