Crudebyte Logo
systemdeps.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2001-2013
3 
4  Developers:
5 
6  Paul Davis
7  Jack O'Quin
8  Steve Harris
9  Rui Nuno Capela
10  Devin Anderson
11  Kai Vehmanen
12  Ian Esten
13  Dmitry Baikov
14  Torben Hohn
15  Rohan Drape
16  Stephane Letz
17  Christian Schoenebeck
18 
19  This program is free software; you can redistribute it and/or modify
20  it under the terms of the GNU Lesser General Public License as published by
21  the Free Software Foundation; either version 2.1 of the License, or
22  (at your option) any later version.
23 
24  This program is distributed in the hope that it will be useful,
25  but WITHOUT ANY WARRANTY; without even the implied warranty of
26  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
27  GNU Lesser General Public License for more details.
28 
29  You should have received a copy of the GNU Lesser General Public License
30  along with this program; if not, write to the Free Software
31  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
32 
33  You are permitted to statically link against a binary version of
34  the JACK library obtained from
35 
36  http://jackaudio.org/downloads/JackiOS-SDK.zip
37 
38  and distribute the resulting application without complying with section 6
39  (requiring recipients of your application to be able to relink against
40  modified versions of libjack).
41 
42  This permission is granted if and ONLY if the resulting application binary
43  issue is intended for execution in any one of the following environments:
44 
45  * Apple Inc. iOS
46 
47  Additional environments may be added to this list in the future.
48  All other terms of the LGPL continue to apply.
49 
50 */
51 
52 #ifndef __jack_systemdeps_h__
53 #define __jack_systemdeps_h__
54 
60 #ifndef POST_PACKED_STRUCTURE
61 
62  #ifdef __GNUC__
63  /* POST_PACKED_STRUCTURE needs to be a macro which
64  expands into a compiler directive. The directive must
65  tell the compiler to arrange the preceding structure
66  declaration so that it is packed on byte-boundaries rather
67  than use the natural alignment of the processor and/or
68  compiler.
69  */
70 
71  #define PRE_PACKED_STRUCTURE
72  #if IS_APPLE_IOS
73  #define POST_PACKED_STRUCTURE
74  #else
75  #define POST_PACKED_STRUCTURE __attribute__((__packed__))
76  #endif
77 
78  #else
79 
80  #ifdef _MSC_VER
81  #define PRE_PACKED_STRUCTURE1 __pragma(pack(push,1))
82  #define PRE_PACKED_STRUCTURE PRE_PACKED_STRUCTURE1
83  /* PRE_PACKED_STRUCTURE needs to be a macro which
84  expands into a compiler directive. The directive must
85  tell the compiler to arrange the following structure
86  declaration so that it is packed on byte-boundaries rather
87  than use the natural alignment of the processor and/or
88  compiler.
89  */
90  #define POST_PACKED_STRUCTURE ;__pragma(pack(pop))
91  /* and POST_PACKED_STRUCTURE needs to be a macro which
92  restores the packing to its previous setting */
93  #else
94  #define PRE_PACKED_STRUCTURE
95  #define POST_PACKED_STRUCTURE
96  #endif /* _MSC_VER */
97 
98  #endif /* __GNUC__ */
99 
100 #endif
101 
102 #if defined(WIN32) && !defined(__CYGWIN__) && !defined(GNU_WIN32)
103 
104  #include <windows.h>
105 
106  #ifdef _MSC_VER /* Microsoft compiler */
107  #define __inline__ inline
108  #if (!defined(int8_t) && !defined(_STDINT_H))
109  #define __int8_t_defined
110  typedef char int8_t;
111  typedef unsigned char uint8_t;
112  typedef short int16_t;
113  typedef unsigned short uint16_t;
114  typedef long int32_t;
115  typedef unsigned long uint32_t;
116  typedef LONGLONG int64_t;
117  typedef ULONGLONG uint64_t;
118  #endif
119  #elif __MINGW32__ /* MINGW */
120  #include <stdint.h>
121  #include <sys/types.h>
122  #else /* other compilers ...*/
123  #include <inttypes.h>
124  #include <pthread.h>
125  #include <sys/types.h>
126  #endif
127 
128  #if !defined(_PTHREAD_H) && !defined(PTHREAD_WIN32)
129 
133  typedef HANDLE jack_native_thread_t;
134  #else
135  #ifdef PTHREAD_WIN32 // Added by JE - 10-10-2011
136  #include <ptw32/pthread.h> // Makes sure we #include the ptw32 version !
137  #endif
138 
142  typedef pthread_t jack_native_thread_t;
143  #endif
144 
145 #endif /* WIN32 && !__CYGWIN__ && !GNU_WIN32 */
146 
147 #if defined(__APPLE__) || defined(__linux__) || defined(__sun__) || defined(sun) || defined(__unix__) || defined(__CYGWIN__) || defined(GNU_WIN32)
148 
149  #if defined(__CYGWIN__) || defined(GNU_WIN32)
150  #include <stdint.h>
151  #endif
152  #include <inttypes.h>
153  #include <pthread.h>
154  #include <sys/types.h>
155 
160  typedef pthread_t jack_native_thread_t;
161 
162 #endif /* __APPLE__ || __linux__ || __sun__ || sun */
163 
164 #if defined(__arm__)
165  #undef POST_PACKED_STRUCTURE
166  #define POST_PACKED_STRUCTURE
167 #endif /* __arm__ */
168 
169 #endif /* __jack_systemdeps_h__ */
DE • EN
Copyright © MMXIII Crudebyte. All rights reserved.

twitter