Jack2  1.9.10
systemdeps.h
1 /*
2 Copyright (C) 2004-2012 Grame
3 
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU Lesser General Public License as published by
6 the Free Software Foundation; either version 2.1 of the License, or
7 (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
16 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
17 
18 */
19 
20 #ifndef __jack_systemdeps_h__
21 #define __jack_systemdeps_h__
22 
23 #ifndef POST_PACKED_STRUCTURE
24 
25  #ifdef __GNUC__
26  /* POST_PACKED_STRUCTURE needs to be a macro which
27  expands into a compiler directive. The directive must
28  tell the compiler to arrange the preceding structure
29  declaration so that it is packed on byte-boundaries rather
30  than use the natural alignment of the processor and/or
31  compiler.
32  */
33 
34  #define PRE_PACKED_STRUCTURE
35  #define POST_PACKED_STRUCTURE __attribute__((__packed__))
36 
37  #else
38 
39  #ifdef _MSC_VER
40  #define PRE_PACKED_STRUCTURE1 __pragma(pack(push,1))
41  #define PRE_PACKED_STRUCTURE PRE_PACKED_STRUCTURE1
42  /* PRE_PACKED_STRUCTURE needs to be a macro which
43  expands into a compiler directive. The directive must
44  tell the compiler to arrange the following structure
45  declaration so that it is packed on byte-boundaries rather
46  than use the natural alignment of the processor and/or
47  compiler.
48  */
49  #define POST_PACKED_STRUCTURE ;__pragma(pack(pop))
50  /* and POST_PACKED_STRUCTURE needs to be a macro which
51  restores the packing to its previous setting */
52  #else
53  #define PRE_PACKED_STRUCTURE
54  #define POST_PACKED_STRUCTURE
55  #endif /* _MSC_VER */
56 
57  #endif /* __GNUC__ */
58 
59 #endif
60 
61 #if defined(WIN32) && !defined(__CYGWIN__) && !defined(GNU_WIN32)
62 
63  #include <windows.h>
64 
65  #ifdef _MSC_VER /* Microsoft compiler */
66  #define __inline__ inline
67  #if (!defined(int8_t) && !defined(_STDINT_H))
68  #define __int8_t_defined
69  typedef char int8_t;
70  typedef unsigned char uint8_t;
71  typedef short int16_t;
72  typedef unsigned short uint16_t;
73  typedef long int32_t;
74  typedef unsigned long uint32_t;
75  typedef LONGLONG int64_t;
76  typedef ULONGLONG uint64_t;
77  #endif
78  #elif __MINGW32__ /* MINGW */
79  #include <stdint.h>
80  #include <sys/types.h>
81  #else /* other compilers ...*/
82  #include <inttypes.h>
83  #include <pthread.h>
84  #include <sys/types.h>
85  #endif
86 
87  #if !defined(_PTHREAD_H) && !defined(PTHREAD_WIN32)
88 
92  typedef HANDLE jack_native_thread_t;
93  #else
94  #ifdef PTHREAD_WIN32 // Added by JE - 10-10-2011
95  #include <ptw32/pthread.h> // Makes sure we #include the ptw32 version !
96  #endif
97 
101  typedef pthread_t jack_native_thread_t;
102  #endif
103 
104 #endif /* WIN32 && !__CYGWIN__ && !GNU_WIN32 */
105 
106 #if defined(__APPLE__) || defined(__linux__) || defined(__sun__) || defined(sun) || defined(__unix__) || defined(__CYGWIN__) || defined(GNU_WIN32)
107 
108  #if defined(__CYGWIN__) || defined(GNU_WIN32)
109  #include <stdint.h>
110  #endif
111  #include <inttypes.h>
112  #include <pthread.h>
113  #include <sys/types.h>
114 
119  typedef pthread_t jack_native_thread_t;
120 
121 #endif /* __APPLE__ || __linux__ || __sun__ || sun */
122 
123 #if defined(__arm__)
124  #undef POST_PACKED_STRUCTURE
125  #define POST_PACKED_STRUCTURE
126 #endif /* __arm__ */
127 
128 #endif /* __jack_systemdeps_h__ */

Generated for Jack2 by doxygen 1.8.11