Changes to attempt to silence bcc64x
[ACE_TAO.git] / ACE / ace / config-mqx.h
blob02bf619bf3a06f43f7397c823554672d7fb2bab0
1 #ifndef CONFIG_MQX_H
2 #define CONFIG_MQX_H
4 // This macro is required in order to build the SOCK_Connector_Test
5 #define ACE_LACKS_GETHOSTENT
7 #if defined(ACE_MQX_DLIB_FULL)
8 # define MQX_SUPPRESS_FILE_DEF 1
9 # define MQX_SUPPRESS_STDIO_MACROS 1
10 #endif
12 #define MQX_STD_TIME_API 0
14 #include <time32.h>
15 #define _SIGNAL
17 #include <mfs.h>
18 #include <rtcs.h>
19 #include <mutex.h>
20 #include <fio.h>
22 // These headers do not have the proper guards for C++
23 extern "C" {
24 // Allowing p_time.h to be included causes conflicts
25 // with time.h
26 #define __p_time_h__
28 #include <sys_types.h>
29 #include <p_pthread.h>
30 #include <p_signal.h>
31 #include <p_semaphore.h>
34 #if MQX_STD_TIME_API == 0
35 # define ACE_LACKS_LOCALTIME_R
36 #endif
38 #if !defined (ACE_DEFAULT_MAP_SIZE)
39 # define ACE_DEFAULT_MAP_SIZE 64
40 #endif /* ACE_DEFAULT_MAP_SIZE */
42 #if !defined (ACE_MAXLOGMSGLEN)
43 # define ACE_MAXLOGMSGLEN 1024
44 #endif /* ACE_MAXLOGMSGLEN */
46 #if !defined (ACE_DEFAULT_ACCEPTOR_USE_SELECT)
47 # define ACE_DEFAULT_ACCEPTOR_USE_SELECT 0
48 #endif /* ACE_DEFAULT_ACCEPTOR_USE_SELECT */
50 #define ACE_CHDIR_EQUIVALENT MQX_Filesystem::inst().chdir
51 #define ACE_RMDIR_EQUIVALENT MQX_Filesystem::inst().rmdir
52 #define ACE_GETCWD_EQUIVALENT MQX_Filesystem::inst().getcwd
53 #define ACE_UNLINK_EQUIVALENT MQX_Filesystem::inst().unlink
54 #define ACE_MKDIR_EQUIVALENT MQX_Filesystem::inst().mkdir
55 #define ACE_RENAME_EQUIVALENT MQX_Filesystem::inst().rename
57 #define ACE_MQX
58 #define ACE_PAGE_SIZE 4096
59 #define ACE_SOCKET_LEN uint16_t
60 #define ACE_SOCKOPT_LEN socklen_t
61 typedef int SOCKET;
63 #define ACE_UNUSED_ARG(X)
65 // Add a check for null pointer before calling free(). This is not
66 // completely necessary, but MQX will set a task error of MQX_INVALID_POINTER
67 // if we call free with a null pointer.
68 #define ACE_FREE_FUNC(X) if ((X) != 0) ::free(X)
70 #define ACE_USES_SOCKET_H
72 #define ACE_LACKS_SIGINFO_H
73 #define ACE_LACKS_NEW_H
74 #define ACE_LACKS_UNISTD_H
75 #define ACE_LACKS_FCNTL_H
76 #define ACE_LACKS_UCONTEXT_H
77 #define ACE_LACKS_SEARCH_H
78 #define ACE_LACKS_PWD_H
79 #define ACE_LACKS_PTHREAD_H
80 #define ACE_LACKS_SCHED_H
81 #define ACE_LACKS_SEMAPHORE_H
82 #define ACE_LACKS_STROPTS_H
83 #define ACE_LACKS_DLFCN_H
84 #define ACE_LACKS_NETDB_H
85 #define ACE_LACKS_DIRENT_H
86 #define ACE_LACKS_STRINGS_H
87 #define ACE_LACKS_SYSLOG_H
88 #define ACE_LACKS_POLL_H
89 #define ACE_LACKS_REGEX_H
91 #define ACE_LACKS_SYS_TYPES_H
92 #define ACE_LACKS_SYS_STAT_H
93 #define ACE_LACKS_SYS_PARAM_H
94 #define ACE_LACKS_SYS_TIME_H
95 #define ACE_LACKS_SYS_RESOURCE_H
96 #define ACE_LACKS_SYS_WAIT_H
97 #define ACE_LACKS_SYS_UTSNAME_H
98 #define ACE_LACKS_SYS_MMAN_H
99 #define ACE_LACKS_SYS_IPC_H
100 #define ACE_LACKS_SYS_SEM_H
101 #define ACE_LACKS_SYS_UIO_H
102 #define ACE_LACKS_SYS_SOCKET_H
103 #define ACE_LACKS_SYS_IOCTL_H
104 #define ACE_LACKS_SYS_SELECT_H
105 #define ACE_LACKS_SYS_UN_H
106 #define ACE_LACKS_SYS_MSG_H
107 #define ACE_LACKS_SYS_SHM_H
108 #define ACE_LACKS_SYS_SYSCTL_H
110 #define ACE_LACKS_NETINET_IN_H
111 #define ACE_LACKS_NETINET_TCP_H
112 #define ACE_LACKS_NET_IF_H
113 #define ACE_LACKS_ARPA_INET_H
115 #define ACE_HAS_THREADS
116 #define ACE_HAS_PTHREADS
117 #define ACE_LACKS_COND_T
118 #define ACE_LACKS_RWLOCK_T
119 #define ACE_MT_SAFE 1
120 #define ACE_LACKS_SIGPROCMASK
121 #define ACE_LACKS_CONDATTR
122 #define ACE_LACKS_PTHREAD_CLEANUP
123 #define ACE_HAS_SIGINFO_T
124 #define ACE_HAS_POSIX_SEM
125 #define ACE_HAS_POSIX_SEM_TIMEOUT
126 #define ACE_LACKS_PTHREAD_CANCEL
127 #define ACE_HAS_CONSISTENT_SIGNAL_PROTOTYPES
128 #define ACE_HAS_THREAD_SPECIFIC_STORAGE
129 #define ACE_LACKS_NAMED_POSIX_SEM
130 #define ACE_DEFAULT_SEM_KEY { 1234 }
131 // MQX POSIX has this, but it doesn't appear to work
132 #define ACE_LACKS_SETINHERITSCHED
133 typedef pthread_mutex_t ACE_mutex_t;
134 typedef pthread_mutexattr_t ACE_mutexattr_t;
136 #if !defined(ACE_MQX_DLIB_FULL)
137 #define ACE_LACKS_FGETWC
138 #define ACE_LACKS_FGETWS
139 #define ACE_LACKS_FPUTWS
140 #define ACE_LACKS_FGETPOS
141 #define ACE_LACKS_FSETPOS
142 #define ACE_LACKS_FREOPEN
143 #define ACE_LACKS_FDOPEN
144 #define ACE_LACKS_FILENO
145 #define ACE_LACKS_LOCALECONV
147 #define BUFSIZ 512
149 #undef ungetc
150 #undef sscanf
151 #undef snprintf
152 #undef vsnprintf
153 #undef getchar
154 #undef putchar
155 #undef status
157 #define getc(X) _io_fgetc(X)
158 #define ungetc(X,Y) _io_fungetc(X,Y)
160 #ifdef fgetc
161 #undef fgetc
162 inline int fgetc(FILE* f) {
163 return _io_fgetc(f);
165 #endif
166 #ifdef fread
167 #undef fread
168 inline size_t fread(void* ptr, size_t so, size_t no,FILE* f) {
169 return (_io_read((f),(ptr),(so)*(no))/(so));
171 #endif
172 #ifdef fwrite
173 #undef fwrite
174 inline size_t fwrite(const void* ptr, size_t so, size_t no, FILE* f) {
175 return (_io_write((f),(void*)(ptr),(so)*(no))/(so));
177 #endif
178 #ifdef puts
179 #undef puts
180 #define def_puts
181 #endif
182 #ifdef getline
183 #undef getline
184 inline int getline(char* x, int y) {
185 return _io_fgetline(stdin, x, y);
187 #endif
188 #ifdef read
189 #undef read
190 inline int read(FILE* f, const void* b, int a) {
191 return _io_read(f, (void*)b, a);
193 #endif
194 #ifdef write
195 #undef write
196 inline int write(FILE* f, void* b, int a) {
197 return _io_write(f, b, a);
199 #endif
200 #ifdef printf
201 #undef printf
202 #define def_printf
203 #endif
204 #ifdef sprintf
205 #undef sprintf
206 #define def_sprintf
207 #endif
208 #ifdef fprintf
209 #undef fprintf
210 inline int fprintf(FILE* s, const char* f, ...) {
211 va_list argp;
212 va_start(argp, f);
213 const int r = _io_vfprintf(s, f, argp);
214 va_end (argp);
215 return r;
217 #endif
218 #ifdef vprintf
219 #undef vprintf
220 #define def_vprintf
221 #endif
222 #ifdef vsprintf
223 #undef vsprintf
224 #define def_vsprintf
225 #endif
226 #ifdef vfprintf
227 #undef vfprintf
228 inline int vfprintf(FILE* s, const char* f, va_list argp) {
229 return _io_vfprintf(s, f, argp);
231 #endif
232 #ifdef fclose
233 #undef fclose
234 inline int fclose(FILE* f) {
235 return _io_fclose(f);
237 #endif
238 #ifdef fflush
239 #undef fflush
240 inline int fflush(FILE* f) {
241 return _io_fflush(f);
243 #endif
244 #ifdef fgets
245 #undef fgets
246 inline char* fgets(char* b, int a, FILE* f) {
247 return _io_fgets(b, a, f);
249 #endif
250 #ifdef fputs
251 #undef fputs
252 inline int fputs(const char* s, FILE* f) {
253 return _io_fputs(s, f);
255 #endif
256 #ifdef fopen
257 #undef fopen
258 inline FILE* fopen(const char* f, const char* m) {
259 return _io_fopen(f, m);
261 #endif
262 #ifdef fseek
263 #undef fseek
264 inline int fseek(FILE* f, long o, int s) {
265 return _io_fseek(f, o, s);
267 #endif
268 #ifdef ftell
269 #undef ftell
270 inline int ftell(FILE* f) {
271 return _io_ftell(f);
273 #endif
274 #ifdef ioctl
275 #undef ioctl
276 inline int ioctl(FILE* f, unsigned int r, void* p)
278 return _io_ioctl(f, r, p);
280 #endif
282 #include <stdio.h>
284 #ifdef def_printf
285 #undef def_printf
286 inline int printf(const char* f, ...) {
287 va_list argp;
288 va_start(argp, f);
289 const int r = _io_vprintf(f, argp);
290 va_end (argp);
291 return r;
293 #endif
294 #ifdef def_sprintf
295 #undef def_sprintf
296 inline int sprintf(char* s, const char* f, ...) {
297 va_list argp;
298 va_start(argp, f);
299 const int r = _io_vsprintf(s, f, argp);
300 va_end (argp);
301 return r;
303 #endif
304 #ifdef def_vprintf
305 #undef def_vprintf
306 inline int vprintf(const char* f, va_list argp) {
307 return _io_vprintf(f, argp);
309 #endif
310 #ifdef def_vsprintf
311 #undef def_vsprintf
312 inline int vsprintf(char* s, const char* f, va_list argp) {
313 return _io_vsprintf(s, f, argp);
315 #endif
316 #ifdef def_puts
317 #undef def_puts
318 inline int puts(const char* str) {
319 return _io_fputs(str, stdout);
321 #endif
322 #endif
324 #define ACE_HAS_LINGER_MS
325 #define ACE_HAS_WCHAR
326 #define ACE_SIZEOF_WCHAR 4
327 #define ACE_HAS_SSIZE_T
328 #define ACE_HAS_SIG_ATOMIC_T
329 #define ACE_HAS_POSIX_TIME
330 #define ACE_HAS_SOCKLEN_T
331 #define ACE_HAS_DIRENT
333 #define ACE_TEXT_WIN32_FIND_DATA MFS_SEARCH_DATA
335 #define ACE_LACKS_UNIX_SIGNALS
336 #define ACE_LACKS_SO_DONTROUTE
337 #define ACE_LACKS_WCSDUP
338 #define ACE_LACKS_WCSTOK
339 #define ACE_LACKS_ITOW
340 #define ACE_LACKS_WCSICMP
341 #define ACE_LACKS_WCSNICMP
342 #define ACE_LACKS_INET_NTOA
343 #define ACE_LACKS_RAND_R
344 #define ACE_LACKS_PUTENV
345 #define ACE_LACKS_PWD_FUNCTIONS
346 #define ACE_LACKS_SETSID
347 #define ACE_LACKS_SETGID
348 #define ACE_LACKS_GETEGID
349 #define ACE_LACKS_GETGID
350 #define ACE_LACKS_GETEUID
351 #define ACE_LACKS_SETEGID
352 #define ACE_LACKS_SETEUID
353 #define ACE_LACKS_SETREUID
354 #define ACE_LACKS_SETREGID
355 #define ACE_LACKS_SETUID
356 #define ACE_LACKS_GETUID
357 #define ACE_LACKS_GETPGID
358 #define ACE_LACKS_SETPGID
359 #define ACE_LACKS_GETPPID
360 #define ACE_LACKS_GETPID
361 #define ACE_LACKS_EXEC
362 #define ACE_LACKS_FORK
363 #define ACE_LACKS_GETOPT
364 #define ACE_LACKS_SBRK
365 #define ACE_LACKS_PIPE
366 #define ACE_DISABLE_NOTIFY_PIPE_DEFAULT 1
367 #define ACE_LACKS_ISATTY
368 #define ACE_LACKS_ALARM
369 #define ACE_LACKS_SYSCONF
370 #define ACE_LACKS_SWAB
371 #define ACE_LACKS_CADDR_T
372 #define ACE_LACKS_SETENV
373 #define ACE_LACKS_UNSETENV
374 #define ACE_LACKS_CUSERID
375 #define ACE_LACKS_MADVISE
376 #define ACE_LACKS_MMAP
377 #define ACE_LACKS_MPROTECT
378 #define ACE_LACKS_MSYNC
379 #define ACE_LACKS_MUNMAP
380 #define ACE_LACKS_STRPTIME
381 #define ACE_LACKS_GMTIME_R
382 #define ACE_LACKS_ASCTIME_R
383 #define ACE_LACKS_TZSET
384 #define ACE_LACKS_IOVEC
385 #define ACE_LACKS_ISASCII
386 #define ACE_LACKS_ISCTYPE
387 #define ACE_LACKS_READV
388 #define ACE_LACKS_WRITEV
389 #define ACE_LACKS_RECVMSG
390 #define ACE_LACKS_SENDMSG
391 #define ACE_LACKS_SOCKETPAIR
392 #define ACE_LACKS_GETHOSTBYADDR
393 #define ACE_LACKS_GETHOSTBYADDR_R
394 #define ACE_LACKS_GETHOSTBYNAME
395 #define ACE_LACKS_GETSERVBYNAME
396 #define ACE_LACKS_GETSERVBYNAME_R
397 #define ACE_LACKS_GAI_STRERROR
398 #define ACE_LACKS_GETPROTOBYNUMBER
399 #define ACE_LACKS_GETPROTOBYNUMBER_R
400 #define ACE_LACKS_GETPROTOBYNAME
401 #define ACE_LACKS_GETPROTOBYNAME_R
402 #define ACE_LACKS_STRUCT_DIR
403 #define ACE_LACKS_HOSTENT
404 #define ACE_LACKS_PROTOENT
405 #define ACE_LACKS_SERVENT
406 #define ACE_LACKS_RLIMIT
407 #define ACE_LACKS_WAIT
408 #define ACE_LACKS_WAITPID
409 #define ACE_LACKS_SIGEMPTYSET
410 #define ACE_LACKS_SIGADDSET
411 #define ACE_LACKS_IOSTREAM_TOTALLY
412 #define ACE_LACKS_ACE_IOSTREAM
413 #define ACE_LACKS_UNIX_SYSLOG
414 #define ACE_LACKS_UNAME
415 #define ACE_LACKS_IFCONF
416 #define ACE_LACKS_IFREQ
417 #define ACE_LACKS_STRRECVFD
418 #define ACE_MKDIR_LACKS_MODE
420 // POSIX
421 #define ACE_LACKS_SEMBUF_T
422 #define ACE_LACKS_UNIX_DOMAIN_SOCKETS
423 #define ACE_LACKS_KILL
424 #define NSIG 64
425 #define FD_SETSIZE RTCSCFG_FD_SETSIZE
426 #define FD_SET RTCS_FD_SET
427 #define FD_CLR RTCS_FD_CLR
428 #define FD_ZERO RTCS_FD_ZERO
429 #define FD_ISSET RTCS_FD_ISSET
430 #define NFDBITS (sizeof (fd_mask) * 8)
431 typedef long fd_mask;
432 struct fd_set: public rtcs_fd_set {
433 fd_set()
434 : fds_bits(fd_array) {
436 uint32_t* fds_bits;
439 // File System Related
440 #define ACE_LACKS_MKTEMP
441 #define ACE_LACKS_MKSTEMP
442 #define ACE_LACKS_ACCESS
443 #define ACE_LACKS_REALPATH
444 #define ACE_LACKS_LSTAT
445 #define ACE_LACKS_MKFIFO
446 #define ACE_LACKS_UMASK
447 #define ACE_LACKS_DUP
448 #define ACE_LACKS_DUP2
449 #define ACE_LACKS_FSYNC
450 #define ACE_LACKS_FTRUNCATE
451 #define ACE_LACKS_READLINK
452 #define ACE_LACKS_TRUNCATE
453 #define ACE_LACKS_TEMPNAM
454 #define ACE_LACKS_FCNTL
455 #define ACE_LACKS_REWINDDIR
456 #define ACE_LACKS_OPENDIR
457 #define ACE_LACKS_READDIR
458 #define ACE_LACKS_SEEKDIR
459 #define ACE_LACKS_TELLDIR
460 #define ACE_LACKS_CLOSEDIR
461 #define ACE_LACKS_ALPHASORT
463 #define ACE_DEFINE_MISSING_ERRNOS
465 #define O_NDELAY 1
467 struct stat
469 long st_size;
470 long st_mtime;
471 long st_mode;
472 long st_nlink;
475 typedef unsigned int uid_t;
476 typedef unsigned int gid_t;
477 typedef long off_t;
478 typedef long loff_t;
479 typedef unsigned int mode_t;
480 typedef struct timespec timespec_t;
482 struct timeval
484 int tv_sec;
485 suseconds_t tv_usec;
488 #define MAXSYMLINKS 1
490 #define FIONBIO 0
492 #define S_IFMT 00170000
493 #define S_IFREG 00100000
494 #define S_IFDIR 00040000
495 #define S_IFCHR 00020000
496 #define ACE_LACKS_MODE_MASKS
498 #define IP_TTL 0
499 #define IP_TOS 0
501 #define ACE_IPPROTO_TCP SOL_TCP
502 #define TCP_NODELAY OPT_NOWAIT
504 #endif