summaryrefslogtreecommitdiff
path: root/winsup/cygwin/include/cygwin/types.h
blob: d5173b94b8dd0c00e1435f0011b9522f3960ebeb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
/* types.h

   Copyright 2001, 2002, 2003 Red Hat Inc.
   Written by Robert Collins <rbtcollins@hotmail.com>

This file is part of Cygwin.

This software is a copyrighted work licensed under the terms of the
Cygwin license.  Please consult the file "CYGWIN_LICENSE" for
details. */

#ifdef __cplusplus
extern "C"
{
#endif

#ifndef _CYGWIN_TYPES_H
#define _CYGWIN_TYPES_H

#include <sys/sysmacros.h>

#ifndef __timespec_t_defined
#define __timespec_t_defined
typedef struct timespec timespec_t;
#endif /*__timespec_t_defined*/

#ifndef __timestruc_t_defined
#define __timestruc_t_defined
typedef struct timespec timestruc_t;
#endif /*__timestruc_t_defined*/

#ifndef __off_t_defined
#define __off_t_defined
#ifdef __CYGWIN_USE_BIG_TYPES__
typedef _off64_t off_t;
#else
typedef _off_t off_t;
#endif
#endif /*__off_t_defined*/

#ifndef __dev_t_defined
#define __dev_t_defined
typedef short __dev16_t;
typedef unsigned long __dev32_t;
#ifdef __CYGWIN_USE_BIG_TYPES__
typedef __dev32_t dev_t;
#else
typedef __dev16_t dev_t;
#endif
#endif /*__dev_t_defined*/

#ifndef __blksize_t_defined
#define __blksize_t_defined
typedef long blksize_t;
#endif /*__blksize_t_defined*/

#ifndef __blkcnt_t_defined
#define __blkcnt_t_defined
typedef long __blkcnt32_t;
typedef long long __blkcnt64_t;
#ifdef __CYGWIN_USE_BIG_TYPES__
typedef __blkcnt64_t  blkcnt_t;
#else
typedef __blkcnt32_t  blkcnt_t;
#endif
#endif /*__blkcnt_t_defined*/

#ifndef __uid_t_defined
#define __uid_t_defined
typedef unsigned short __uid16_t;
typedef unsigned long  __uid32_t;
#ifdef __CYGWIN_USE_BIG_TYPES__
typedef __uid32_t uid_t;
#else
typedef __uid16_t uid_t;
#endif
#endif /*__uid_t_defined*/

#ifndef __gid_t_defined
#define __gid_t_defined
typedef unsigned short __gid16_t;
typedef unsigned long  __gid32_t;
#ifdef __CYGWIN_USE_BIG_TYPES__
typedef __gid32_t gid_t;
#else
typedef __gid16_t gid_t;
#endif
#endif /*__gid_t_defined*/

#ifndef __ino_t_defined
#define __ino_t_defined
#ifdef __CYGWIN_USE_BIG_TYPES1__
typedef unsigned long long ino_t;
#else
typedef unsigned long ino_t;
#endif
#endif /*__ino_t_defined*/

#ifndef __BIT_TYPES_DEFINED
#define __BIT_TYPES_DEFINED__ 1

#ifndef __vm_offset_t
#define __vm_offset_t_defined
typedef unsigned long vm_offset_t;
#endif /*__vm_offset_t_defined*/

#ifndef __vm_size_t
#define __vm_size_t_defined
typedef unsigned long vm_size_t;
#endif /*__vm_size_t_defined*/

#ifndef __int8_t_defined
#define __int8_t_defined
typedef char int8_t;
#endif
#ifndef __int16_t_defined
#define __int16_t_defined
typedef __int16_t int16_t;
#endif
#ifndef __int32_t_defined
#define __int32_t_defined
typedef __int32_t int32_t;
#endif
#ifndef __int64_t_defined
#define __int64_t_defined
typedef __int64_t int64_t;
#endif

#ifndef __uint8_t_defined
#define __uint8_t_defined
typedef unsigned char uint8_t;
#endif
#ifndef __uint16_t_defined
#define __uint16_t_defined
typedef __uint16_t uint16_t;
#endif
#ifndef __uint32_t_defined
#define __uint32_t_defined
typedef __uint32_t uint32_t;
#endif
#ifndef __uint64_t_defined
#define __uint64_t_defined
typedef __uint64_t uint64_t;
#endif

#ifndef __u_int8_t_defined
#define __u_int8_t_defined
typedef unsigned char u_int8_t;
#endif
#ifndef __u_int16_t_defined
#define __u_int16_t_defined
typedef __uint16_t u_int16_t;
#endif
#ifndef __u_int32_t_defined
#define __u_int32_t_defined
typedef __uint32_t u_int32_t;
#endif
#ifndef __u_int64_t_defined
#define __u_int64_t_defined
typedef __uint64_t u_int64_t;
#endif

#ifndef __uintptr_t_defined
#define __uintptr_t_defined
typedef unsigned long uintptr_t;
#endif

#ifndef __intptr_t_defined
#define __intptr_t_defined
typedef long intptr_t;
#endif

#ifndef __register_t_defined
#define __register_t_defined
typedef __int32_t register_t;
#endif

#ifndef __addr_t_defined
#define __addr_t_defined
typedef char *addr_t;
#endif

#ifndef __mode_t_defined
#define __mode_t_defined
typedef unsigned mode_t;
#endif
#endif /*__BIT_TYPES_DEFINED*/

#if !defined(__INSIDE_CYGWIN__) || !defined(__cplusplus)

typedef struct __pthread_t {char __dummy;} *pthread_t;
typedef struct __pthread_mutex_t {char __dummy;} *pthread_mutex_t;

typedef struct __pthread_key_t {char __dummy;} *pthread_key_t;
typedef struct __pthread_attr_t {char __dummy;} *pthread_attr_t;
typedef struct __pthread_mutexattr_t {char __dummy;} *pthread_mutexattr_t;
typedef struct __pthread_condattr_t {char __dummy;} *pthread_condattr_t;
typedef struct __pthread_cond_t {char __dummy;} *pthread_cond_t;

  /* These variables are not user alterable. This means you!. */
typedef struct
{
  pthread_mutex_t mutex;
  int state;
}
pthread_once_t;
typedef struct __pthread_rwlock_t {char __dummy;} *pthread_rwlock_t;
typedef struct __pthread_rwlockattr_t {char __dummy;} *pthread_rwlockattr_t;

#else

/* pthreads types */

typedef class pthread *pthread_t;
typedef class pthread_mutex *pthread_mutex_t;
typedef class pthread_key *pthread_key_t;
typedef class pthread_attr *pthread_attr_t;
typedef class pthread_mutexattr *pthread_mutexattr_t;
typedef class pthread_condattr *pthread_condattr_t;
typedef class pthread_cond *pthread_cond_t;
typedef class pthread_once pthread_once_t;
typedef class pthread_rwlock *pthread_rwlock_t;
typedef class pthread_rwlockattr *pthread_rwlockattr_t;

/* semaphores types */
typedef class semaphore *sem_t;
#endif /* __INSIDE_CYGWIN__ */
#endif /* _CYGWIN_TYPES_H */

#ifdef __cplusplus
}
#endif