~siretart/ubuntu/utopic/blender/libav10

« back to all changes in this revision

Viewing changes to .pc/0010-fix_FTBFS_on_non-linux_architectures.patch/source/blender/blenlib/BLI_sys_types.h

  • Committer: Reinhard Tartler
  • Date: 2014-05-31 01:47:11 UTC
  • Revision ID: siretart@tauware.de-20140531014711-su4d2dbnumoqguai
unapply patches

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 * ***** BEGIN GPL LICENSE BLOCK *****
3
 
 *
4
 
 * This program is free software; you can redistribute it and/or
5
 
 * modify it under the terms of the GNU General Public License
6
 
 * as published by the Free Software Foundation; either version 2
7
 
 * of the License, or (at your option) any later version.
8
 
 *
9
 
 * This program is distributed in the hope that it will be useful,
10
 
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11
 
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12
 
 * GNU General Public License for more details.
13
 
 *
14
 
 * You should have received a copy of the GNU General Public License
15
 
 * along with this program; if not, write to the Free Software Foundation,
16
 
 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17
 
 *
18
 
 * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
19
 
 * All rights reserved.
20
 
 *
21
 
 * The Original Code is: all of this file.
22
 
 *
23
 
 * Contributor(s): none yet.
24
 
 *
25
 
 * ***** END GPL LICENSE BLOCK *****
26
 
 */
27
 
 
28
 
/** \file BLI_sys_types.h
29
 
 *  \ingroup bli
30
 
 *
31
 
 * A platform-independent definition of [u]intXX_t
32
 
 * Plus the accompanying header include for htonl/ntohl
33
 
 *
34
 
 * This file includes <sys/types.h> to define [u]intXX_t types, where
35
 
 * XX can be 8, 16, 32 or 64. Unfortunately, not all systems have this
36
 
 * file.
37
 
 * - Windows uses __intXX compiler-builtin types. These are signed,
38
 
 *   so we have to flip the signs.
39
 
 * For these rogue platforms, we make the typedefs ourselves.
40
 
 *
41
 
 */
42
 
 
43
 
#ifndef __BLI_SYS_TYPES_H__
44
 
#define __BLI_SYS_TYPES_H__
45
 
 
46
 
#ifdef __cplusplus
47
 
extern "C" {
48
 
#endif
49
 
 
50
 
/* MSVC 2010 and 2012 (>=1600) have stdint.h so we should use this for consistency */
51
 
#if defined(_WIN32) && defined(_MSC_VER) && _MSC_VER <= 1500
52
 
 
53
 
/* The __intXX are built-in types of the visual compiler! So we don't
54
 
 * need to include anything else here. */
55
 
 
56
 
 
57
 
typedef signed __int8 int8_t;
58
 
typedef signed __int16 int16_t;
59
 
typedef signed __int32 int32_t;
60
 
typedef signed __int64 int64_t;
61
 
 
62
 
typedef unsigned __int8 uint8_t;
63
 
typedef unsigned __int16 uint16_t;
64
 
typedef unsigned __int32 uint32_t;
65
 
typedef unsigned __int64 uint64_t;
66
 
 
67
 
#ifndef _INTPTR_T_DEFINED
68
 
#ifdef _WIN64
69
 
typedef __int64 intptr_t;
70
 
#else
71
 
typedef long intptr_t;
72
 
#endif
73
 
#define _INTPTR_T_DEFINED
74
 
#endif
75
 
 
76
 
#ifndef _UINTPTR_T_DEFINED
77
 
#ifdef _WIN64
78
 
typedef unsigned __int64 uintptr_t;
79
 
#else
80
 
typedef unsigned long uintptr_t;
81
 
#endif
82
 
#define _UINTPTR_T_DEFINED
83
 
#endif
84
 
 
85
 
#elif defined(__linux__) || defined(__NetBSD__) || defined(__OpenBSD__)
86
 
 
87
 
/* Linux-i386, Linux-Alpha, Linux-ppc */
88
 
#include <stdint.h>
89
 
 
90
 
/* XXX */
91
 
#ifndef UINT64_MAX
92
 
# define UINT64_MAX     18446744073709551615
93
 
typedef uint8_t u_int8_t;
94
 
typedef uint16_t u_int16_t;
95
 
typedef uint32_t u_int32_t;
96
 
typedef uint64_t u_int64_t;
97
 
#endif
98
 
 
99
 
#elif defined(__APPLE__)
100
 
 
101
 
#include <inttypes.h>
102
 
 
103
 
/* MinGW and MSVC >= 2010 */
104
 
#elif defined(FREE_WINDOWS) || (defined(_MSC_VER) && _MSC_VER >= 1600)
105
 
#include <stdint.h>
106
 
 
107
 
#else
108
 
 
109
 
/* FreeBSD, Solaris */
110
 
#include <sys/types.h>
111
 
 
112
 
#endif /* ifdef platform for types */
113
 
 
114
 
 
115
 
/* note: use of (int, TRUE / FALSE) is deprecated,
116
 
 * use (bool, true / false) instead */
117
 
#ifdef HAVE_STDBOOL_H
118
 
# include <stdbool.h>
119
 
#else
120
 
# ifndef HAVE__BOOL
121
 
#  ifdef __cplusplus
122
 
typedef bool _BLI_Bool;
123
 
#  else
124
 
/* Make sure bool is alays defined with the same size for both C and C++ */
125
 
#   define _BLI_Bool unsigned char
126
 
#  endif
127
 
# else
128
 
#  define _BLI_Bool _Bool
129
 
# endif
130
 
# define bool _BLI_Bool
131
 
# define false 0
132
 
# define true 1
133
 
# define __bool_true_false_are_defined 1
134
 
#endif
135
 
 
136
 
/* remove this when we're ready to remove TRUE/FALSE completely */
137
 
#ifdef WITH_BOOL_COMPAT
138
 
/* interim until all occurrences of these can be updated to stdbool */
139
 
/* XXX Why not use the true/false velues here? */
140
 
# ifndef FALSE
141
 
#   define FALSE 0
142
 
# endif
143
 
 
144
 
# ifndef TRUE
145
 
#   define TRUE 1
146
 
# endif
147
 
#endif
148
 
 
149
 
 
150
 
 
151
 
#ifdef __cplusplus 
152
 
}
153
 
#endif
154
 
 
155
 
#endif /* eof */