1 /* ACC --- Automatic Compiler Configuration
3 This file is part of the lzop file compressor.
5 Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
6 Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
7 Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
8 Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
9 Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
10 Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer
11 Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer
12 Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer
13 Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer
14 Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer
15 Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer
16 Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer
17 Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer
18 Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer
19 Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer
22 lzop and the LZO library are free software; you can redistribute them
23 and/or modify them under the terms of the GNU General Public License as
24 published by the Free Software Foundation; either version 2 of
25 the License, or (at your option) any later version.
27 This program is distributed in the hope that it will be useful,
28 but WITHOUT ANY WARRANTY; without even the implied warranty of
29 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
30 GNU General Public License for more details.
32 You should have received a copy of the GNU General Public License
33 along with this program; see the file COPYING.
34 If not, write to the Free Software Foundation, Inc.,
35 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
37 Markus F.X.J. Oberhumer
38 <markus@oberhumer.com>
39 http://www.oberhumer.com/opensource/lzop/
43 #ifndef __ACC_H_INCLUDED
44 #define __ACC_H_INCLUDED 1
45 #define ACC_VERSION 20101019L
46 #if defined(__CYGWIN32__) && !defined(__CYGWIN__)
47 # define __CYGWIN__ __CYGWIN32__
49 #if defined(__IBMCPP__) && !defined(__IBMC__)
50 # define __IBMC__ __IBMCPP__
52 #if defined(__ICL) && defined(_WIN32) && !defined(__INTEL_COMPILER)
53 # define __INTEL_COMPILER __ICL
55 #if 1 && defined(__INTERIX) && defined(__GNUC__) && !defined(_ALL_SOURCE)
56 # define _ALL_SOURCE 1
58 #if defined(__mips__) && defined(__R5900__)
59 # if !defined(__LONG_MAX__)
60 # define __LONG_MAX__ 9223372036854775807L
63 #if defined(__INTEL_COMPILER) && defined(__linux__)
64 # pragma warning(disable: 193)
66 #if defined(__KEIL__) && defined(__C166__)
67 # pragma warning disable = 322
68 #elif 0 && defined(__C251__)
69 # pragma warning disable = 322
71 #if defined(_MSC_VER) && !defined(__INTEL_COMPILER) && !defined(__MWERKS__)
72 # if (_MSC_VER >= 1300)
73 # pragma warning(disable: 4668)
76 #if defined(__POCC__) && defined(_WIN32)
77 # if (__POCC__ >= 400)
78 # pragma warn(disable: 2216)
81 #if 0 && defined(__WATCOMC__)
82 # if (__WATCOMC__ >= 1050) && (__WATCOMC__ < 1060)
83 # pragma warning 203 9
86 #if defined(__BORLANDC__) && defined(__MSDOS__) && !defined(__FLAT__)
89 #if (ACC_CFG_NO_CONFIG_HEADER)
90 #elif defined(ACC_CFG_CONFIG_HEADER)
91 # include ACC_CFG_CONFIG_HEADER
94 #if (ACC_CFG_NO_LIMITS_H)
95 #elif (ACC_LIBC_NAKED) || (ACC_BROKEN_LIMITS_H)
96 #ifndef __ACC_FALLBACK_LIMITS_H_INCLUDED
97 #define __ACC_FALLBACK_LIMITS_H_INCLUDED 1
103 #ifndef __SCHAR_MAX__
104 #define __SCHAR_MAX__ 127
107 #define __SHRT_MAX__ 32767
110 #define __INT_MAX__ 2147483647
113 #if defined(__alpha__) || defined(_LP64) || defined(__MIPS_PSX2__)
114 #define __LONG_MAX__ 9223372036854775807L
116 #define __LONG_MAX__ 2147483647L
122 #define SCHAR_MIN (-1 - SCHAR_MAX)
123 #define SCHAR_MAX (__SCHAR_MAX__)
124 #define UCHAR_MAX (SCHAR_MAX * 2 + 1)
128 #define SHRT_MIN (-1 - SHRT_MAX)
129 #define SHRT_MAX (__SHRT_MAX__)
130 #if ((__INT_MAX__) == (__SHRT_MAX__))
131 #define USHRT_MAX (SHRT_MAX * 2U + 1U)
133 #define USHRT_MAX (SHRT_MAX * 2 + 1)
138 #define INT_MIN (-1 - INT_MAX)
139 #define INT_MAX (__INT_MAX__)
140 #define UINT_MAX (INT_MAX * 2U + 1U)
144 #define LONG_MIN (-1L - LONG_MAX)
145 #define LONG_MAX ((__LONG_MAX__) + 0L)
146 #define ULONG_MAX (LONG_MAX * 2UL + 1UL)
149 #if defined(__CHAR_UNSIGNED__) || defined(_CHAR_UNSIGNED)
151 #define CHAR_MAX UCHAR_MAX
153 #define CHAR_MIN SCHAR_MIN
154 #define CHAR_MAX SCHAR_MAX
161 #define ACC_0xffffL 0xfffful
162 #define ACC_0xffffffffL 0xfffffffful
164 #define ACC_0xffffL 65535ul
165 #define ACC_0xffffffffL 4294967295ul
167 #if (ACC_0xffffL == ACC_0xffffffffL)
168 # error "your preprocessor is broken 1"
170 #if (16ul * 16384ul != 262144ul)
171 # error "your preprocessor is broken 2"
174 #if (32767 >= 4294967295ul)
175 # error "your preprocessor is broken 3"
177 #if (65535u >= 4294967295ul)
178 # error "your preprocessor is broken 4"
181 #if (UINT_MAX == ACC_0xffffL)
182 #if defined(__ZTC__) && defined(__I86__) && !defined(__OS2__)
186 # if !defined(_MSDOS)
189 #elif 0 && defined(__VERSION) && defined(MB_LEN_MAX)
190 # if (__VERSION == 520) && (MB_LEN_MAX == 1)
191 # if !defined(__AZTEC_C__)
192 # define __AZTEC_C__ __VERSION
194 # if !defined(__DOS__)
200 #if defined(_MSC_VER) && defined(M_I86HM) && (UINT_MAX == ACC_0xffffL)
201 # define ptrdiff_t long
202 # define _PTRDIFF_T_DEFINED 1
204 #if (UINT_MAX == ACC_0xffffL)
205 # undef __ACC_RENAME_A
206 # undef __ACC_RENAME_B
207 # if defined(__AZTEC_C__) && defined(__DOS__)
208 # define __ACC_RENAME_A 1
209 # elif defined(_MSC_VER) && defined(MSDOS)
210 # if (_MSC_VER < 600)
211 # define __ACC_RENAME_A 1
212 # elif (_MSC_VER < 700)
213 # define __ACC_RENAME_B 1
215 # elif defined(__TSC__) && defined(__OS2__)
216 # define __ACC_RENAME_A 1
217 # elif defined(__MSDOS__) && defined(__TURBOC__) && (__TURBOC__ < 0x0410)
218 # define __ACC_RENAME_A 1
219 # elif defined(__PACIFIC__) && defined(DOS)
223 # if !defined(__near)
227 # if defined(__ACC_RENAME_A)
228 # if !defined(__cdecl)
229 # define __cdecl cdecl
234 # if !defined(__huge)
237 # if !defined(__near)
240 # if !defined(__pascal)
241 # define __pascal pascal
243 # if !defined(__huge)
246 # elif defined(__ACC_RENAME_B)
247 # if !defined(__cdecl)
248 # define __cdecl _cdecl
253 # if !defined(__huge)
254 # define __huge _huge
256 # if !defined(__near)
257 # define __near _near
259 # if !defined(__pascal)
260 # define __pascal _pascal
262 # elif (defined(__PUREC__) || defined(__TURBOC__)) && defined(__TOS__)
263 # if !defined(__cdecl)
264 # define __cdecl cdecl
266 # if !defined(__pascal)
267 # define __pascal pascal
270 # undef __ACC_RENAME_A
271 # undef __ACC_RENAME_B
273 #if (UINT_MAX == ACC_0xffffL)
274 #if defined(__AZTEC_C__) && defined(__DOS__)
275 # define ACC_BROKEN_CDECL_ALT_SYNTAX 1
276 #elif defined(_MSC_VER) && defined(MSDOS)
277 # if (_MSC_VER < 600)
278 # define ACC_BROKEN_INTEGRAL_CONSTANTS 1
280 # if (_MSC_VER < 700)
281 # define ACC_BROKEN_INTEGRAL_PROMOTION 1
282 # define ACC_BROKEN_SIZEOF 1
284 #elif defined(__PACIFIC__) && defined(DOS)
285 # define ACC_BROKEN_INTEGRAL_CONSTANTS 1
286 #elif defined(__TURBOC__) && defined(__MSDOS__)
287 # if (__TURBOC__ < 0x0150)
288 # define ACC_BROKEN_CDECL_ALT_SYNTAX 1
289 # define ACC_BROKEN_INTEGRAL_CONSTANTS 1
290 # define ACC_BROKEN_INTEGRAL_PROMOTION 1
292 # if (__TURBOC__ < 0x0200)
293 # define ACC_BROKEN_SIZEOF 1
295 # if (__TURBOC__ < 0x0400) && defined(__cplusplus)
296 # define ACC_BROKEN_CDECL_ALT_SYNTAX 1
298 #elif (defined(__PUREC__) || defined(__TURBOC__)) && defined(__TOS__)
299 # define ACC_BROKEN_CDECL_ALT_SYNTAX 1
300 # define ACC_BROKEN_SIZEOF 1
303 #if defined(__WATCOMC__) && (__WATCOMC__ < 900)
304 # define ACC_BROKEN_INTEGRAL_CONSTANTS 1
306 #if defined(_CRAY) && defined(_CRAY1)
307 # define ACC_BROKEN_SIGNED_RIGHT_SHIFT 1
309 #define ACC_PP_STRINGIZE(x) #x
310 #define ACC_PP_MACRO_EXPAND(x) ACC_PP_STRINGIZE(x)
311 #define ACC_PP_CONCAT2(a,b) a ## b
312 #define ACC_PP_CONCAT3(a,b,c) a ## b ## c
313 #define ACC_PP_CONCAT4(a,b,c,d) a ## b ## c ## d
314 #define ACC_PP_CONCAT5(a,b,c,d,e) a ## b ## c ## d ## e
315 #define ACC_PP_ECONCAT2(a,b) ACC_PP_CONCAT2(a,b)
316 #define ACC_PP_ECONCAT3(a,b,c) ACC_PP_CONCAT3(a,b,c)
317 #define ACC_PP_ECONCAT4(a,b,c,d) ACC_PP_CONCAT4(a,b,c,d)
318 #define ACC_PP_ECONCAT5(a,b,c,d,e) ACC_PP_CONCAT5(a,b,c,d,e)
320 #define ACC_CPP_STRINGIZE(x) #x
321 #define ACC_CPP_MACRO_EXPAND(x) ACC_CPP_STRINGIZE(x)
322 #define ACC_CPP_CONCAT2(a,b) a ## b
323 #define ACC_CPP_CONCAT3(a,b,c) a ## b ## c
324 #define ACC_CPP_CONCAT4(a,b,c,d) a ## b ## c ## d
325 #define ACC_CPP_CONCAT5(a,b,c,d,e) a ## b ## c ## d ## e
326 #define ACC_CPP_ECONCAT2(a,b) ACC_CPP_CONCAT2(a,b)
327 #define ACC_CPP_ECONCAT3(a,b,c) ACC_CPP_CONCAT3(a,b,c)
328 #define ACC_CPP_ECONCAT4(a,b,c,d) ACC_CPP_CONCAT4(a,b,c,d)
329 #define ACC_CPP_ECONCAT5(a,b,c,d,e) ACC_CPP_CONCAT5(a,b,c,d,e)
331 #define __ACC_MASK_GEN(o,b) (((((o) << ((b)-1)) - (o)) << 1) + (o))
332 #if 1 && defined(__cplusplus)
333 # if !defined(__STDC_CONSTANT_MACROS)
334 # define __STDC_CONSTANT_MACROS 1
336 # if !defined(__STDC_LIMIT_MACROS)
337 # define __STDC_LIMIT_MACROS 1
340 #if defined(__cplusplus)
341 # define ACC_EXTERN_C extern "C"
343 # define ACC_EXTERN_C extern
345 #if !defined(__ACC_OS_OVERRIDE)
346 #if (ACC_OS_FREESTANDING)
347 # define ACC_INFO_OS "freestanding"
348 #elif (ACC_OS_EMBEDDED)
349 # define ACC_INFO_OS "embedded"
350 #elif 1 && defined(__IAR_SYSTEMS_ICC__)
351 # define ACC_OS_EMBEDDED 1
352 # define ACC_INFO_OS "embedded"
353 #elif defined(__CYGWIN__) && defined(__GNUC__)
354 # define ACC_OS_CYGWIN 1
355 # define ACC_INFO_OS "cygwin"
356 #elif defined(__EMX__) && defined(__GNUC__)
357 # define ACC_OS_EMX 1
358 # define ACC_INFO_OS "emx"
359 #elif defined(__BEOS__)
360 # define ACC_OS_BEOS 1
361 # define ACC_INFO_OS "beos"
362 #elif defined(__Lynx__)
363 # define ACC_OS_LYNXOS 1
364 # define ACC_INFO_OS "lynxos"
365 #elif defined(__OS400__)
366 # define ACC_OS_OS400 1
367 # define ACC_INFO_OS "os400"
368 #elif defined(__QNX__)
369 # define ACC_OS_QNX 1
370 # define ACC_INFO_OS "qnx"
371 #elif defined(__BORLANDC__) && defined(__DPMI32__) && (__BORLANDC__ >= 0x0460)
372 # define ACC_OS_DOS32 1
373 # define ACC_INFO_OS "dos32"
374 #elif defined(__BORLANDC__) && defined(__DPMI16__)
375 # define ACC_OS_DOS16 1
376 # define ACC_INFO_OS "dos16"
377 #elif defined(__ZTC__) && defined(DOS386)
378 # define ACC_OS_DOS32 1
379 # define ACC_INFO_OS "dos32"
380 #elif defined(__OS2__) || defined(__OS2V2__)
381 # if (UINT_MAX == ACC_0xffffL)
382 # define ACC_OS_OS216 1
383 # define ACC_INFO_OS "os216"
384 # elif (UINT_MAX == ACC_0xffffffffL)
385 # define ACC_OS_OS2 1
386 # define ACC_INFO_OS "os2"
388 # error "check your limits.h header"
390 #elif defined(__WIN64__) || defined(_WIN64) || defined(WIN64)
391 # define ACC_OS_WIN64 1
392 # define ACC_INFO_OS "win64"
393 #elif defined(__WIN32__) || defined(_WIN32) || defined(WIN32) || defined(__WINDOWS_386__)
394 # define ACC_OS_WIN32 1
395 # define ACC_INFO_OS "win32"
396 #elif defined(__MWERKS__) && defined(__INTEL__)
397 # define ACC_OS_WIN32 1
398 # define ACC_INFO_OS "win32"
399 #elif defined(__WINDOWS__) || defined(_WINDOWS) || defined(_Windows)
400 # if (UINT_MAX == ACC_0xffffL)
401 # define ACC_OS_WIN16 1
402 # define ACC_INFO_OS "win16"
403 # elif (UINT_MAX == ACC_0xffffffffL)
404 # define ACC_OS_WIN32 1
405 # define ACC_INFO_OS "win32"
407 # error "check your limits.h header"
409 #elif defined(__DOS__) || defined(__MSDOS__) || defined(_MSDOS) || defined(MSDOS) || (defined(__PACIFIC__) && defined(DOS))
410 # if (UINT_MAX == ACC_0xffffL)
411 # define ACC_OS_DOS16 1
412 # define ACC_INFO_OS "dos16"
413 # elif (UINT_MAX == ACC_0xffffffffL)
414 # define ACC_OS_DOS32 1
415 # define ACC_INFO_OS "dos32"
417 # error "check your limits.h header"
419 #elif defined(__WATCOMC__)
420 # if defined(__NT__) && (UINT_MAX == ACC_0xffffL)
421 # define ACC_OS_DOS16 1
422 # define ACC_INFO_OS "dos16"
423 # elif defined(__NT__) && (__WATCOMC__ < 1100)
424 # define ACC_OS_WIN32 1
425 # define ACC_INFO_OS "win32"
426 # elif defined(__linux__) || defined(__LINUX__)
427 # define ACC_OS_POSIX 1
428 # define ACC_INFO_OS "posix"
430 # error "please specify a target using the -bt compiler option"
432 #elif defined(__palmos__)
433 # define ACC_OS_PALMOS 1
434 # define ACC_INFO_OS "palmos"
435 #elif defined(__TOS__) || defined(__atarist__)
436 # define ACC_OS_TOS 1
437 # define ACC_INFO_OS "tos"
438 #elif defined(macintosh) && !defined(__ppc__)
439 # define ACC_OS_MACCLASSIC 1
440 # define ACC_INFO_OS "macclassic"
442 # define ACC_OS_VMS 1
443 # define ACC_INFO_OS "vms"
444 #elif ((defined(__mips__) && defined(__R5900__)) || defined(__MIPS_PSX2__))
445 # define ACC_OS_CONSOLE 1
446 # define ACC_OS_CONSOLE_PS2 1
447 # define ACC_INFO_OS "console"
448 # define ACC_INFO_OS_CONSOLE "ps2"
449 #elif (defined(__mips__) && defined(__psp__))
450 # define ACC_OS_CONSOLE 1
451 # define ACC_OS_CONSOLE_PSP 1
452 # define ACC_INFO_OS "console"
453 # define ACC_INFO_OS_CONSOLE "psp"
455 # define ACC_OS_POSIX 1
456 # define ACC_INFO_OS "posix"
459 # if defined(_AIX) || defined(__AIX__) || defined(__aix__)
460 # define ACC_OS_POSIX_AIX 1
461 # define ACC_INFO_OS_POSIX "aix"
462 # elif defined(__FreeBSD__)
463 # define ACC_OS_POSIX_FREEBSD 1
464 # define ACC_INFO_OS_POSIX "freebsd"
465 # elif defined(__hpux__) || defined(__hpux)
466 # define ACC_OS_POSIX_HPUX 1
467 # define ACC_INFO_OS_POSIX "hpux"
468 # elif defined(__INTERIX)
469 # define ACC_OS_POSIX_INTERIX 1
470 # define ACC_INFO_OS_POSIX "interix"
471 # elif defined(__IRIX__) || defined(__irix__)
472 # define ACC_OS_POSIX_IRIX 1
473 # define ACC_INFO_OS_POSIX "irix"
474 # elif defined(__linux__) || defined(__linux) || defined(__LINUX__)
475 # define ACC_OS_POSIX_LINUX 1
476 # define ACC_INFO_OS_POSIX "linux"
477 # elif defined(__APPLE__) || defined(__MACOS__)
478 # define ACC_OS_POSIX_MACOSX 1
479 # define ACC_INFO_OS_POSIX "macosx"
480 # elif defined(__minix__) || defined(__minix)
481 # define ACC_OS_POSIX_MINIX 1
482 # define ACC_INFO_OS_POSIX "minix"
483 # elif defined(__NetBSD__)
484 # define ACC_OS_POSIX_NETBSD 1
485 # define ACC_INFO_OS_POSIX "netbsd"
486 # elif defined(__OpenBSD__)
487 # define ACC_OS_POSIX_OPENBSD 1
488 # define ACC_INFO_OS_POSIX "openbsd"
489 # elif defined(__osf__)
490 # define ACC_OS_POSIX_OSF 1
491 # define ACC_INFO_OS_POSIX "osf"
492 # elif defined(__solaris__) || defined(__sun)
493 # if defined(__SVR4) || defined(__svr4__)
494 # define ACC_OS_POSIX_SOLARIS 1
495 # define ACC_INFO_OS_POSIX "solaris"
497 # define ACC_OS_POSIX_SUNOS 1
498 # define ACC_INFO_OS_POSIX "sunos"
500 # elif defined(__ultrix__) || defined(__ultrix)
501 # define ACC_OS_POSIX_ULTRIX 1
502 # define ACC_INFO_OS_POSIX "ultrix"
503 # elif defined(_UNICOS)
504 # define ACC_OS_POSIX_UNICOS 1
505 # define ACC_INFO_OS_POSIX "unicos"
507 # define ACC_OS_POSIX_UNKNOWN 1
508 # define ACC_INFO_OS_POSIX "unknown"
512 #if (ACC_OS_DOS16 || ACC_OS_OS216 || ACC_OS_WIN16)
513 # if (UINT_MAX != ACC_0xffffL)
514 # error "this should not happen"
516 # if (ULONG_MAX != ACC_0xffffffffL)
517 # error "this should not happen"
520 #if (ACC_OS_DOS32 || ACC_OS_OS2 || ACC_OS_WIN32 || ACC_OS_WIN64)
521 # if (UINT_MAX != ACC_0xffffffffL)
522 # error "this should not happen"
524 # if (ULONG_MAX != ACC_0xffffffffL)
525 # error "this should not happen"
528 #if defined(CIL) && defined(_GNUCC) && defined(__GNUC__)
529 # define ACC_CC_CILLY 1
530 # define ACC_INFO_CC "Cilly"
531 # if defined(__CILLY__)
532 # define ACC_INFO_CCVER ACC_PP_MACRO_EXPAND(__CILLY__)
534 # define ACC_INFO_CCVER "unknown"
536 #elif 0 && defined(SDCC) && defined(__VERSION__) && !defined(__GNUC__)
537 # define ACC_CC_SDCC 1
538 # define ACC_INFO_CC "sdcc"
539 # define ACC_INFO_CCVER ACC_PP_MACRO_EXPAND(SDCC)
540 #elif defined(__PATHSCALE__) && defined(__PATHCC_PATCHLEVEL__)
541 # define ACC_CC_PATHSCALE (__PATHCC__ * 0x10000L + __PATHCC_MINOR__ * 0x100 + __PATHCC_PATCHLEVEL__)
542 # define ACC_INFO_CC "Pathscale C"
543 # define ACC_INFO_CCVER __PATHSCALE__
544 #elif defined(__INTEL_COMPILER)
545 # define ACC_CC_INTELC 1
546 # define ACC_INFO_CC "Intel C"
547 # define ACC_INFO_CCVER ACC_PP_MACRO_EXPAND(__INTEL_COMPILER)
548 # if defined(_WIN32) || defined(_WIN64)
549 # define ACC_CC_SYNTAX_MSC 1
551 # define ACC_CC_SYNTAX_GNUC 1
553 #elif defined(__POCC__) && defined(_WIN32)
554 # define ACC_CC_PELLESC 1
555 # define ACC_INFO_CC "Pelles C"
556 # define ACC_INFO_CCVER ACC_PP_MACRO_EXPAND(__POCC__)
557 #elif defined(__clang__) && defined(__llvm__) && defined(__GNUC__) && defined(__GNUC_MINOR__) && defined(__VERSION__)
558 # if defined(__GNUC_PATCHLEVEL__)
559 # define ACC_CC_CLANG_GNUC (__GNUC__ * 0x10000L + __GNUC_MINOR__ * 0x100 + __GNUC_PATCHLEVEL__)
561 # define ACC_CC_CLANG_GNUC (__GNUC__ * 0x10000L + __GNUC_MINOR__ * 0x100)
563 # if defined(__clang_major__) && defined(__clang_minor__) && defined(__clang_patchlevel__)
564 # define ACC_CC_CLANG_CLANG (__clang_major__ * 0x10000L + __clang_minor__ * 0x100 + __clang_patchlevel__)
566 # define ACC_CC_CLANG_CLANG 0x020700L
568 # define ACC_CC_CLANG ACC_CC_CLANG_GNUC
569 # define ACC_INFO_CC "clang"
570 # define ACC_INFO_CCVER __VERSION__
571 #elif defined(__llvm__) && defined(__GNUC__) && defined(__GNUC_MINOR__) && defined(__VERSION__)
572 # if defined(__GNUC_PATCHLEVEL__)
573 # define ACC_CC_LLVM_GNUC (__GNUC__ * 0x10000L + __GNUC_MINOR__ * 0x100 + __GNUC_PATCHLEVEL__)
575 # define ACC_CC_LLVM_GNUC (__GNUC__ * 0x10000L + __GNUC_MINOR__ * 0x100)
577 # define ACC_CC_LLVM ACC_CC_LLVM_GNUC
578 # define ACC_INFO_CC "llvm-gcc"
579 # define ACC_INFO_CCVER __VERSION__
580 #elif defined(__GNUC__) && defined(__VERSION__)
581 # if defined(__GNUC_MINOR__) && defined(__GNUC_PATCHLEVEL__)
582 # define ACC_CC_GNUC (__GNUC__ * 0x10000L + __GNUC_MINOR__ * 0x100 + __GNUC_PATCHLEVEL__)
583 # elif defined(__GNUC_MINOR__)
584 # define ACC_CC_GNUC (__GNUC__ * 0x10000L + __GNUC_MINOR__ * 0x100)
586 # define ACC_CC_GNUC (__GNUC__ * 0x10000L)
588 # define ACC_INFO_CC "gcc"
589 # define ACC_INFO_CCVER __VERSION__
590 #elif defined(__ACK__) && defined(_ACK)
591 # define ACC_CC_ACK 1
592 # define ACC_INFO_CC "Amsterdam Compiler Kit C"
593 # define ACC_INFO_CCVER "unknown"
594 #elif defined(__AZTEC_C__)
595 # define ACC_CC_AZTECC 1
596 # define ACC_INFO_CC "Aztec C"
597 # define ACC_INFO_CCVER ACC_PP_MACRO_EXPAND(__AZTEC_C__)
598 #elif defined(__CODEGEARC__)
599 # define ACC_CC_CODEGEARC 1
600 # define ACC_INFO_CC "CodeGear C"
601 # define ACC_INFO_CCVER ACC_PP_MACRO_EXPAND(__CODEGEARC__)
602 #elif defined(__BORLANDC__)
603 # define ACC_CC_BORLANDC 1
604 # define ACC_INFO_CC "Borland C"
605 # define ACC_INFO_CCVER ACC_PP_MACRO_EXPAND(__BORLANDC__)
606 #elif defined(_CRAYC) && defined(_RELEASE)
607 # define ACC_CC_CRAYC 1
608 # define ACC_INFO_CC "Cray C"
609 # define ACC_INFO_CCVER ACC_PP_MACRO_EXPAND(_RELEASE)
610 #elif defined(__DMC__) && defined(__SC__)
611 # define ACC_CC_DMC 1
612 # define ACC_INFO_CC "Digital Mars C"
613 # define ACC_INFO_CCVER ACC_PP_MACRO_EXPAND(__DMC__)
614 #elif defined(__DECC)
615 # define ACC_CC_DECC 1
616 # define ACC_INFO_CC "DEC C"
617 # define ACC_INFO_CCVER ACC_PP_MACRO_EXPAND(__DECC)
618 #elif defined(__HIGHC__)
619 # define ACC_CC_HIGHC 1
620 # define ACC_INFO_CC "MetaWare High C"
621 # define ACC_INFO_CCVER "unknown"
622 #elif defined(__IAR_SYSTEMS_ICC__)
623 # define ACC_CC_IARC 1
624 # define ACC_INFO_CC "IAR C"
625 # if defined(__VER__)
626 # define ACC_INFO_CCVER ACC_PP_MACRO_EXPAND(__VER__)
628 # define ACC_INFO_CCVER "unknown"
630 #elif defined(__IBMC__)
631 # define ACC_CC_IBMC 1
632 # define ACC_INFO_CC "IBM C"
633 # define ACC_INFO_CCVER ACC_PP_MACRO_EXPAND(__IBMC__)
634 #elif defined(__KEIL__) && defined(__C166__)
635 # define ACC_CC_KEILC 1
636 # define ACC_INFO_CC "Keil C"
637 # define ACC_INFO_CCVER ACC_PP_MACRO_EXPAND(__C166__)
638 #elif defined(__LCC__) && defined(_WIN32) && defined(__LCCOPTIMLEVEL)
639 # define ACC_CC_LCCWIN32 1
640 # define ACC_INFO_CC "lcc-win32"
641 # define ACC_INFO_CCVER "unknown"
642 #elif defined(__LCC__)
643 # define ACC_CC_LCC 1
644 # define ACC_INFO_CC "lcc"
645 # if defined(__LCC_VERSION__)
646 # define ACC_INFO_CCVER ACC_PP_MACRO_EXPAND(__LCC_VERSION__)
648 # define ACC_INFO_CCVER "unknown"
650 #elif defined(_MSC_VER)
651 # define ACC_CC_MSC 1
652 # define ACC_INFO_CC "Microsoft C"
653 # if defined(_MSC_FULL_VER)
654 # define ACC_INFO_CCVER ACC_PP_MACRO_EXPAND(_MSC_VER) "." ACC_PP_MACRO_EXPAND(_MSC_FULL_VER)
656 # define ACC_INFO_CCVER ACC_PP_MACRO_EXPAND(_MSC_VER)
658 #elif defined(__MWERKS__)
659 # define ACC_CC_MWERKS 1
660 # define ACC_INFO_CC "Metrowerks C"
661 # define ACC_INFO_CCVER ACC_PP_MACRO_EXPAND(__MWERKS__)
662 #elif (defined(__NDPC__) || defined(__NDPX__)) && defined(__i386)
663 # define ACC_CC_NDPC 1
664 # define ACC_INFO_CC "Microway NDP C"
665 # define ACC_INFO_CCVER "unknown"
666 #elif defined(__PACIFIC__)
667 # define ACC_CC_PACIFICC 1
668 # define ACC_INFO_CC "Pacific C"
669 # define ACC_INFO_CCVER ACC_PP_MACRO_EXPAND(__PACIFIC__)
670 #elif defined(__PGI) && (defined(__linux__) || defined(__WIN32__))
671 # define ACC_CC_PGI 1
672 # define ACC_INFO_CC "Portland Group PGI C"
673 # define ACC_INFO_CCVER "unknown"
674 #elif defined(__PUREC__) && defined(__TOS__)
675 # define ACC_CC_PUREC 1
676 # define ACC_INFO_CC "Pure C"
677 # define ACC_INFO_CCVER ACC_PP_MACRO_EXPAND(__PUREC__)
678 #elif defined(__SC__) && defined(__ZTC__)
679 # define ACC_CC_SYMANTECC 1
680 # define ACC_INFO_CC "Symantec C"
681 # define ACC_INFO_CCVER ACC_PP_MACRO_EXPAND(__SC__)
682 #elif defined(__SUNPRO_C)
683 # define ACC_INFO_CC "SunPro C"
684 # if ((__SUNPRO_C)+0 > 0)
685 # define ACC_CC_SUNPROC __SUNPRO_C
686 # define ACC_INFO_CCVER ACC_PP_MACRO_EXPAND(__SUNPRO_C)
688 # define ACC_CC_SUNPROC 1
689 # define ACC_INFO_CCVER "unknown"
691 #elif defined(__SUNPRO_CC)
692 # define ACC_INFO_CC "SunPro C"
693 # if ((__SUNPRO_CC)+0 > 0)
694 # define ACC_CC_SUNPROC __SUNPRO_CC
695 # define ACC_INFO_CCVER ACC_PP_MACRO_EXPAND(__SUNPRO_CC)
697 # define ACC_CC_SUNPROC 1
698 # define ACC_INFO_CCVER "unknown"
700 #elif defined(__TINYC__)
701 # define ACC_CC_TINYC 1
702 # define ACC_INFO_CC "Tiny C"
703 # define ACC_INFO_CCVER ACC_PP_MACRO_EXPAND(__TINYC__)
704 #elif defined(__TSC__)
705 # define ACC_CC_TOPSPEEDC 1
706 # define ACC_INFO_CC "TopSpeed C"
707 # define ACC_INFO_CCVER ACC_PP_MACRO_EXPAND(__TSC__)
708 #elif defined(__WATCOMC__)
709 # define ACC_CC_WATCOMC 1
710 # define ACC_INFO_CC "Watcom C"
711 # define ACC_INFO_CCVER ACC_PP_MACRO_EXPAND(__WATCOMC__)
712 #elif defined(__TURBOC__)
713 # define ACC_CC_TURBOC 1
714 # define ACC_INFO_CC "Turbo C"
715 # define ACC_INFO_CCVER ACC_PP_MACRO_EXPAND(__TURBOC__)
716 #elif defined(__ZTC__)
717 # define ACC_CC_ZORTECHC 1
718 # define ACC_INFO_CC "Zortech C"
719 # if (__ZTC__ == 0x310)
720 # define ACC_INFO_CCVER "0x310"
722 # define ACC_INFO_CCVER ACC_PP_MACRO_EXPAND(__ZTC__)
725 # define ACC_CC_UNKNOWN 1
726 # define ACC_INFO_CC "unknown"
727 # define ACC_INFO_CCVER "unknown"
729 #if 0 && (ACC_CC_MSC && (_MSC_VER >= 1200)) && !defined(_MSC_FULL_VER)
730 # error "ACC_CC_MSC: _MSC_FULL_VER is not defined"
732 #if !defined(__ACC_ARCH_OVERRIDE) && !(ACC_ARCH_GENERIC) && defined(_CRAY)
733 # if (UINT_MAX > ACC_0xffffffffL) && defined(_CRAY)
734 # if defined(_CRAYMPP) || defined(_CRAYT3D) || defined(_CRAYT3E)
735 # define ACC_ARCH_CRAY_MPP 1
736 # elif defined(_CRAY1)
737 # define ACC_ARCH_CRAY_PVP 1
741 #if !defined(__ACC_ARCH_OVERRIDE)
742 #if (ACC_ARCH_GENERIC)
743 # define ACC_INFO_ARCH "generic"
744 #elif (ACC_OS_DOS16 || ACC_OS_OS216 || ACC_OS_WIN16)
745 # define ACC_ARCH_I086 1
746 # define ACC_ARCH_IA16 1
747 # define ACC_INFO_ARCH "i086"
748 #elif defined(__alpha__) || defined(__alpha) || defined(_M_ALPHA)
749 # define ACC_ARCH_ALPHA 1
750 # define ACC_INFO_ARCH "alpha"
751 #elif (ACC_ARCH_CRAY_MPP) && (defined(_CRAYT3D) || defined(_CRAYT3E))
752 # define ACC_ARCH_ALPHA 1
753 # define ACC_INFO_ARCH "alpha"
754 #elif defined(__amd64__) || defined(__x86_64__) || defined(_M_AMD64)
755 # define ACC_ARCH_AMD64 1
756 # define ACC_INFO_ARCH "amd64"
757 #elif defined(__thumb__) || (defined(_M_ARM) && defined(_M_THUMB))
758 # define ACC_ARCH_ARM 1
759 # define ACC_ARCH_ARM_THUMB 1
760 # define ACC_INFO_ARCH "arm_thumb"
761 #elif defined(__IAR_SYSTEMS_ICC__) && defined(__ICCARM__)
762 # define ACC_ARCH_ARM 1
763 # if defined(__CPU_MODE__) && ((__CPU_MODE__)+0 == 1)
764 # define ACC_ARCH_ARM_THUMB 1
765 # define ACC_INFO_ARCH "arm_thumb"
766 # elif defined(__CPU_MODE__) && ((__CPU_MODE__)+0 == 2)
767 # define ACC_INFO_ARCH "arm"
769 # define ACC_INFO_ARCH "arm"
771 #elif defined(__arm__) || defined(_M_ARM)
772 # define ACC_ARCH_ARM 1
773 # define ACC_INFO_ARCH "arm"
774 #elif (UINT_MAX <= ACC_0xffffL) && defined(__AVR__)
775 # define ACC_ARCH_AVR 1
776 # define ACC_INFO_ARCH "avr"
777 #elif defined(__avr32__) || defined(__AVR32__)
778 # define ACC_ARCH_AVR32 1
779 # define ACC_INFO_ARCH "avr32"
780 #elif defined(__bfin__)
781 # define ACC_ARCH_BLACKFIN 1
782 # define ACC_INFO_ARCH "blackfin"
783 #elif (UINT_MAX == ACC_0xffffL) && defined(__C166__)
784 # define ACC_ARCH_C166 1
785 # define ACC_INFO_ARCH "c166"
786 #elif defined(__cris__)
787 # define ACC_ARCH_CRIS 1
788 # define ACC_INFO_ARCH "cris"
789 #elif defined(__IAR_SYSTEMS_ICC__) && defined(__ICCEZ80__)
790 # define ACC_ARCH_EZ80 1
791 # define ACC_INFO_ARCH "ez80"
792 #elif defined(__H8300__) || defined(__H8300H__) || defined(__H8300S__) || defined(__H8300SX__)
793 # define ACC_ARCH_H8300 1
794 # define ACC_INFO_ARCH "h8300"
795 #elif defined(__hppa__) || defined(__hppa)
796 # define ACC_ARCH_HPPA 1
797 # define ACC_INFO_ARCH "hppa"
798 #elif defined(__386__) || defined(__i386__) || defined(__i386) || defined(_M_IX86) || defined(_M_I386)
799 # define ACC_ARCH_I386 1
800 # define ACC_ARCH_IA32 1
801 # define ACC_INFO_ARCH "i386"
802 #elif (ACC_CC_ZORTECHC && defined(__I86__))
803 # define ACC_ARCH_I386 1
804 # define ACC_ARCH_IA32 1
805 # define ACC_INFO_ARCH "i386"
806 #elif (ACC_OS_DOS32 && ACC_CC_HIGHC) && defined(_I386)
807 # define ACC_ARCH_I386 1
808 # define ACC_ARCH_IA32 1
809 # define ACC_INFO_ARCH "i386"
810 #elif defined(__ia64__) || defined(__ia64) || defined(_M_IA64)
811 # define ACC_ARCH_IA64 1
812 # define ACC_INFO_ARCH "ia64"
813 #elif (UINT_MAX == ACC_0xffffL) && defined(__m32c__)
814 # define ACC_ARCH_M16C 1
815 # define ACC_INFO_ARCH "m16c"
816 #elif defined(__IAR_SYSTEMS_ICC__) && defined(__ICCM16C__)
817 # define ACC_ARCH_M16C 1
818 # define ACC_INFO_ARCH "m16c"
819 #elif defined(__m32r__)
820 # define ACC_ARCH_M32R 1
821 # define ACC_INFO_ARCH "m32r"
822 #elif (ACC_OS_TOS) || defined(__m68k__) || defined(__m68000__) || defined(__mc68000__) || defined(__mc68020__) || defined(_M_M68K)
823 # define ACC_ARCH_M68K 1
824 # define ACC_INFO_ARCH "m68k"
825 #elif (UINT_MAX == ACC_0xffffL) && defined(__C251__)
826 # define ACC_ARCH_MCS251 1
827 # define ACC_INFO_ARCH "mcs251"
828 #elif (UINT_MAX == ACC_0xffffL) && defined(__C51__)
829 # define ACC_ARCH_MCS51 1
830 # define ACC_INFO_ARCH "mcs51"
831 #elif defined(__IAR_SYSTEMS_ICC__) && defined(__ICC8051__)
832 # define ACC_ARCH_MCS51 1
833 # define ACC_INFO_ARCH "mcs51"
834 #elif defined(__mips__) || defined(__mips) || defined(_MIPS_ARCH) || defined(_M_MRX000)
835 # define ACC_ARCH_MIPS 1
836 # define ACC_INFO_ARCH "mips"
837 #elif (UINT_MAX == ACC_0xffffL) && defined(__MSP430__)
838 # define ACC_ARCH_MSP430 1
839 # define ACC_INFO_ARCH "msp430"
840 #elif defined(__IAR_SYSTEMS_ICC__) && defined(__ICC430__)
841 # define ACC_ARCH_MSP430 1
842 # define ACC_INFO_ARCH "msp430"
843 #elif defined(__powerpc__) || defined(__powerpc) || defined(__ppc__) || defined(__PPC__) || defined(_M_PPC) || defined(_ARCH_PPC) || defined(_ARCH_PWR)
844 # define ACC_ARCH_POWERPC 1
845 # define ACC_INFO_ARCH "powerpc"
846 #elif defined(__s390__) || defined(__s390) || defined(__s390x__) || defined(__s390x)
847 # define ACC_ARCH_S390 1
848 # define ACC_INFO_ARCH "s390"
849 #elif defined(__sh__) || defined(_M_SH)
850 # define ACC_ARCH_SH 1
851 # define ACC_INFO_ARCH "sh"
852 #elif defined(__sparc__) || defined(__sparc) || defined(__sparcv8)
853 # define ACC_ARCH_SPARC 1
854 # define ACC_INFO_ARCH "sparc"
855 #elif defined(__SPU__)
856 # define ACC_ARCH_SPU 1
857 # define ACC_INFO_ARCH "spu"
858 #elif (UINT_MAX == ACC_0xffffL) && defined(__z80)
859 # define ACC_ARCH_Z80 1
860 # define ACC_INFO_ARCH "z80"
861 #elif (ACC_ARCH_CRAY_PVP)
862 # if defined(_CRAYSV1)
863 # define ACC_ARCH_CRAY_SV1 1
864 # define ACC_INFO_ARCH "cray_sv1"
866 # define ACC_ARCH_CRAY_T90 1
867 # define ACC_INFO_ARCH "cray_t90"
869 # define ACC_ARCH_CRAY_YMP 1
870 # define ACC_INFO_ARCH "cray_ymp"
872 # define ACC_ARCH_CRAY_XMP 1
873 # define ACC_INFO_ARCH "cray_xmp"
876 # define ACC_ARCH_UNKNOWN 1
877 # define ACC_INFO_ARCH "unknown"
880 #if 1 && (ACC_ARCH_UNKNOWN) && (ACC_OS_DOS32 || ACC_OS_OS2)
881 # error "FIXME - missing define for CPU architecture"
883 #if 1 && (ACC_ARCH_UNKNOWN) && (ACC_OS_WIN32)
884 # error "FIXME - missing WIN32 define for CPU architecture"
886 #if 1 && (ACC_ARCH_UNKNOWN) && (ACC_OS_WIN64)
887 # error "FIXME - missing WIN64 define for CPU architecture"
889 #if (ACC_OS_OS216 || ACC_OS_WIN16)
890 # define ACC_ARCH_I086PM 1
891 # define ACC_ARCH_IA16PM 1
892 #elif 1 && (ACC_OS_DOS16 && defined(BLX286))
893 # define ACC_ARCH_I086PM 1
894 # define ACC_ARCH_IA16PM 1
895 #elif 1 && (ACC_OS_DOS16 && defined(DOSX286))
896 # define ACC_ARCH_I086PM 1
897 # define ACC_ARCH_IA16PM 1
898 #elif 1 && (ACC_OS_DOS16 && ACC_CC_BORLANDC && defined(__DPMI16__))
899 # define ACC_ARCH_I086PM 1
900 # define ACC_ARCH_IA16PM 1
902 #if (ACC_ARCH_ARM_THUMB) && !(ACC_ARCH_ARM)
903 # error "this should not happen"
905 #if (ACC_ARCH_I086PM) && !(ACC_ARCH_I086)
906 # error "this should not happen"
909 # if (UINT_MAX != ACC_0xffffL)
910 # error "this should not happen"
912 # if (ULONG_MAX != ACC_0xffffffffL)
913 # error "this should not happen"
917 # if (UINT_MAX != ACC_0xffffL) && defined(__i386_int16__)
918 # error "this should not happen"
920 # if (UINT_MAX != ACC_0xffffffffL) && !defined(__i386_int16__)
921 # error "this should not happen"
923 # if (ULONG_MAX != ACC_0xffffffffL)
924 # error "this should not happen"
927 #if !defined(__ACC_MM_OVERRIDE)
929 #if (UINT_MAX != ACC_0xffffL)
930 # error "this should not happen"
932 #if defined(__TINY__) || defined(M_I86TM) || defined(_M_I86TM)
933 # define ACC_MM_TINY 1
934 #elif defined(__HUGE__) || defined(_HUGE_) || defined(M_I86HM) || defined(_M_I86HM)
935 # define ACC_MM_HUGE 1
936 #elif defined(__SMALL__) || defined(M_I86SM) || defined(_M_I86SM) || defined(SMALL_MODEL)
937 # define ACC_MM_SMALL 1
938 #elif defined(__MEDIUM__) || defined(M_I86MM) || defined(_M_I86MM)
939 # define ACC_MM_MEDIUM 1
940 #elif defined(__COMPACT__) || defined(M_I86CM) || defined(_M_I86CM)
941 # define ACC_MM_COMPACT 1
942 #elif defined(__LARGE__) || defined(M_I86LM) || defined(_M_I86LM) || defined(LARGE_MODEL)
943 # define ACC_MM_LARGE 1
944 #elif (ACC_CC_AZTECC)
945 # if defined(_LARGE_CODE) && defined(_LARGE_DATA)
946 # define ACC_MM_LARGE 1
947 # elif defined(_LARGE_CODE)
948 # define ACC_MM_MEDIUM 1
949 # elif defined(_LARGE_DATA)
950 # define ACC_MM_COMPACT 1
952 # define ACC_MM_SMALL 1
954 #elif (ACC_CC_ZORTECHC && defined(__VCM__))
955 # define ACC_MM_LARGE 1
957 # error "unknown memory model"
959 #if (ACC_OS_DOS16 || ACC_OS_OS216 || ACC_OS_WIN16)
960 #define ACC_HAVE_MM_HUGE_PTR 1
961 #define ACC_HAVE_MM_HUGE_ARRAY 1
963 # undef ACC_HAVE_MM_HUGE_ARRAY
965 #if (ACC_CC_AZTECC || ACC_CC_PACIFICC || ACC_CC_ZORTECHC)
966 # undef ACC_HAVE_MM_HUGE_PTR
967 # undef ACC_HAVE_MM_HUGE_ARRAY
968 #elif (ACC_CC_DMC || ACC_CC_SYMANTECC)
969 # undef ACC_HAVE_MM_HUGE_ARRAY
970 #elif (ACC_CC_MSC && defined(_QC))
971 # undef ACC_HAVE_MM_HUGE_ARRAY
972 # if (_MSC_VER < 600)
973 # undef ACC_HAVE_MM_HUGE_PTR
975 #elif (ACC_CC_TURBOC && (__TURBOC__ < 0x0295))
976 # undef ACC_HAVE_MM_HUGE_ARRAY
978 #if (ACC_ARCH_I086PM) && !(ACC_HAVE_MM_HUGE_PTR)
980 # error "this should not happen"
981 # elif (ACC_CC_ZORTECHC)
983 # error "this should not happen"
989 #if (ACC_CC_BORLANDC && (__BORLANDC__ >= 0x0200))
990 extern void __near __cdecl _AHSHIFT(void);
991 # define ACC_MM_AHSHIFT ((unsigned) _AHSHIFT)
992 #elif (ACC_CC_DMC || ACC_CC_SYMANTECC || ACC_CC_ZORTECHC)
993 extern void __near __cdecl _AHSHIFT(void);
994 # define ACC_MM_AHSHIFT ((unsigned) _AHSHIFT)
995 #elif (ACC_CC_MSC || ACC_CC_TOPSPEEDC)
996 extern void __near __cdecl _AHSHIFT(void);
997 # define ACC_MM_AHSHIFT ((unsigned) _AHSHIFT)
998 #elif (ACC_CC_TURBOC && (__TURBOC__ >= 0x0295))
999 extern void __near __cdecl _AHSHIFT(void);
1000 # define ACC_MM_AHSHIFT ((unsigned) _AHSHIFT)
1001 #elif ((ACC_CC_AZTECC || ACC_CC_PACIFICC || ACC_CC_TURBOC) && ACC_OS_DOS16)
1002 # define ACC_MM_AHSHIFT 12
1003 #elif (ACC_CC_WATCOMC)
1004 extern unsigned char _HShift;
1005 # define ACC_MM_AHSHIFT ((unsigned) _HShift)
1007 # error "FIXME - implement ACC_MM_AHSHIFT"
1013 #elif (ACC_ARCH_C166)
1014 #if !defined(__MODEL__)
1015 # error "FIXME - C166 __MODEL__"
1016 #elif ((__MODEL__) == 0)
1017 # define ACC_MM_SMALL 1
1018 #elif ((__MODEL__) == 1)
1019 # define ACC_MM_SMALL 1
1020 #elif ((__MODEL__) == 2)
1021 # define ACC_MM_LARGE 1
1022 #elif ((__MODEL__) == 3)
1023 # define ACC_MM_TINY 1
1024 #elif ((__MODEL__) == 4)
1025 # define ACC_MM_XTINY 1
1026 #elif ((__MODEL__) == 5)
1027 # define ACC_MM_XSMALL 1
1029 # error "FIXME - C166 __MODEL__"
1031 #elif (ACC_ARCH_MCS251)
1032 #if !defined(__MODEL__)
1033 # error "FIXME - MCS251 __MODEL__"
1034 #elif ((__MODEL__) == 0)
1035 # define ACC_MM_SMALL 1
1036 #elif ((__MODEL__) == 2)
1037 # define ACC_MM_LARGE 1
1038 #elif ((__MODEL__) == 3)
1039 # define ACC_MM_TINY 1
1040 #elif ((__MODEL__) == 4)
1041 # define ACC_MM_XTINY 1
1042 #elif ((__MODEL__) == 5)
1043 # define ACC_MM_XSMALL 1
1045 # error "FIXME - MCS251 __MODEL__"
1047 #elif (ACC_ARCH_MCS51)
1048 #if !defined(__MODEL__)
1049 # error "FIXME - MCS51 __MODEL__"
1050 #elif ((__MODEL__) == 1)
1051 # define ACC_MM_SMALL 1
1052 #elif ((__MODEL__) == 2)
1053 # define ACC_MM_LARGE 1
1054 #elif ((__MODEL__) == 3)
1055 # define ACC_MM_TINY 1
1056 #elif ((__MODEL__) == 4)
1057 # define ACC_MM_XTINY 1
1058 #elif ((__MODEL__) == 5)
1059 # define ACC_MM_XSMALL 1
1061 # error "FIXME - MCS51 __MODEL__"
1063 #elif (ACC_ARCH_CRAY_PVP)
1064 # define ACC_MM_PVP 1
1066 # define ACC_MM_FLAT 1
1068 #if (ACC_MM_COMPACT)
1069 # define ACC_INFO_MM "compact"
1071 # define ACC_INFO_MM "flat"
1073 # define ACC_INFO_MM "huge"
1074 #elif (ACC_MM_LARGE)
1075 # define ACC_INFO_MM "large"
1076 #elif (ACC_MM_MEDIUM)
1077 # define ACC_INFO_MM "medium"
1079 # define ACC_INFO_MM "pvp"
1080 #elif (ACC_MM_SMALL)
1081 # define ACC_INFO_MM "small"
1083 # define ACC_INFO_MM "tiny"
1085 # error "unknown memory model"
1088 #if defined(SIZEOF_SHORT)
1089 # define ACC_SIZEOF_SHORT (SIZEOF_SHORT)
1091 #if defined(SIZEOF_INT)
1092 # define ACC_SIZEOF_INT (SIZEOF_INT)
1094 #if defined(SIZEOF_LONG)
1095 # define ACC_SIZEOF_LONG (SIZEOF_LONG)
1097 #if defined(SIZEOF_LONG_LONG)
1098 # define ACC_SIZEOF_LONG_LONG (SIZEOF_LONG_LONG)
1100 #if defined(SIZEOF___INT16)
1101 # define ACC_SIZEOF___INT16 (SIZEOF___INT16)
1103 #if defined(SIZEOF___INT32)
1104 # define ACC_SIZEOF___INT32 (SIZEOF___INT32)
1106 #if defined(SIZEOF___INT64)
1107 # define ACC_SIZEOF___INT64 (SIZEOF___INT64)
1109 #if defined(SIZEOF_VOID_P)
1110 # define ACC_SIZEOF_VOID_P (SIZEOF_VOID_P)
1112 #if defined(SIZEOF_SIZE_T)
1113 # define ACC_SIZEOF_SIZE_T (SIZEOF_SIZE_T)
1115 #if defined(SIZEOF_PTRDIFF_T)
1116 # define ACC_SIZEOF_PTRDIFF_T (SIZEOF_PTRDIFF_T)
1118 #define __ACC_LSR(x,b) (((x)+0ul) >> (b))
1119 #if !defined(ACC_SIZEOF_SHORT)
1120 # if (ACC_ARCH_CRAY_PVP)
1121 # define ACC_SIZEOF_SHORT 8
1122 # elif (USHRT_MAX == ACC_0xffffL)
1123 # define ACC_SIZEOF_SHORT 2
1124 # elif (__ACC_LSR(USHRT_MAX,7) == 1)
1125 # define ACC_SIZEOF_SHORT 1
1126 # elif (__ACC_LSR(USHRT_MAX,15) == 1)
1127 # define ACC_SIZEOF_SHORT 2
1128 # elif (__ACC_LSR(USHRT_MAX,31) == 1)
1129 # define ACC_SIZEOF_SHORT 4
1130 # elif (__ACC_LSR(USHRT_MAX,63) == 1)
1131 # define ACC_SIZEOF_SHORT 8
1132 # elif (__ACC_LSR(USHRT_MAX,127) == 1)
1133 # define ACC_SIZEOF_SHORT 16
1135 # error "ACC_SIZEOF_SHORT"
1138 #if !defined(ACC_SIZEOF_INT)
1139 # if (ACC_ARCH_CRAY_PVP)
1140 # define ACC_SIZEOF_INT 8
1141 # elif (UINT_MAX == ACC_0xffffL)
1142 # define ACC_SIZEOF_INT 2
1143 # elif (UINT_MAX == ACC_0xffffffffL)
1144 # define ACC_SIZEOF_INT 4
1145 # elif (__ACC_LSR(UINT_MAX,7) == 1)
1146 # define ACC_SIZEOF_INT 1
1147 # elif (__ACC_LSR(UINT_MAX,15) == 1)
1148 # define ACC_SIZEOF_INT 2
1149 # elif (__ACC_LSR(UINT_MAX,31) == 1)
1150 # define ACC_SIZEOF_INT 4
1151 # elif (__ACC_LSR(UINT_MAX,63) == 1)
1152 # define ACC_SIZEOF_INT 8
1153 # elif (__ACC_LSR(UINT_MAX,127) == 1)
1154 # define ACC_SIZEOF_INT 16
1156 # error "ACC_SIZEOF_INT"
1159 #if !defined(ACC_SIZEOF_LONG)
1160 # if (ULONG_MAX == ACC_0xffffffffL)
1161 # define ACC_SIZEOF_LONG 4
1162 # elif (__ACC_LSR(ULONG_MAX,7) == 1)
1163 # define ACC_SIZEOF_LONG 1
1164 # elif (__ACC_LSR(ULONG_MAX,15) == 1)
1165 # define ACC_SIZEOF_LONG 2
1166 # elif (__ACC_LSR(ULONG_MAX,31) == 1)
1167 # define ACC_SIZEOF_LONG 4
1168 # elif (__ACC_LSR(ULONG_MAX,63) == 1)
1169 # define ACC_SIZEOF_LONG 8
1170 # elif (__ACC_LSR(ULONG_MAX,127) == 1)
1171 # define ACC_SIZEOF_LONG 16
1173 # error "ACC_SIZEOF_LONG"
1176 #if !defined(ACC_SIZEOF_LONG_LONG) && !defined(ACC_SIZEOF___INT64)
1177 #if (ACC_SIZEOF_LONG > 0 && ACC_SIZEOF_LONG < 8)
1178 # if defined(__LONG_MAX__) && defined(__LONG_LONG_MAX__)
1179 # if (ACC_CC_GNUC >= 0x030300ul)
1180 # if ((__LONG_MAX__)+0 == (__LONG_LONG_MAX__)+0)
1181 # define ACC_SIZEOF_LONG_LONG ACC_SIZEOF_LONG
1182 # elif (__ACC_LSR(__LONG_LONG_MAX__,30) == 1)
1183 # define ACC_SIZEOF_LONG_LONG 4
1189 #if !defined(ACC_SIZEOF_LONG_LONG) && !defined(ACC_SIZEOF___INT64)
1190 #if (ACC_SIZEOF_LONG > 0 && ACC_SIZEOF_LONG < 8)
1191 #if (ACC_ARCH_I086 && ACC_CC_DMC)
1192 #elif (ACC_CC_CILLY) && defined(__GNUC__)
1193 # define ACC_SIZEOF_LONG_LONG 8
1194 #elif (ACC_CC_CLANG || ACC_CC_GNUC || ACC_CC_LLVM || ACC_CC_PATHSCALE)
1195 # define ACC_SIZEOF_LONG_LONG 8
1196 #elif ((ACC_OS_WIN32 || ACC_OS_WIN64 || defined(_WIN32)) && ACC_CC_MSC && (_MSC_VER >= 1400))
1197 # define ACC_SIZEOF_LONG_LONG 8
1198 #elif (ACC_OS_WIN64 || defined(_WIN64))
1199 # define ACC_SIZEOF___INT64 8
1200 #elif (ACC_ARCH_I386 && (ACC_CC_DMC))
1201 # define ACC_SIZEOF_LONG_LONG 8
1202 #elif (ACC_ARCH_I386 && (ACC_CC_SYMANTECC && (__SC__ >= 0x700)))
1203 # define ACC_SIZEOF_LONG_LONG 8
1204 #elif (ACC_ARCH_I386 && (ACC_CC_INTELC && defined(__linux__)))
1205 # define ACC_SIZEOF_LONG_LONG 8
1206 #elif (ACC_ARCH_I386 && (ACC_CC_MWERKS || ACC_CC_PELLESC || ACC_CC_PGI || ACC_CC_SUNPROC))
1207 # define ACC_SIZEOF_LONG_LONG 8
1208 #elif (ACC_ARCH_I386 && (ACC_CC_INTELC || ACC_CC_MSC))
1209 # define ACC_SIZEOF___INT64 8
1210 #elif ((ACC_OS_WIN32 || defined(_WIN32)) && (ACC_CC_MSC))
1211 # define ACC_SIZEOF___INT64 8
1212 #elif (ACC_ARCH_I386 && (ACC_CC_BORLANDC && (__BORLANDC__ >= 0x0520)))
1213 # define ACC_SIZEOF___INT64 8
1214 #elif (ACC_ARCH_I386 && (ACC_CC_WATCOMC && (__WATCOMC__ >= 1100)))
1215 # define ACC_SIZEOF___INT64 8
1216 #elif (ACC_CC_WATCOMC && defined(_INTEGRAL_MAX_BITS) && (_INTEGRAL_MAX_BITS == 64))
1217 # define ACC_SIZEOF___INT64 8
1218 #elif (ACC_OS_OS400 || defined(__OS400__)) && defined(__LLP64_IFC__)
1219 # define ACC_SIZEOF_LONG_LONG 8
1220 #elif (defined(__vms) || defined(__VMS)) && (__INITIAL_POINTER_SIZE+0 == 64)
1221 # define ACC_SIZEOF_LONG_LONG 8
1222 #elif (ACC_CC_SDCC) && (ACC_SIZEOF_INT == 2)
1223 #elif 1 && defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)
1224 # define ACC_SIZEOF_LONG_LONG 8
1228 #if defined(__cplusplus) && (ACC_CC_GNUC)
1229 # if (ACC_CC_GNUC < 0x020800ul)
1230 # undef ACC_SIZEOF_LONG_LONG
1233 #if (ACC_CFG_NO_LONG_LONG) || defined(__NO_LONG_LONG)
1234 # undef ACC_SIZEOF_LONG_LONG
1236 #if !defined(ACC_SIZEOF_VOID_P)
1238 # define __ACC_WORDSIZE 2
1239 # if (ACC_MM_TINY || ACC_MM_SMALL || ACC_MM_MEDIUM)
1240 # define ACC_SIZEOF_VOID_P 2
1241 # elif (ACC_MM_COMPACT || ACC_MM_LARGE || ACC_MM_HUGE)
1242 # define ACC_SIZEOF_VOID_P 4
1246 #elif (ACC_ARCH_AVR || ACC_ARCH_Z80)
1247 # define __ACC_WORDSIZE 1
1248 # define ACC_SIZEOF_VOID_P 2
1249 #elif (ACC_ARCH_C166 || ACC_ARCH_MCS51 || ACC_ARCH_MCS251 || ACC_ARCH_MSP430)
1250 # define ACC_SIZEOF_VOID_P 2
1251 #elif (ACC_ARCH_H8300)
1252 # if defined(__NORMAL_MODE__)
1253 # define __ACC_WORDSIZE 4
1254 # define ACC_SIZEOF_VOID_P 2
1255 # elif defined(__H8300H__) || defined(__H8300S__) || defined(__H8300SX__)
1256 # define __ACC_WORDSIZE 4
1257 # define ACC_SIZEOF_VOID_P 4
1259 # define __ACC_WORDSIZE 2
1260 # define ACC_SIZEOF_VOID_P 2
1262 # if (ACC_CC_GNUC && (ACC_CC_GNUC < 0x040000ul)) && (ACC_SIZEOF_INT == 4)
1263 # define ACC_SIZEOF_SIZE_T ACC_SIZEOF_INT
1264 # define ACC_SIZEOF_PTRDIFF_T ACC_SIZEOF_INT
1266 #elif (ACC_ARCH_M16C)
1267 # define __ACC_WORDSIZE 2
1268 # if defined(__m32c_cpu__) || defined(__m32cm_cpu__)
1269 # define ACC_SIZEOF_VOID_P 4
1271 # define ACC_SIZEOF_VOID_P 2
1273 #elif (ACC_SIZEOF_LONG == 8) && ((defined(__mips__) && defined(__R5900__)) || defined(__MIPS_PSX2__))
1274 # define __ACC_WORDSIZE 8
1275 # define ACC_SIZEOF_VOID_P 4
1276 #elif defined(__LLP64__) || defined(__LLP64) || defined(_LLP64) || defined(_WIN64)
1277 # define __ACC_WORDSIZE 8
1278 # define ACC_SIZEOF_VOID_P 8
1279 #elif (ACC_OS_OS400 || defined(__OS400__)) && defined(__LLP64_IFC__)
1280 # define ACC_SIZEOF_VOID_P ACC_SIZEOF_LONG
1281 # define ACC_SIZEOF_SIZE_T ACC_SIZEOF_LONG
1282 # define ACC_SIZEOF_PTRDIFF_T ACC_SIZEOF_LONG
1283 #elif (ACC_OS_OS400 || defined(__OS400__))
1284 # define __ACC_WORDSIZE ACC_SIZEOF_LONG
1285 # define ACC_SIZEOF_VOID_P 16
1286 # define ACC_SIZEOF_SIZE_T ACC_SIZEOF_LONG
1287 # define ACC_SIZEOF_PTRDIFF_T ACC_SIZEOF_LONG
1288 #elif (defined(__vms) || defined(__VMS)) && (__INITIAL_POINTER_SIZE+0 == 64)
1289 # define ACC_SIZEOF_VOID_P 8
1290 # define ACC_SIZEOF_SIZE_T ACC_SIZEOF_LONG
1291 # define ACC_SIZEOF_PTRDIFF_T ACC_SIZEOF_LONG
1292 #elif (ACC_ARCH_SPU)
1294 # define __ACC_WORDSIZE 16
1296 # define ACC_SIZEOF_VOID_P 4
1298 # define ACC_SIZEOF_VOID_P ACC_SIZEOF_LONG
1301 #if !defined(ACC_WORDSIZE)
1302 # if defined(__ACC_WORDSIZE)
1303 # define ACC_WORDSIZE __ACC_WORDSIZE
1305 # define ACC_WORDSIZE ACC_SIZEOF_VOID_P
1308 #if !defined(ACC_SIZEOF_SIZE_T)
1309 #if (ACC_ARCH_I086 || ACC_ARCH_M16C)
1310 # define ACC_SIZEOF_SIZE_T 2
1312 # define ACC_SIZEOF_SIZE_T ACC_SIZEOF_VOID_P
1315 #if !defined(ACC_SIZEOF_PTRDIFF_T)
1317 # if (ACC_MM_TINY || ACC_MM_SMALL || ACC_MM_MEDIUM || ACC_MM_HUGE)
1318 # define ACC_SIZEOF_PTRDIFF_T ACC_SIZEOF_VOID_P
1319 # elif (ACC_MM_COMPACT || ACC_MM_LARGE)
1320 # if (ACC_CC_BORLANDC || ACC_CC_TURBOC)
1321 # define ACC_SIZEOF_PTRDIFF_T 4
1323 # define ACC_SIZEOF_PTRDIFF_T 2
1329 # define ACC_SIZEOF_PTRDIFF_T ACC_SIZEOF_SIZE_T
1332 #if (ACC_ABI_NEUTRAL_ENDIAN)
1333 # undef ACC_ABI_BIG_ENDIAN
1334 # undef ACC_ABI_LITTLE_ENDIAN
1335 #elif !(ACC_ABI_BIG_ENDIAN) && !(ACC_ABI_LITTLE_ENDIAN)
1336 #if (ACC_ARCH_ALPHA) && (ACC_ARCH_CRAY_MPP)
1337 # define ACC_ABI_BIG_ENDIAN 1
1338 #elif (ACC_ARCH_IA64) && (ACC_OS_POSIX_LINUX || ACC_OS_WIN64)
1339 # define ACC_ABI_LITTLE_ENDIAN 1
1340 #elif (ACC_ARCH_ALPHA || ACC_ARCH_AMD64 || ACC_ARCH_BLACKFIN || ACC_ARCH_CRIS || ACC_ARCH_I086 || ACC_ARCH_I386 || ACC_ARCH_MSP430)
1341 # define ACC_ABI_LITTLE_ENDIAN 1
1342 #elif (ACC_ARCH_AVR32 || ACC_ARCH_M68K || ACC_ARCH_S390)
1343 # define ACC_ABI_BIG_ENDIAN 1
1344 #elif 1 && defined(__IAR_SYSTEMS_ICC__) && defined(__LITTLE_ENDIAN__)
1345 # if (__LITTLE_ENDIAN__ == 1)
1346 # define ACC_ABI_LITTLE_ENDIAN 1
1348 # define ACC_ABI_BIG_ENDIAN 1
1350 #elif 1 && defined(__BIG_ENDIAN__) && !defined(__LITTLE_ENDIAN__)
1351 # define ACC_ABI_BIG_ENDIAN 1
1352 #elif 1 && defined(__LITTLE_ENDIAN__) && !defined(__BIG_ENDIAN__)
1353 # define ACC_ABI_LITTLE_ENDIAN 1
1354 #elif 1 && (ACC_ARCH_ARM) && defined(__ARMEB__) && !defined(__ARMEL__)
1355 # define ACC_ABI_BIG_ENDIAN 1
1356 #elif 1 && (ACC_ARCH_ARM) && defined(__ARMEL__) && !defined(__ARMEB__)
1357 # define ACC_ABI_LITTLE_ENDIAN 1
1358 #elif 1 && (ACC_ARCH_MIPS) && defined(__MIPSEB__) && !defined(__MIPSEL__)
1359 # define ACC_ABI_BIG_ENDIAN 1
1360 #elif 1 && (ACC_ARCH_MIPS) && defined(__MIPSEL__) && !defined(__MIPSEB__)
1361 # define ACC_ABI_LITTLE_ENDIAN 1
1364 #if (ACC_ABI_BIG_ENDIAN) && (ACC_ABI_LITTLE_ENDIAN)
1365 # error "this should not happen"
1367 #if (ACC_ABI_BIG_ENDIAN)
1368 # define ACC_INFO_ABI_ENDIAN "be"
1369 #elif (ACC_ABI_LITTLE_ENDIAN)
1370 # define ACC_INFO_ABI_ENDIAN "le"
1371 #elif (ACC_ABI_NEUTRAL_ENDIAN)
1372 # define ACC_INFO_ABI_ENDIAN "neutral"
1374 #if (ACC_SIZEOF_INT == 1 && ACC_SIZEOF_LONG == 2 && ACC_SIZEOF_VOID_P == 2)
1375 # define ACC_ABI_I8LP16 1
1376 # define ACC_INFO_ABI_PM "i8lp16"
1377 #elif (ACC_SIZEOF_INT == 2 && ACC_SIZEOF_LONG == 2 && ACC_SIZEOF_VOID_P == 2)
1378 # define ACC_ABI_ILP16 1
1379 # define ACC_INFO_ABI_PM "ilp16"
1380 #elif (ACC_SIZEOF_INT == 4 && ACC_SIZEOF_LONG == 4 && ACC_SIZEOF_VOID_P == 4)
1381 # define ACC_ABI_ILP32 1
1382 # define ACC_INFO_ABI_PM "ilp32"
1383 #elif (ACC_SIZEOF_INT == 4 && ACC_SIZEOF_LONG == 4 && ACC_SIZEOF_VOID_P == 8 && ACC_SIZEOF_SIZE_T == 8)
1384 # define ACC_ABI_LLP64 1
1385 # define ACC_INFO_ABI_PM "llp64"
1386 #elif (ACC_SIZEOF_INT == 4 && ACC_SIZEOF_LONG == 8 && ACC_SIZEOF_VOID_P == 8)
1387 # define ACC_ABI_LP64 1
1388 # define ACC_INFO_ABI_PM "lp64"
1389 #elif (ACC_SIZEOF_INT == 8 && ACC_SIZEOF_LONG == 8 && ACC_SIZEOF_VOID_P == 8)
1390 # define ACC_ABI_ILP64 1
1391 # define ACC_INFO_ABI_PM "ilp64"
1392 #elif (ACC_SIZEOF_INT == 4 && ACC_SIZEOF_LONG == 8 && ACC_SIZEOF_VOID_P == 4)
1393 # define ACC_ABI_IP32L64 1
1394 # define ACC_INFO_ABI_PM "ip32l64"
1396 #if !defined(__ACC_LIBC_OVERRIDE)
1397 #if (ACC_LIBC_NAKED)
1398 # define ACC_INFO_LIBC "naked"
1399 #elif (ACC_LIBC_FREESTANDING)
1400 # define ACC_INFO_LIBC "freestanding"
1401 #elif (ACC_LIBC_MOSTLY_FREESTANDING)
1402 # define ACC_INFO_LIBC "mfreestanding"
1403 #elif (ACC_LIBC_ISOC90)
1404 # define ACC_INFO_LIBC "isoc90"
1405 #elif (ACC_LIBC_ISOC99)
1406 # define ACC_INFO_LIBC "isoc99"
1407 #elif defined(__dietlibc__)
1408 # define ACC_LIBC_DIETLIBC 1
1409 # define ACC_INFO_LIBC "dietlibc"
1410 #elif defined(_NEWLIB_VERSION)
1411 # define ACC_LIBC_NEWLIB 1
1412 # define ACC_INFO_LIBC "newlib"
1413 #elif defined(__UCLIBC__) && defined(__UCLIBC_MAJOR__) && defined(__UCLIBC_MINOR__)
1414 # if defined(__UCLIBC_SUBLEVEL__)
1415 # define ACC_LIBC_UCLIBC (__UCLIBC_MAJOR__ * 0x10000L + __UCLIBC_MINOR__ * 0x100 + __UCLIBC_SUBLEVEL__)
1417 # define ACC_LIBC_UCLIBC 0x00090bL
1419 # define ACC_INFO_LIBC "uclibc"
1420 #elif defined(__GLIBC__) && defined(__GLIBC_MINOR__)
1421 # define ACC_LIBC_GLIBC (__GLIBC__ * 0x10000L + __GLIBC_MINOR__ * 0x100)
1422 # define ACC_INFO_LIBC "glibc"
1423 #elif (ACC_CC_MWERKS) && defined(__MSL__)
1424 # define ACC_LIBC_MSL __MSL__
1425 # define ACC_INFO_LIBC "msl"
1426 #elif 1 && defined(__IAR_SYSTEMS_ICC__)
1427 # define ACC_LIBC_ISOC90 1
1428 # define ACC_INFO_LIBC "isoc90"
1430 # define ACC_LIBC_DEFAULT 1
1431 # define ACC_INFO_LIBC "default"
1434 #if !defined(__acc_gnuc_extension__)
1435 #if (ACC_CC_GNUC >= 0x020800ul)
1436 # define __acc_gnuc_extension__ __extension__
1437 #elif (ACC_CC_CLANG || ACC_CC_LLVM || ACC_CC_PATHSCALE)
1438 # define __acc_gnuc_extension__ __extension__
1440 # define __acc_gnuc_extension__ /*empty*/
1443 #if !defined(__acc_ua_volatile)
1444 # define __acc_ua_volatile volatile
1446 #if !defined(__acc_alignof)
1447 #if (ACC_CC_CILLY || ACC_CC_CLANG || ACC_CC_GNUC || ACC_CC_LLVM || ACC_CC_PATHSCALE || ACC_CC_PGI)
1448 # define __acc_alignof(e) __alignof__(e)
1449 #elif (ACC_CC_INTELC && (__INTEL_COMPILER >= 700))
1450 # define __acc_alignof(e) __alignof__(e)
1451 #elif (ACC_CC_MSC && (_MSC_VER >= 1300))
1452 # define __acc_alignof(e) __alignof(e)
1453 #elif (ACC_CC_SUNPROC && (ACC_CC_SUNPROC >= 0x5100))
1454 # define __acc_alignof(e) __alignof__(e)
1457 #if defined(__acc_alignof)
1458 # define __acc_HAVE_alignof 1
1460 #if !defined(__acc_constructor)
1461 #if (ACC_CC_GNUC >= 0x030400ul)
1462 # define __acc_constructor __attribute__((__constructor__,__used__))
1463 #elif (ACC_CC_GNUC >= 0x020700ul)
1464 # define __acc_constructor __attribute__((__constructor__))
1465 #elif (ACC_CC_CLANG || ACC_CC_LLVM || ACC_CC_PATHSCALE)
1466 # define __acc_constructor __attribute__((__constructor__))
1469 #if defined(__acc_constructor)
1470 # define __acc_HAVE_constructor 1
1472 #if !defined(__acc_destructor)
1473 #if (ACC_CC_GNUC >= 0x030400ul)
1474 # define __acc_destructor __attribute__((__destructor__,__used__))
1475 #elif (ACC_CC_GNUC >= 0x020700ul)
1476 # define __acc_destructor __attribute__((__destructor__))
1477 #elif (ACC_CC_CLANG || ACC_CC_LLVM || ACC_CC_PATHSCALE)
1478 # define __acc_destructor __attribute__((__destructor__))
1481 #if defined(__acc_destructor)
1482 # define __acc_HAVE_destructor 1
1484 #if (__acc_HAVE_destructor) && !(__acc_HAVE_constructor)
1485 # error "this should not happen"
1487 #if !defined(__acc_inline)
1488 #if (ACC_CC_TURBOC && (__TURBOC__ <= 0x0295))
1489 #elif defined(__cplusplus)
1490 # define __acc_inline inline
1491 #elif (ACC_CC_BORLANDC && (__BORLANDC__ >= 0x0550))
1492 # define __acc_inline __inline
1493 #elif (ACC_CC_CILLY || ACC_CC_CLANG || ACC_CC_GNUC || ACC_CC_LLVM || ACC_CC_PATHSCALE || ACC_CC_PGI)
1494 # define __acc_inline __inline__
1496 # define __acc_inline __inline
1497 #elif (ACC_CC_INTELC)
1498 # define __acc_inline __inline
1499 #elif (ACC_CC_MWERKS && (__MWERKS__ >= 0x2405))
1500 # define __acc_inline __inline
1501 #elif (ACC_CC_MSC && (_MSC_VER >= 900))
1502 # define __acc_inline __inline
1503 #elif (ACC_CC_SUNPROC && (ACC_CC_SUNPROC >= 0x5100))
1504 # define __acc_inline __inline__
1505 #elif defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)
1506 # define __acc_inline inline
1509 #if defined(__acc_inline)
1510 # define __acc_HAVE_inline 1
1512 # define __acc_inline /*empty*/
1514 #if !defined(__acc_forceinline)
1515 #if (ACC_CC_GNUC >= 0x030200ul)
1516 # define __acc_forceinline __inline__ __attribute__((__always_inline__))
1517 #elif (ACC_CC_INTELC && (__INTEL_COMPILER >= 450) && ACC_CC_SYNTAX_MSC)
1518 # define __acc_forceinline __forceinline
1519 #elif (ACC_CC_INTELC && (__INTEL_COMPILER >= 800) && ACC_CC_SYNTAX_GNUC)
1520 # define __acc_forceinline __inline__ __attribute__((__always_inline__))
1521 #elif (ACC_CC_CLANG || ACC_CC_LLVM || ACC_CC_PATHSCALE)
1522 # define __acc_forceinline __inline__ __attribute__((__always_inline__))
1523 #elif (ACC_CC_MSC && (_MSC_VER >= 1200))
1524 # define __acc_forceinline __forceinline
1525 #elif (ACC_CC_SUNPROC && (ACC_CC_SUNPROC >= 0x5100))
1526 # define __acc_forceinline __inline__ __attribute__((__always_inline__))
1529 #if defined(__acc_forceinline)
1530 # define __acc_HAVE_forceinline 1
1532 # define __acc_forceinline /*empty*/
1534 #if !defined(__acc_noinline)
1535 #if 1 && (ACC_ARCH_I386) && (ACC_CC_GNUC >= 0x040000ul) && (ACC_CC_GNUC < 0x040003ul)
1536 # define __acc_noinline __attribute__((__noinline__,__used__))
1537 #elif (ACC_CC_GNUC >= 0x030200ul)
1538 # define __acc_noinline __attribute__((__noinline__))
1539 #elif (ACC_CC_INTELC && (__INTEL_COMPILER >= 600) && ACC_CC_SYNTAX_MSC)
1540 # define __acc_noinline __declspec(noinline)
1541 #elif (ACC_CC_INTELC && (__INTEL_COMPILER >= 800) && ACC_CC_SYNTAX_GNUC)
1542 # define __acc_noinline __attribute__((__noinline__))
1543 #elif (ACC_CC_CLANG || ACC_CC_LLVM || ACC_CC_PATHSCALE)
1544 # define __acc_noinline __attribute__((__noinline__))
1545 #elif (ACC_CC_MSC && (_MSC_VER >= 1300))
1546 # define __acc_noinline __declspec(noinline)
1547 #elif (ACC_CC_MWERKS && (__MWERKS__ >= 0x3200) && (ACC_OS_WIN32 || ACC_OS_WIN64))
1548 # if defined(__cplusplus)
1550 # define __acc_noinline __declspec(noinline)
1552 #elif (ACC_CC_SUNPROC && (ACC_CC_SUNPROC >= 0x5100))
1553 # define __acc_noinline __attribute__((__noinline__))
1556 #if defined(__acc_noinline)
1557 # define __acc_HAVE_noinline 1
1559 # define __acc_noinline /*empty*/
1561 #if (__acc_HAVE_forceinline || __acc_HAVE_noinline) && !(__acc_HAVE_inline)
1562 # error "this should not happen"
1564 #if !defined(__acc_noreturn)
1565 #if (ACC_CC_GNUC >= 0x020700ul)
1566 # define __acc_noreturn __attribute__((__noreturn__))
1567 #elif (ACC_CC_INTELC && (__INTEL_COMPILER >= 450) && ACC_CC_SYNTAX_MSC)
1568 # define __acc_noreturn __declspec(noreturn)
1569 #elif (ACC_CC_INTELC && (__INTEL_COMPILER >= 600) && ACC_CC_SYNTAX_GNUC)
1570 # define __acc_noreturn __attribute__((__noreturn__))
1571 #elif (ACC_CC_CLANG || ACC_CC_LLVM || ACC_CC_PATHSCALE)
1572 # define __acc_noreturn __attribute__((__noreturn__))
1573 #elif (ACC_CC_MSC && (_MSC_VER >= 1200))
1574 # define __acc_noreturn __declspec(noreturn)
1577 #if defined(__acc_noreturn)
1578 # define __acc_HAVE_noreturn 1
1580 # define __acc_noreturn /*empty*/
1582 #if !defined(__acc_nothrow)
1583 #if (ACC_CC_GNUC >= 0x030300ul)
1584 # define __acc_nothrow __attribute__((__nothrow__))
1585 #elif (ACC_CC_INTELC && (__INTEL_COMPILER >= 450) && ACC_CC_SYNTAX_MSC) && defined(__cplusplus)
1586 # define __acc_nothrow __declspec(nothrow)
1587 #elif (ACC_CC_INTELC && (__INTEL_COMPILER >= 900) && ACC_CC_SYNTAX_GNUC)
1588 # define __acc_nothrow __attribute__((__nothrow__))
1589 #elif (ACC_CC_CLANG || ACC_CC_LLVM || ACC_CC_PATHSCALE)
1590 # define __acc_nothrow __attribute__((__nothrow__))
1591 #elif (ACC_CC_MSC && (_MSC_VER >= 1200)) && defined(__cplusplus)
1592 # define __acc_nothrow __declspec(nothrow)
1595 #if defined(__acc_nothrow)
1596 # define __acc_HAVE_nothrow 1
1598 # define __acc_nothrow /*empty*/
1600 #if !defined(__acc_restrict)
1601 #if (ACC_CC_GNUC >= 0x030400ul)
1602 # define __acc_restrict __restrict__
1603 #elif (ACC_CC_INTELC && (__INTEL_COMPILER >= 600) && ACC_CC_SYNTAX_GNUC)
1604 # define __acc_restrict __restrict__
1605 #elif (ACC_CC_CLANG || ACC_CC_LLVM)
1606 # define __acc_restrict __restrict__
1607 #elif (ACC_CC_MSC && (_MSC_VER >= 1400))
1608 # define __acc_restrict __restrict
1611 #if defined(__acc_restrict)
1612 # define __acc_HAVE_restrict 1
1614 # define __acc_restrict /*empty*/
1616 #if !defined(__acc_likely) && !defined(__acc_unlikely)
1617 #if (ACC_CC_GNUC >= 0x030200ul)
1618 # define __acc_likely(e) (__builtin_expect(!!(e),1))
1619 # define __acc_unlikely(e) (__builtin_expect(!!(e),0))
1620 #elif (ACC_CC_INTELC && (__INTEL_COMPILER >= 800))
1621 # define __acc_likely(e) (__builtin_expect(!!(e),1))
1622 # define __acc_unlikely(e) (__builtin_expect(!!(e),0))
1623 #elif (ACC_CC_CLANG || ACC_CC_LLVM || ACC_CC_PATHSCALE)
1624 # define __acc_likely(e) (__builtin_expect(!!(e),1))
1625 # define __acc_unlikely(e) (__builtin_expect(!!(e),0))
1628 #if defined(__acc_likely)
1629 # define __acc_HAVE_likely 1
1631 # define __acc_likely(e) (e)
1633 #if defined(__acc_unlikely)
1634 # define __acc_HAVE_unlikely 1
1636 # define __acc_unlikely(e) (e)
1638 #if !defined(ACC_UNUSED)
1639 # if (ACC_CC_BORLANDC && (__BORLANDC__ >= 0x0600))
1640 # define ACC_UNUSED(var) ((void) &var)
1641 # elif (ACC_CC_BORLANDC || ACC_CC_HIGHC || ACC_CC_NDPC || ACC_CC_PELLESC || ACC_CC_TURBOC)
1642 # define ACC_UNUSED(var) if (&var) ; else
1643 # elif (ACC_CC_CLANG || ACC_CC_GNUC || ACC_CC_LLVM || ACC_CC_PATHSCALE)
1644 # define ACC_UNUSED(var) ((void) var)
1645 # elif (ACC_CC_MSC && (_MSC_VER < 900))
1646 # define ACC_UNUSED(var) if (&var) ; else
1647 # elif (ACC_CC_KEILC)
1648 # define ACC_UNUSED(var) {extern int __acc_unused[1-2*!(sizeof(var)>0)];}
1649 # elif (ACC_CC_PACIFICC)
1650 # define ACC_UNUSED(var) ((void) sizeof(var))
1651 # elif (ACC_CC_WATCOMC) && defined(__cplusplus)
1652 # define ACC_UNUSED(var) ((void) var)
1654 # define ACC_UNUSED(var) ((void) &var)
1657 #if !defined(ACC_UNUSED_FUNC)
1658 # if (ACC_CC_BORLANDC && (__BORLANDC__ >= 0x0600))
1659 # define ACC_UNUSED_FUNC(func) ((void) func)
1660 # elif (ACC_CC_BORLANDC || ACC_CC_NDPC || ACC_CC_TURBOC)
1661 # define ACC_UNUSED_FUNC(func) if (func) ; else
1662 # elif (ACC_CC_CLANG || ACC_CC_LLVM)
1663 # define ACC_UNUSED_FUNC(func) ((void) &func)
1664 # elif (ACC_CC_MSC && (_MSC_VER < 900))
1665 # define ACC_UNUSED_FUNC(func) if (func) ; else
1667 # define ACC_UNUSED_FUNC(func) ((void) &func)
1668 # elif (ACC_CC_KEILC || ACC_CC_PELLESC)
1669 # define ACC_UNUSED_FUNC(func) {extern int __acc_unused[1-2*!(sizeof((int)func)>0)];}
1671 # define ACC_UNUSED_FUNC(func) ((void) func)
1674 #if !defined(ACC_UNUSED_LABEL)
1675 # if (ACC_CC_WATCOMC) && defined(__cplusplus)
1676 # define ACC_UNUSED_LABEL(l) switch(0) case 1:goto l
1677 # elif (ACC_CC_CLANG || ACC_CC_INTELC || ACC_CC_WATCOMC)
1678 # define ACC_UNUSED_LABEL(l) if (0) goto l
1680 # define ACC_UNUSED_LABEL(l) switch(0) case 1:goto l
1683 #if !defined(ACC_DEFINE_UNINITIALIZED_VAR)
1685 # define ACC_DEFINE_UNINITIALIZED_VAR(type,var,init) type var
1686 # elif 0 && (ACC_CC_GNUC)
1687 # define ACC_DEFINE_UNINITIALIZED_VAR(type,var,init) type var = var
1689 # define ACC_DEFINE_UNINITIALIZED_VAR(type,var,init) type var = init
1692 #if !defined(ACC_UNCONST_CAST)
1693 # if 0 && defined(__cplusplus)
1694 # define ACC_UNCONST_CAST(t,e) (const_cast<t> (e))
1695 # elif (ACC_CC_CLANG || ACC_CC_GNUC || ACC_CC_LLVM || ACC_CC_PATHSCALE)
1696 # define ACC_UNCONST_CAST(t,e) ((t) ((void *) ((char *) ((acc_uintptr_t) ((const void *) (e))))))
1698 # define ACC_UNCONST_CAST(t,e) ((t) ((void *) ((char *) ((const void *) (e)))))
1701 #if !defined(ACC_COMPILE_TIME_ASSERT_HEADER)
1702 # if (ACC_CC_AZTECC || ACC_CC_ZORTECHC)
1703 # define ACC_COMPILE_TIME_ASSERT_HEADER(e) extern int __acc_cta[1-!(e)];
1704 # elif (ACC_CC_DMC || ACC_CC_SYMANTECC)
1705 # define ACC_COMPILE_TIME_ASSERT_HEADER(e) extern int __acc_cta[1u-2*!(e)];
1706 # elif (ACC_CC_TURBOC && (__TURBOC__ == 0x0295))
1707 # define ACC_COMPILE_TIME_ASSERT_HEADER(e) extern int __acc_cta[1-!(e)];
1709 # define ACC_COMPILE_TIME_ASSERT_HEADER(e) extern int __acc_cta[1-2*!(e)];
1712 #if !defined(ACC_COMPILE_TIME_ASSERT)
1713 # if (ACC_CC_AZTECC)
1714 # define ACC_COMPILE_TIME_ASSERT(e) {typedef int __acc_cta_t[1-!(e)];}
1715 # elif (ACC_CC_DMC || ACC_CC_PACIFICC || ACC_CC_SYMANTECC || ACC_CC_ZORTECHC)
1716 # define ACC_COMPILE_TIME_ASSERT(e) switch(0) case 1:case !(e):break;
1717 # elif (ACC_CC_MSC && (_MSC_VER < 900))
1718 # define ACC_COMPILE_TIME_ASSERT(e) switch(0) case 1:case !(e):break;
1719 # elif (ACC_CC_TURBOC && (__TURBOC__ == 0x0295))
1720 # define ACC_COMPILE_TIME_ASSERT(e) switch(0) case 1:case !(e):break;
1722 # define ACC_COMPILE_TIME_ASSERT(e) {typedef int __acc_cta_t[1-2*!(e)];}
1725 #if (ACC_ARCH_I086 || ACC_ARCH_I386) && (ACC_OS_DOS16 || ACC_OS_DOS32 || ACC_OS_OS2 || ACC_OS_OS216 || ACC_OS_WIN16 || ACC_OS_WIN32 || ACC_OS_WIN64)
1726 # if (ACC_CC_GNUC || ACC_CC_HIGHC || ACC_CC_NDPC || ACC_CC_PACIFICC)
1727 # elif (ACC_CC_DMC || ACC_CC_SYMANTECC || ACC_CC_ZORTECHC)
1728 # define __acc_cdecl __cdecl
1729 # define __acc_cdecl_atexit /*empty*/
1730 # define __acc_cdecl_main __cdecl
1731 # if (ACC_OS_OS2 && (ACC_CC_DMC || ACC_CC_SYMANTECC))
1732 # define __acc_cdecl_qsort __pascal
1733 # elif (ACC_OS_OS2 && (ACC_CC_ZORTECHC))
1734 # define __acc_cdecl_qsort _stdcall
1736 # define __acc_cdecl_qsort __cdecl
1738 # elif (ACC_CC_WATCOMC)
1739 # define __acc_cdecl __cdecl
1741 # define __acc_cdecl __cdecl
1742 # define __acc_cdecl_atexit __cdecl
1743 # define __acc_cdecl_main __cdecl
1744 # define __acc_cdecl_qsort __cdecl
1746 # if (ACC_CC_GNUC || ACC_CC_HIGHC || ACC_CC_NDPC || ACC_CC_PACIFICC || ACC_CC_WATCOMC)
1747 # elif (ACC_OS_OS2 && (ACC_CC_DMC || ACC_CC_SYMANTECC))
1748 # define __acc_cdecl_sighandler __pascal
1749 # elif (ACC_OS_OS2 && (ACC_CC_ZORTECHC))
1750 # define __acc_cdecl_sighandler _stdcall
1751 # elif (ACC_CC_MSC && (_MSC_VER >= 1400)) && defined(_M_CEE_PURE)
1752 # define __acc_cdecl_sighandler __clrcall
1753 # elif (ACC_CC_MSC && (_MSC_VER >= 600 && _MSC_VER < 700))
1755 # define __acc_cdecl_sighandler _far _cdecl _loadds
1757 # define __acc_cdecl_sighandler _far _cdecl
1759 # define __acc_cdecl_sighandler _cdecl
1762 # define __acc_cdecl_sighandler __cdecl
1764 #elif (ACC_ARCH_I386) && (ACC_CC_WATCOMC)
1765 # define __acc_cdecl __cdecl
1766 #elif (ACC_ARCH_M68K && ACC_OS_TOS && (ACC_CC_PUREC || ACC_CC_TURBOC))
1767 # define __acc_cdecl cdecl
1769 #if !defined(__acc_cdecl)
1770 # define __acc_cdecl /*empty*/
1772 #if !defined(__acc_cdecl_atexit)
1773 # define __acc_cdecl_atexit /*empty*/
1775 #if !defined(__acc_cdecl_main)
1776 # define __acc_cdecl_main /*empty*/
1778 #if !defined(__acc_cdecl_qsort)
1779 # define __acc_cdecl_qsort /*empty*/
1781 #if !defined(__acc_cdecl_sighandler)
1782 # define __acc_cdecl_sighandler /*empty*/
1784 #if !defined(__acc_cdecl_va)
1785 # define __acc_cdecl_va __acc_cdecl
1787 #if !(ACC_CFG_NO_WINDOWS_H)
1788 #if (ACC_OS_CYGWIN || (ACC_OS_EMX && defined(__RSXNT__)) || ACC_OS_WIN32 || ACC_OS_WIN64)
1789 # if (ACC_CC_WATCOMC && (__WATCOMC__ < 1000))
1790 # elif (ACC_OS_WIN32 && ACC_CC_GNUC) && defined(__PW32__)
1791 # elif ((ACC_OS_CYGWIN || defined(__MINGW32__)) && (ACC_CC_GNUC && (ACC_CC_GNUC < 0x025f00ul)))
1793 # define ACC_HAVE_WINDOWS_H 1
1797 #if (ACC_ARCH_ALPHA)
1798 # define ACC_OPT_AVOID_UINT_INDEX 1
1799 # define ACC_OPT_AVOID_SHORT 1
1800 # define ACC_OPT_AVOID_USHORT 1
1801 #elif (ACC_ARCH_AMD64)
1802 # define ACC_OPT_AVOID_INT_INDEX 1
1803 # define ACC_OPT_AVOID_UINT_INDEX 1
1804 # define ACC_OPT_UNALIGNED16 1
1805 # define ACC_OPT_UNALIGNED32 1
1806 # define ACC_OPT_UNALIGNED64 1
1807 #elif (ACC_ARCH_ARM && ACC_ARCH_ARM_THUMB)
1808 #elif (ACC_ARCH_ARM)
1809 # define ACC_OPT_AVOID_SHORT 1
1810 # define ACC_OPT_AVOID_USHORT 1
1811 #elif (ACC_ARCH_CRIS)
1812 # define ACC_OPT_UNALIGNED16 1
1813 # define ACC_OPT_UNALIGNED32 1
1814 #elif (ACC_ARCH_I386)
1815 # define ACC_OPT_UNALIGNED16 1
1816 # define ACC_OPT_UNALIGNED32 1
1817 #elif (ACC_ARCH_IA64)
1818 # define ACC_OPT_AVOID_INT_INDEX 1
1819 # define ACC_OPT_AVOID_UINT_INDEX 1
1820 # define ACC_OPT_PREFER_POSTINC 1
1821 #elif (ACC_ARCH_M68K)
1822 # define ACC_OPT_PREFER_POSTINC 1
1823 # define ACC_OPT_PREFER_PREDEC 1
1824 # if defined(__mc68020__) && !defined(__mcoldfire__)
1825 # define ACC_OPT_UNALIGNED16 1
1826 # define ACC_OPT_UNALIGNED32 1
1828 #elif (ACC_ARCH_MIPS)
1829 # define ACC_OPT_AVOID_UINT_INDEX 1
1830 #elif (ACC_ARCH_POWERPC)
1831 # define ACC_OPT_PREFER_PREINC 1
1832 # define ACC_OPT_PREFER_PREDEC 1
1833 # if (ACC_ABI_BIG_ENDIAN)
1834 # define ACC_OPT_UNALIGNED16 1
1835 # define ACC_OPT_UNALIGNED32 1
1837 #elif (ACC_ARCH_S390)
1838 # define ACC_OPT_UNALIGNED16 1
1839 # define ACC_OPT_UNALIGNED32 1
1840 # if (ACC_SIZEOF_SIZE_T == 8)
1841 # define ACC_OPT_UNALIGNED64 1
1844 # define ACC_OPT_PREFER_POSTINC 1
1845 # define ACC_OPT_PREFER_PREDEC 1
1847 #ifndef ACC_CFG_NO_INLINE_ASM
1849 # define ACC_CFG_NO_INLINE_ASM 1
1852 #ifndef ACC_CFG_NO_UNALIGNED
1853 #if (ACC_ABI_NEUTRAL_ENDIAN) || (ACC_ARCH_GENERIC)
1854 # define ACC_CFG_NO_UNALIGNED 1
1857 #if (ACC_CFG_NO_UNALIGNED)
1858 # undef ACC_OPT_UNALIGNED16
1859 # undef ACC_OPT_UNALIGNED32
1860 # undef ACC_OPT_UNALIGNED64
1862 #if (ACC_CFG_NO_INLINE_ASM)
1863 #elif (ACC_ARCH_I386 && (ACC_OS_DOS32 || ACC_OS_WIN32) && (ACC_CC_DMC || ACC_CC_INTELC || ACC_CC_MSC || ACC_CC_PELLESC))
1864 # define ACC_ASM_SYNTAX_MSC 1
1865 #elif (ACC_OS_WIN64 && (ACC_CC_DMC || ACC_CC_INTELC || ACC_CC_MSC || ACC_CC_PELLESC))
1866 #elif (ACC_ARCH_I386 && ACC_CC_GNUC && (ACC_CC_GNUC == 0x011f00ul))
1867 #elif (ACC_ARCH_I386 && (ACC_CC_CLANG || ACC_CC_GNUC || ACC_CC_INTELC || ACC_CC_PATHSCALE))
1868 # define ACC_ASM_SYNTAX_GNUC 1
1869 #elif (ACC_ARCH_AMD64 && (ACC_CC_CLANG || ACC_CC_GNUC || ACC_CC_INTELC || ACC_CC_PATHSCALE))
1870 # define ACC_ASM_SYNTAX_GNUC 1
1872 #if (ACC_ASM_SYNTAX_GNUC)
1873 #if (ACC_ARCH_I386 && ACC_CC_GNUC && (ACC_CC_GNUC < 0x020000ul))
1874 # define __ACC_ASM_CLOBBER "ax"
1875 #elif (ACC_CC_INTELC)
1876 # define __ACC_ASM_CLOBBER "memory"
1878 # define __ACC_ASM_CLOBBER "cc", "memory"
1881 #if defined(__ACC_INFOSTR_MM)
1882 #elif (ACC_MM_FLAT) && (defined(__ACC_INFOSTR_PM) || defined(ACC_INFO_ABI_PM))
1883 # define __ACC_INFOSTR_MM ""
1884 #elif defined(ACC_INFO_MM)
1885 # define __ACC_INFOSTR_MM "." ACC_INFO_MM
1887 # define __ACC_INFOSTR_MM ""
1889 #if defined(__ACC_INFOSTR_PM)
1890 #elif defined(ACC_INFO_ABI_PM)
1891 # define __ACC_INFOSTR_PM "." ACC_INFO_ABI_PM
1893 # define __ACC_INFOSTR_PM ""
1895 #if defined(__ACC_INFOSTR_ENDIAN)
1896 #elif defined(ACC_INFO_ABI_ENDIAN)
1897 # define __ACC_INFOSTR_ENDIAN "." ACC_INFO_ABI_ENDIAN
1899 # define __ACC_INFOSTR_ENDIAN ""
1901 #if defined(__ACC_INFOSTR_OSNAME)
1902 #elif defined(ACC_INFO_OS_CONSOLE)
1903 # define __ACC_INFOSTR_OSNAME ACC_INFO_OS "." ACC_INFO_OS_CONSOLE
1904 #elif defined(ACC_INFO_OS_POSIX)
1905 # define __ACC_INFOSTR_OSNAME ACC_INFO_OS "." ACC_INFO_OS_POSIX
1907 # define __ACC_INFOSTR_OSNAME ACC_INFO_OS
1909 #if defined(__ACC_INFOSTR_LIBC)
1910 #elif defined(ACC_INFO_LIBC)
1911 # define __ACC_INFOSTR_LIBC "." ACC_INFO_LIBC
1913 # define __ACC_INFOSTR_LIBC ""
1915 #if defined(__ACC_INFOSTR_CCVER)
1916 #elif defined(ACC_INFO_CCVER)
1917 # define __ACC_INFOSTR_CCVER " " ACC_INFO_CCVER
1919 # define __ACC_INFOSTR_CCVER ""
1921 #define ACC_INFO_STRING \
1922 ACC_INFO_ARCH __ACC_INFOSTR_MM __ACC_INFOSTR_PM __ACC_INFOSTR_ENDIAN \
1923 " " __ACC_INFOSTR_OSNAME __ACC_INFOSTR_LIBC " " ACC_INFO_CC __ACC_INFOSTR_CCVER
1924 #if (ACC_CFG_NO_CONFIG_HEADER)
1925 #elif defined(ACC_CFG_CONFIG_HEADER)
1927 #if !(ACC_CFG_AUTO_NO_HEADERS)
1928 #if (ACC_LIBC_NAKED)
1929 #elif (ACC_LIBC_FREESTANDING)
1930 # define HAVE_LIMITS_H 1
1931 # define HAVE_STDARG_H 1
1932 # define HAVE_STDDEF_H 1
1933 #elif (ACC_LIBC_MOSTLY_FREESTANDING)
1934 # define HAVE_LIMITS_H 1
1935 # define HAVE_SETJMP_H 1
1936 # define HAVE_STDARG_H 1
1937 # define HAVE_STDDEF_H 1
1938 # define HAVE_STDIO_H 1
1939 # define HAVE_STRING_H 1
1941 #define STDC_HEADERS 1
1942 #define HAVE_ASSERT_H 1
1943 #define HAVE_CTYPE_H 1
1944 #define HAVE_DIRENT_H 1
1945 #define HAVE_ERRNO_H 1
1946 #define HAVE_FCNTL_H 1
1947 #define HAVE_FLOAT_H 1
1948 #define HAVE_LIMITS_H 1
1949 #define HAVE_MALLOC_H 1
1950 #define HAVE_MEMORY_H 1
1951 #define HAVE_SETJMP_H 1
1952 #define HAVE_SIGNAL_H 1
1953 #define HAVE_STDARG_H 1
1954 #define HAVE_STDDEF_H 1
1955 #define HAVE_STDIO_H 1
1956 #define HAVE_STDLIB_H 1
1957 #define HAVE_STRING_H 1
1958 #define HAVE_TIME_H 1
1959 #define HAVE_UNISTD_H 1
1960 #define HAVE_UTIME_H 1
1961 #define HAVE_SYS_STAT_H 1
1962 #define HAVE_SYS_TIME_H 1
1963 #define HAVE_SYS_TYPES_H 1
1965 # if (ACC_OS_POSIX_AIX)
1966 # define HAVE_SYS_RESOURCE_H 1
1967 # elif (ACC_OS_POSIX_FREEBSD || ACC_OS_POSIX_MACOSX || ACC_OS_POSIX_NETBSD || ACC_OS_POSIX_OPENBSD)
1968 # define HAVE_STRINGS_H 1
1969 # undef HAVE_MALLOC_H
1970 # elif (ACC_OS_POSIX_HPUX || ACC_OS_POSIX_INTERIX)
1971 # define HAVE_ALLOCA_H 1
1972 # elif (ACC_OS_POSIX_MACOSX && ACC_LIBC_MSL)
1973 # undef HAVE_SYS_TIME_H
1974 # undef HAVE_SYS_TYPES_H
1975 # elif (ACC_OS_POSIX_SOLARIS || ACC_OS_POSIX_SUNOS)
1976 # define HAVE_ALLOCA_H 1
1978 # if (ACC_LIBC_DIETLIBC || ACC_LIBC_GLIBC || ACC_LIBC_UCLIBC)
1979 # define HAVE_STRINGS_H 1
1980 # define HAVE_SYS_MMAN_H 1
1981 # define HAVE_SYS_RESOURCE_H 1
1982 # define HAVE_SYS_WAIT_H 1
1984 # if (ACC_LIBC_NEWLIB)
1985 # undef HAVE_STRINGS_H
1987 #elif (ACC_OS_CYGWIN)
1988 # define HAVE_IO_H 1
1990 # define HAVE_ALLOCA_H 1
1991 # define HAVE_IO_H 1
1992 #elif (ACC_ARCH_M68K && ACC_OS_TOS && ACC_CC_GNUC)
1993 # if !defined(__MINT__)
1994 # undef HAVE_MALLOC_H
1996 #elif (ACC_ARCH_M68K && ACC_OS_TOS && (ACC_CC_PUREC || ACC_CC_TURBOC))
1997 # undef HAVE_DIRENT_H
1998 # undef HAVE_FCNTL_H
1999 # undef HAVE_MALLOC_H
2000 # undef HAVE_MEMORY_H
2001 # undef HAVE_UNISTD_H
2002 # undef HAVE_UTIME_H
2003 # undef HAVE_SYS_STAT_H
2004 # undef HAVE_SYS_TIME_H
2005 # undef HAVE_SYS_TYPES_H
2007 #if (ACC_OS_DOS16 || ACC_OS_DOS32 || ACC_OS_OS2 || ACC_OS_OS216 || ACC_OS_WIN16 || ACC_OS_WIN32 || ACC_OS_WIN64)
2008 #define HAVE_CONIO_H 1
2009 #define HAVE_DIRECT_H 1
2010 #define HAVE_DOS_H 1
2012 #define HAVE_SHARE_H 1
2014 # undef HAVE_CONIO_H
2015 # undef HAVE_DIRECT_H
2016 # undef HAVE_DIRENT_H
2017 # undef HAVE_MALLOC_H
2018 # undef HAVE_SHARE_H
2019 # undef HAVE_UNISTD_H
2020 # undef HAVE_UTIME_H
2021 # undef HAVE_SYS_STAT_H
2022 # undef HAVE_SYS_TIME_H
2023 # undef HAVE_SYS_TYPES_H
2024 #elif (ACC_CC_BORLANDC)
2025 # undef HAVE_UNISTD_H
2026 # undef HAVE_SYS_TIME_H
2027 # if (ACC_OS_WIN32 || ACC_OS_WIN64)
2028 # undef HAVE_DIRENT_H
2030 # if (__BORLANDC__ < 0x0400)
2031 # undef HAVE_DIRENT_H
2032 # undef HAVE_UTIME_H
2035 # undef HAVE_DIRENT_H
2036 # undef HAVE_UNISTD_H
2037 # define HAVE_SYS_DIRENT_H 1
2038 #elif (ACC_OS_DOS32 && ACC_CC_GNUC) && defined(__DJGPP__)
2039 #elif (ACC_OS_DOS32 && ACC_CC_HIGHC)
2040 # define HAVE_ALLOCA_H 1
2041 # undef HAVE_DIRENT_H
2042 # undef HAVE_UNISTD_H
2043 #elif (ACC_CC_IBMC && ACC_OS_OS2)
2045 # undef HAVE_DIRENT_H
2046 # undef HAVE_UNISTD_H
2047 # undef HAVE_UTIME_H
2048 # undef HAVE_SYS_TIME_H
2049 # define HAVE_SYS_UTIME_H 1
2050 #elif (ACC_CC_INTELC || ACC_CC_MSC)
2051 # undef HAVE_DIRENT_H
2052 # undef HAVE_UNISTD_H
2053 # undef HAVE_UTIME_H
2054 # undef HAVE_SYS_TIME_H
2055 # define HAVE_SYS_UTIME_H 1
2056 #elif (ACC_CC_LCCWIN32)
2057 # undef HAVE_DIRENT_H
2059 # undef HAVE_UNISTD_H
2060 # undef HAVE_SYS_TIME_H
2061 #elif (ACC_OS_WIN32 && ACC_CC_GNUC) && defined(__MINGW32__)
2062 # undef HAVE_UTIME_H
2063 # define HAVE_SYS_UTIME_H 1
2064 #elif (ACC_OS_WIN32 && ACC_LIBC_MSL)
2065 # define HAVE_ALLOCA_H 1
2067 # undef HAVE_SHARE_H
2068 # undef HAVE_SYS_TIME_H
2070 # undef HAVE_DIRENT_H
2072 # undef HAVE_UNISTD_H
2073 # undef HAVE_UTIME_H
2074 # undef HAVE_SYS_TIME_H
2075 #elif (ACC_CC_PACIFICC)
2076 # undef HAVE_DIRECT_H
2077 # undef HAVE_DIRENT_H
2078 # undef HAVE_FCNTL_H
2080 # undef HAVE_MALLOC_H
2081 # undef HAVE_MEMORY_H
2082 # undef HAVE_SHARE_H
2083 # undef HAVE_UNISTD_H
2084 # undef HAVE_UTIME_H
2085 # undef HAVE_SYS_STAT_H
2086 # undef HAVE_SYS_TIME_H
2087 # undef HAVE_SYS_TYPES_H
2088 #elif (ACC_OS_WIN32 && ACC_CC_PELLESC)
2089 # undef HAVE_DIRENT_H
2091 # undef HAVE_MALLOC_H
2092 # undef HAVE_SHARE_H
2093 # undef HAVE_UNISTD_H
2094 # undef HAVE_UTIME_H
2095 # undef HAVE_SYS_TIME_H
2096 # if (__POCC__ < 280)
2098 # define HAVE_SYS_UTIME_H 1
2100 #elif (ACC_OS_WIN32 && ACC_CC_PGI) && defined(__MINGW32__)
2101 # undef HAVE_UTIME_H
2102 # define HAVE_SYS_UTIME_H 1
2103 #elif (ACC_OS_WIN32 && ACC_CC_GNUC) && defined(__PW32__)
2104 #elif (ACC_CC_SYMANTECC)
2105 # undef HAVE_DIRENT_H
2106 # undef HAVE_UNISTD_H
2107 # if (__SC__ < 0x700)
2108 # undef HAVE_UTIME_H
2109 # undef HAVE_SYS_TIME_H
2111 #elif (ACC_CC_TOPSPEEDC)
2112 # undef HAVE_DIRENT_H
2113 # undef HAVE_UNISTD_H
2114 # undef HAVE_UTIME_H
2115 # undef HAVE_SYS_STAT_H
2116 # undef HAVE_SYS_TIME_H
2117 # undef HAVE_SYS_TYPES_H
2118 #elif (ACC_CC_TURBOC)
2119 # undef HAVE_UNISTD_H
2120 # undef HAVE_SYS_TIME_H
2121 # undef HAVE_SYS_TYPES_H
2122 # if (ACC_OS_WIN32 || ACC_OS_WIN64)
2123 # undef HAVE_DIRENT_H
2125 # if (__TURBOC__ < 0x0200)
2126 # undef HAVE_SIGNAL_H
2128 # if (__TURBOC__ < 0x0400)
2129 # undef HAVE_DIRECT_H
2130 # undef HAVE_DIRENT_H
2131 # undef HAVE_MALLOC_H
2132 # undef HAVE_MEMORY_H
2133 # undef HAVE_UTIME_H
2135 #elif (ACC_CC_WATCOMC)
2136 # undef HAVE_DIRENT_H
2137 # undef HAVE_UTIME_H
2138 # undef HAVE_SYS_TIME_H
2139 # define HAVE_SYS_UTIME_H 1
2140 # if (__WATCOMC__ < 950)
2141 # undef HAVE_UNISTD_H
2143 #elif (ACC_CC_ZORTECHC)
2144 # undef HAVE_DIRENT_H
2145 # undef HAVE_MEMORY_H
2146 # undef HAVE_UNISTD_H
2147 # undef HAVE_UTIME_H
2148 # undef HAVE_SYS_TIME_H
2151 #if (ACC_OS_CONSOLE)
2152 # undef HAVE_DIRENT_H
2154 #if (ACC_OS_EMBEDDED)
2155 # undef HAVE_DIRENT_H
2157 #if (ACC_LIBC_ISOC90 || ACC_LIBC_ISOC99)
2158 # undef HAVE_DIRENT_H
2159 # undef HAVE_FCNTL_H
2160 # undef HAVE_MALLOC_H
2161 # undef HAVE_UNISTD_H
2162 # undef HAVE_UTIME_H
2163 # undef HAVE_SYS_STAT_H
2164 # undef HAVE_SYS_TIME_H
2165 # undef HAVE_SYS_TYPES_H
2167 #if (ACC_LIBC_GLIBC >= 0x020100ul)
2168 # define HAVE_STDINT_H 1
2169 #elif (ACC_LIBC_DIETLIBC)
2170 # undef HAVE_STDINT_H
2171 #elif (ACC_LIBC_UCLIBC)
2172 # define HAVE_STDINT_H 1
2173 #elif (ACC_CC_BORLANDC) && (__BORLANDC__ >= 0x560)
2174 # undef HAVE_STDINT_H
2175 #elif (ACC_CC_DMC) && (__DMC__ >= 0x825)
2176 # define HAVE_STDINT_H 1
2178 #if (HAVE_SYS_TIME_H && HAVE_TIME_H)
2179 # define TIME_WITH_SYS_TIME 1
2183 #if !(ACC_CFG_AUTO_NO_FUNCTIONS)
2184 #if (ACC_LIBC_NAKED)
2185 #elif (ACC_LIBC_FREESTANDING)
2186 #elif (ACC_LIBC_MOSTLY_FREESTANDING)
2187 # define HAVE_LONGJMP 1
2188 # define HAVE_MEMCMP 1
2189 # define HAVE_MEMCPY 1
2190 # define HAVE_MEMMOVE 1
2191 # define HAVE_MEMSET 1
2192 # define HAVE_SETJMP 1
2194 #define HAVE_ACCESS 1
2195 #define HAVE_ALLOCA 1
2196 #define HAVE_ATEXIT 1
2199 #define HAVE_CHMOD 1
2200 #define HAVE_CHOWN 1
2201 #define HAVE_CTIME 1
2202 #define HAVE_DIFFTIME 1
2203 #define HAVE_FILENO 1
2204 #define HAVE_FSTAT 1
2205 #define HAVE_GETENV 1
2206 #define HAVE_GETTIMEOFDAY 1
2207 #define HAVE_GMTIME 1
2208 #define HAVE_ISATTY 1
2209 #define HAVE_LOCALTIME 1
2210 #define HAVE_LONGJMP 1
2211 #define HAVE_LSTAT 1
2212 #define HAVE_MEMCMP 1
2213 #define HAVE_MEMCPY 1
2214 #define HAVE_MEMMOVE 1
2215 #define HAVE_MEMSET 1
2216 #define HAVE_MKDIR 1
2217 #define HAVE_MKTIME 1
2218 #define HAVE_QSORT 1
2219 #define HAVE_RAISE 1
2220 #define HAVE_RMDIR 1
2221 #define HAVE_SETJMP 1
2222 #define HAVE_SIGNAL 1
2223 #define HAVE_SNPRINTF 1
2225 #define HAVE_STRCHR 1
2226 #define HAVE_STRDUP 1
2227 #define HAVE_STRERROR 1
2228 #define HAVE_STRFTIME 1
2229 #define HAVE_STRRCHR 1
2230 #define HAVE_STRSTR 1
2232 #define HAVE_UMASK 1
2233 #define HAVE_UTIME 1
2234 #define HAVE_VSNPRINTF 1
2235 #if (ACC_OS_BEOS || ACC_OS_CYGWIN || ACC_OS_POSIX || ACC_OS_QNX || ACC_OS_VMS)
2236 # define HAVE_STRCASECMP 1
2237 # define HAVE_STRNCASECMP 1
2238 #elif (ACC_OS_WIN32 && ACC_CC_GNUC) && defined(__PW32__)
2239 # define HAVE_STRCASECMP 1
2240 # define HAVE_STRNCASECMP 1
2242 # define HAVE_STRICMP 1
2243 # define HAVE_STRNICMP 1
2246 # if (ACC_OS_POSIX_AIX)
2247 # define HAVE_GETRUSAGE 1
2248 # elif (ACC_OS_POSIX_MACOSX && ACC_LIBC_MSL)
2251 # elif (ACC_OS_POSIX_UNICOS)
2253 # undef HAVE_SNPRINTF
2254 # undef HAVE_VSNPRINTF
2259 # if (ACC_LIBC_DIETLIBC || ACC_LIBC_GLIBC || ACC_LIBC_UCLIBC)
2260 # define HAVE_GETRUSAGE 1
2261 # define HAVE_GETPAGESIZE 1
2262 # define HAVE_MMAP 1
2263 # define HAVE_MPROTECT 1
2264 # define HAVE_MUNMAP 1
2266 #elif (ACC_OS_CYGWIN)
2267 # if (ACC_CC_GNUC < 0x025a00ul)
2268 # undef HAVE_GETTIMEOFDAY
2271 # if (ACC_CC_GNUC < 0x025f00ul)
2272 # undef HAVE_SNPRINTF
2273 # undef HAVE_VSNPRINTF
2278 #elif (ACC_ARCH_M68K && ACC_OS_TOS && ACC_CC_GNUC)
2279 # if !defined(__MINT__)
2280 # undef HAVE_SNPRINTF
2281 # undef HAVE_VSNPRINTF
2283 #elif (ACC_ARCH_M68K && ACC_OS_TOS && (ACC_CC_PUREC || ACC_CC_TURBOC))
2289 # undef HAVE_GETTIMEOFDAY
2291 # undef HAVE_SNPRINTF
2294 # undef HAVE_VSNPRINTF
2296 #if (ACC_OS_DOS16 || ACC_OS_DOS32 || ACC_OS_OS2 || ACC_OS_OS216 || ACC_OS_WIN16 || ACC_OS_WIN32 || ACC_OS_WIN64)
2298 #undef HAVE_GETTIMEOFDAY
2303 # undef HAVE_DIFFTIME
2306 # undef HAVE_SNPRINTF
2308 # undef HAVE_VSNPRINTF
2309 #elif (ACC_CC_BORLANDC)
2310 # if (__BORLANDC__ < 0x0400)
2314 # if ((__BORLANDC__ < 0x0410) && ACC_OS_WIN16)
2317 # if (__BORLANDC__ < 0x0550)
2318 # undef HAVE_SNPRINTF
2319 # undef HAVE_VSNPRINTF
2325 # define snprintf _snprintf
2326 # define vsnprintf _vsnprintf
2327 #elif (ACC_OS_DOS32 && ACC_CC_GNUC) && defined(__DJGPP__)
2328 # undef HAVE_SNPRINTF
2329 # undef HAVE_VSNPRINTF
2330 #elif (ACC_OS_DOS32 && ACC_CC_HIGHC)
2331 # undef HAVE_SNPRINTF
2332 # undef HAVE_VSNPRINTF
2334 # undef HAVE_SNPRINTF
2335 # undef HAVE_VSNPRINTF
2336 #elif (ACC_CC_INTELC)
2338 # define snprintf _snprintf
2341 # define vsnprintf _vsnprintf
2343 #elif (ACC_CC_LCCWIN32)
2344 # define utime _utime
2346 # if (_MSC_VER < 600)
2347 # undef HAVE_STRFTIME
2349 # if (_MSC_VER < 700)
2350 # undef HAVE_SNPRINTF
2351 # undef HAVE_VSNPRINTF
2352 # elif (_MSC_VER < 1500)
2354 # define snprintf _snprintf
2357 # define vsnprintf _vsnprintf
2361 # define snprintf _snprintf
2364 # if ((_MSC_VER < 800) && ACC_OS_WIN16)
2367 # if (ACC_ARCH_I086) && defined(__cplusplus)
2368 # undef HAVE_LONGJMP
2371 #elif (ACC_OS_WIN32 && ACC_CC_GNUC) && defined(__MINGW32__)
2372 # if (ACC_CC_GNUC < 0x025f00ul)
2373 # undef HAVE_SNPRINTF
2374 # undef HAVE_VSNPRINTF
2376 # define snprintf _snprintf
2377 # define vsnprintf _vsnprintf
2379 #elif (ACC_OS_WIN32 && ACC_LIBC_MSL)
2380 # if (__MSL__ < 0x8000ul)
2385 # undef HAVE_SNPRINTF
2386 # undef HAVE_STRNICMP
2388 # undef HAVE_VSNPRINTF
2389 # if defined(__cplusplus)
2392 #elif (ACC_CC_PACIFICC)
2396 # undef HAVE_DIFFTIME
2400 # undef HAVE_SNPRINTF
2401 # undef HAVE_STRFTIME
2403 # undef HAVE_VSNPRINTF
2404 #elif (ACC_OS_WIN32 && ACC_CC_PELLESC)
2405 # if (__POCC__ < 280)
2406 # define alloca _alloca
2409 #elif (ACC_OS_WIN32 && ACC_CC_PGI) && defined(__MINGW32__)
2410 # define snprintf _snprintf
2411 # define vsnprintf _vsnprintf
2412 #elif (ACC_OS_WIN32 && ACC_CC_GNUC) && defined(__PW32__)
2413 # undef HAVE_SNPRINTF
2414 # undef HAVE_VSNPRINTF
2415 #elif (ACC_CC_SYMANTECC)
2416 # if (ACC_OS_WIN16 && (ACC_MM_MEDIUM || ACC_MM_LARGE || ACC_MM_HUGE))
2419 # if (__SC__ < 0x600)
2420 # undef HAVE_SNPRINTF
2421 # undef HAVE_VSNPRINTF
2423 # define snprintf _snprintf
2424 # define vsnprintf _vsnprintf
2426 # if (__SC__ < 0x700)
2427 # undef HAVE_DIFFTIME
2430 #elif (ACC_CC_TOPSPEEDC)
2431 # undef HAVE_SNPRINTF
2432 # undef HAVE_VSNPRINTF
2433 #elif (ACC_CC_TURBOC)
2435 # undef HAVE_SNPRINTF
2436 # undef HAVE_VSNPRINTF
2437 # if (__TURBOC__ < 0x0200)
2441 # if (__TURBOC__ < 0x0295)
2443 # undef HAVE_STRFTIME
2445 # if (__TURBOC__ < 0x0400)
2448 #elif (ACC_CC_WATCOMC)
2449 # if (__WATCOMC__ < 1100)
2450 # undef HAVE_SNPRINTF
2451 # undef HAVE_VSNPRINTF
2452 # elif (__WATCOMC__ < 1200)
2453 # define snprintf _snprintf
2454 # define vsnprintf _vsnprintf
2456 #elif (ACC_CC_ZORTECHC)
2457 # if (ACC_OS_WIN16 && (ACC_MM_MEDIUM || ACC_MM_LARGE || ACC_MM_HUGE))
2460 # undef HAVE_DIFFTIME
2461 # undef HAVE_SNPRINTF
2463 # undef HAVE_VSNPRINTF
2466 #if (ACC_OS_CONSOLE)
2470 # undef HAVE_GETTIMEOFDAY
2476 #if (ACC_LIBC_ISOC90 || ACC_LIBC_ISOC99)
2481 # undef HAVE_GETTIMEOFDAY
2492 # undef HAVE_STRICMP
2493 # undef HAVE_STRNICMP
2498 #if !(ACC_CFG_AUTO_NO_SIZES)
2499 #if !defined(SIZEOF_SHORT) && defined(ACC_SIZEOF_SHORT)
2500 # define SIZEOF_SHORT ACC_SIZEOF_SHORT
2502 #if !defined(SIZEOF_INT) && defined(ACC_SIZEOF_INT)
2503 # define SIZEOF_INT ACC_SIZEOF_INT
2505 #if !defined(SIZEOF_LONG) && defined(ACC_SIZEOF_LONG)
2506 # define SIZEOF_LONG ACC_SIZEOF_LONG
2508 #if !defined(SIZEOF_LONG_LONG) && defined(ACC_SIZEOF_LONG_LONG)
2509 # define SIZEOF_LONG_LONG ACC_SIZEOF_LONG_LONG
2511 #if !defined(SIZEOF___INT32) && defined(ACC_SIZEOF___INT32)
2512 # define SIZEOF___INT32 ACC_SIZEOF___INT32
2514 #if !defined(SIZEOF___INT64) && defined(ACC_SIZEOF___INT64)
2515 # define SIZEOF___INT64 ACC_SIZEOF___INT64
2517 #if !defined(SIZEOF_VOID_P) && defined(ACC_SIZEOF_VOID_P)
2518 # define SIZEOF_VOID_P ACC_SIZEOF_VOID_P
2520 #if !defined(SIZEOF_SIZE_T) && defined(ACC_SIZEOF_SIZE_T)
2521 # define SIZEOF_SIZE_T ACC_SIZEOF_SIZE_T
2523 #if !defined(SIZEOF_PTRDIFF_T) && defined(ACC_SIZEOF_PTRDIFF_T)
2524 # define SIZEOF_PTRDIFF_T ACC_SIZEOF_PTRDIFF_T
2527 #if (HAVE_SIGNAL) && !defined(RETSIGTYPE)
2528 # define RETSIGTYPE void
2531 #if (ACC_CFG_NO_ACC_TYPE_H)
2533 #if (ACC_SIZEOF_LONG_LONG+0 > 0)
2534 __acc_gnuc_extension__ typedef long long acc_llong_t;
2535 __acc_gnuc_extension__ typedef unsigned long long acc_ullong_t;
2537 #if (!(ACC_SIZEOF_SHORT+0 > 0 && ACC_SIZEOF_INT+0 > 0 && ACC_SIZEOF_LONG+0 > 0))
2538 # error "missing defines for sizes"
2540 #if (!(ACC_SIZEOF_PTRDIFF_T+0 > 0 && ACC_SIZEOF_SIZE_T+0 > 0 && ACC_SIZEOF_VOID_P+0 > 0))
2541 # error "missing defines for sizes"
2543 #if !defined(acc_int16e_t)
2544 #if (ACC_SIZEOF_LONG == 2)
2545 # define acc_int16e_t long
2546 # define acc_uint16e_t unsigned long
2547 #elif (ACC_SIZEOF_INT == 2)
2548 # define acc_int16e_t int
2549 # define acc_uint16e_t unsigned int
2550 #elif (ACC_SIZEOF_SHORT == 2)
2551 # define acc_int16e_t short int
2552 # define acc_uint16e_t unsigned short int
2553 #elif 1 && !(ACC_CFG_TYPE_NO_MODE_HI) && (ACC_CC_CLANG || (ACC_CC_GNUC >= 0x025f00ul) || ACC_CC_LLVM)
2554 typedef int __acc_int16e_hi_t __attribute__((__mode__(__HI__)));
2555 typedef unsigned int __acc_uint16e_hi_t __attribute__((__mode__(__HI__)));
2556 # define acc_int16e_t __acc_int16e_hi_t
2557 # define acc_uint16e_t __acc_uint16e_hi_t
2558 #elif (ACC_SIZEOF___INT16 == 2)
2559 # define acc_int16e_t __int16
2560 # define acc_uint16e_t unsigned __int16
2564 #if defined(acc_int16e_t)
2565 # define ACC_SIZEOF_ACC_INT16E_T 2
2567 #if !defined(acc_int32e_t)
2568 #if (ACC_SIZEOF_LONG == 4)
2569 # define acc_int32e_t long int
2570 # define acc_uint32e_t unsigned long int
2571 #elif (ACC_SIZEOF_INT == 4)
2572 # define acc_int32e_t int
2573 # define acc_uint32e_t unsigned int
2574 #elif (ACC_SIZEOF_SHORT == 4)
2575 # define acc_int32e_t short int
2576 # define acc_uint32e_t unsigned short int
2577 #elif (ACC_SIZEOF_LONG_LONG == 4)
2578 # define acc_int32e_t acc_llong_t
2579 # define acc_uint32e_t acc_ullong_t
2580 #elif 1 && !(ACC_CFG_TYPE_NO_MODE_SI) && (ACC_CC_CLANG || (ACC_CC_GNUC >= 0x025f00ul) || ACC_CC_LLVM) && (__INT_MAX__+0 > 2147483647L)
2581 typedef int __acc_int32e_si_t __attribute__((__mode__(__SI__)));
2582 typedef unsigned int __acc_uint32e_si_t __attribute__((__mode__(__SI__)));
2583 # define acc_int32e_t __acc_int32e_si_t
2584 # define acc_uint32e_t __acc_uint32e_si_t
2585 #elif 1 && !(ACC_CFG_TYPE_NO_MODE_SI) && (ACC_CC_GNUC >= 0x025f00ul) && defined(__AVR__) && (__LONG_MAX__+0 == 32767L)
2586 typedef int __acc_int32e_si_t __attribute__((__mode__(__SI__)));
2587 typedef unsigned int __acc_uint32e_si_t __attribute__((__mode__(__SI__)));
2588 # define acc_int32e_t __acc_int32e_si_t
2589 # define acc_uint32e_t __acc_uint32e_si_t
2590 # define ACC_INT32_C(c) c##LL
2591 # define ACC_UINT32_C(c) c##ULL
2592 #elif (ACC_SIZEOF___INT32 == 4)
2593 # define acc_int32e_t __int32
2594 # define acc_uint32e_t unsigned __int32
2598 #if defined(acc_int32e_t)
2599 # define ACC_SIZEOF_ACC_INT32E_T 4
2601 #if !defined(acc_int64e_t)
2602 #if (ACC_SIZEOF___INT64 == 8)
2603 # if (ACC_CC_BORLANDC) && !(ACC_CFG_TYPE_PREFER___INT64)
2604 # define ACC_CFG_TYPE_PREFER___INT64 1
2607 #if (ACC_SIZEOF_INT == 8) && (ACC_SIZEOF_INT < ACC_SIZEOF_LONG)
2608 # define acc_int64e_t int
2609 # define acc_uint64e_t unsigned int
2610 # define ACC_SIZEOF_ACC_INT64E_T ACC_SIZEOF_INT
2611 #elif (ACC_SIZEOF_LONG == 8)
2612 # define acc_int64e_t long int
2613 # define acc_uint64e_t unsigned long int
2614 # define ACC_SIZEOF_ACC_INT64E_T ACC_SIZEOF_LONG
2615 #elif (ACC_SIZEOF_LONG_LONG == 8) && !(ACC_CFG_TYPE_PREFER___INT64)
2616 # define acc_int64e_t acc_llong_t
2617 # define acc_uint64e_t acc_ullong_t
2618 # if (ACC_CC_BORLANDC)
2619 # define ACC_INT64_C(c) ((c) + 0ll)
2620 # define ACC_UINT64_C(c) ((c) + 0ull)
2622 # define ACC_INT64_C(c) c##LL
2623 # define ACC_UINT64_C(c) c##ULL
2625 # define ACC_SIZEOF_ACC_INT64E_T ACC_SIZEOF_LONG_LONG
2626 #elif (ACC_SIZEOF___INT64 == 8)
2627 # define acc_int64e_t __int64
2628 # define acc_uint64e_t unsigned __int64
2629 # if (ACC_CC_BORLANDC)
2630 # define ACC_INT64_C(c) ((c) + 0i64)
2631 # define ACC_UINT64_C(c) ((c) + 0ui64)
2633 # define ACC_INT64_C(c) c##i64
2634 # define ACC_UINT64_C(c) c##ui64
2636 # define ACC_SIZEOF_ACC_INT64E_T ACC_SIZEOF___INT64
2640 #if !defined(acc_int32l_t)
2641 #if defined(acc_int32e_t)
2642 # define acc_int32l_t acc_int32e_t
2643 # define acc_uint32l_t acc_uint32e_t
2644 # define ACC_SIZEOF_ACC_INT32L_T ACC_SIZEOF_ACC_INT32E_T
2645 #elif (ACC_SIZEOF_INT >= 4) && (ACC_SIZEOF_INT < ACC_SIZEOF_LONG)
2646 # define acc_int32l_t int
2647 # define acc_uint32l_t unsigned int
2648 # define ACC_SIZEOF_ACC_INT32L_T ACC_SIZEOF_INT
2649 #elif (ACC_SIZEOF_LONG >= 4)
2650 # define acc_int32l_t long int
2651 # define acc_uint32l_t unsigned long int
2652 # define ACC_SIZEOF_ACC_INT32L_T ACC_SIZEOF_LONG
2654 # error "acc_int32l_t"
2657 #if !defined(acc_int64l_t)
2658 #if defined(acc_int64e_t)
2659 # define acc_int64l_t acc_int64e_t
2660 # define acc_uint64l_t acc_uint64e_t
2661 # define ACC_SIZEOF_ACC_INT64L_T ACC_SIZEOF_ACC_INT64E_T
2665 #if !defined(acc_int32f_t)
2666 #if (ACC_SIZEOF_SIZE_T >= 8)
2667 # define acc_int32f_t acc_int64l_t
2668 # define acc_uint32f_t acc_uint64l_t
2669 # define ACC_SIZEOF_ACC_INT32F_T ACC_SIZEOF_ACC_INT64L_T
2671 # define acc_int32f_t acc_int32l_t
2672 # define acc_uint32f_t acc_uint32l_t
2673 # define ACC_SIZEOF_ACC_INT32F_T ACC_SIZEOF_ACC_INT32L_T
2676 #if !defined(acc_intptr_t)
2677 #if 1 && (ACC_OS_OS400 && (ACC_SIZEOF_VOID_P == 16))
2678 # define __ACC_INTPTR_T_IS_POINTER 1
2679 typedef char* acc_intptr_t;
2680 typedef char* acc_uintptr_t;
2681 # define acc_intptr_t acc_intptr_t
2682 # define acc_uintptr_t acc_uintptr_t
2683 # define ACC_SIZEOF_ACC_INTPTR_T ACC_SIZEOF_VOID_P
2684 #elif (ACC_CC_MSC && (_MSC_VER >= 1300) && (ACC_SIZEOF_VOID_P == 4) && (ACC_SIZEOF_INT == 4))
2685 typedef __w64 int acc_intptr_t;
2686 typedef __w64 unsigned int acc_uintptr_t;
2687 # define acc_intptr_t acc_intptr_t
2688 # define acc_uintptr_t acc_uintptr_t
2689 # define ACC_SIZEOF_ACC_INTPTR_T ACC_SIZEOF_INT
2690 #elif (ACC_SIZEOF_SHORT == ACC_SIZEOF_VOID_P) && (ACC_SIZEOF_INT > ACC_SIZEOF_VOID_P)
2691 # define acc_intptr_t short
2692 # define acc_uintptr_t unsigned short
2693 # define ACC_SIZEOF_ACC_INTPTR_T ACC_SIZEOF_SHORT
2694 #elif (ACC_SIZEOF_INT >= ACC_SIZEOF_VOID_P) && (ACC_SIZEOF_INT < ACC_SIZEOF_LONG)
2695 # define acc_intptr_t int
2696 # define acc_uintptr_t unsigned int
2697 # define ACC_SIZEOF_ACC_INTPTR_T ACC_SIZEOF_INT
2698 #elif (ACC_SIZEOF_LONG >= ACC_SIZEOF_VOID_P)
2699 # define acc_intptr_t long
2700 # define acc_uintptr_t unsigned long
2701 # define ACC_SIZEOF_ACC_INTPTR_T ACC_SIZEOF_LONG
2702 #elif (ACC_SIZEOF_ACC_INT64L_T >= ACC_SIZEOF_VOID_P)
2703 # define acc_intptr_t acc_int64l_t
2704 # define acc_uintptr_t acc_uint64l_t
2705 # define ACC_SIZEOF_ACC_INTPTR_T ACC_SIZEOF_ACC_INT64L_T
2707 # error "acc_intptr_t"
2710 #if !defined(acc_word_t)
2711 #if defined(ACC_WORDSIZE) && (ACC_WORDSIZE > 0)
2712 #if (ACC_WORDSIZE == ACC_SIZEOF_ACC_INTPTR_T) && !defined(__ACC_INTPTR_T_IS_POINTER)
2713 # define acc_word_t acc_uintptr_t
2714 # define acc_sword_t acc_intptr_t
2715 # define ACC_SIZEOF_ACC_WORD_T ACC_SIZEOF_ACC_INTPTR_T
2716 #elif (ACC_WORDSIZE == ACC_SIZEOF_LONG)
2717 # define acc_word_t unsigned long
2718 # define acc_sword_t long
2719 # define ACC_SIZEOF_ACC_WORD_T ACC_SIZEOF_LONG
2720 #elif (ACC_WORDSIZE == ACC_SIZEOF_INT)
2721 # define acc_word_t unsigned int
2722 # define acc_sword_t int
2723 # define ACC_SIZEOF_ACC_WORD_T ACC_SIZEOF_INT
2724 #elif (ACC_WORDSIZE == ACC_SIZEOF_SHORT)
2725 # define acc_word_t unsigned short
2726 # define acc_sword_t short
2727 # define ACC_SIZEOF_ACC_WORD_T ACC_SIZEOF_SHORT
2728 #elif (ACC_WORDSIZE == 1)
2729 # define acc_word_t unsigned char
2730 # define acc_sword_t signed char
2731 # define ACC_SIZEOF_ACC_WORD_T 1
2732 #elif (ACC_WORDSIZE == ACC_SIZEOF_ACC_INT64L_T)
2733 # define acc_word_t acc_uint64l_t
2734 # define acc_sword_t acc_int64l_t
2735 # define ACC_SIZEOF_ACC_WORD_T ACC_SIZEOF_ACC_INT64L_T
2736 #elif (ACC_ARCH_SPU) && (ACC_CC_GNUC)
2738 typedef unsigned acc_word_t __attribute__((__mode__(__V16QI__)));
2739 typedef int acc_sword_t __attribute__((__mode__(__V16QI__)));
2740 # define acc_word_t acc_word_t
2741 # define acc_sword_t acc_sword_t
2742 # define ACC_SIZEOF_ACC_WORD_T 16
2745 # error "acc_word_t"
2749 #if !defined(ACC_INT16_C)
2750 # if (ACC_BROKEN_INTEGRAL_CONSTANTS) && (ACC_SIZEOF_INT >= 2)
2751 # define ACC_INT16_C(c) ((c) + 0)
2752 # define ACC_UINT16_C(c) ((c) + 0U)
2753 # elif (ACC_BROKEN_INTEGRAL_CONSTANTS) && (ACC_SIZEOF_LONG >= 2)
2754 # define ACC_INT16_C(c) ((c) + 0L)
2755 # define ACC_UINT16_C(c) ((c) + 0UL)
2756 # elif (ACC_SIZEOF_INT >= 2)
2757 # define ACC_INT16_C(c) c
2758 # define ACC_UINT16_C(c) c##U
2759 # elif (ACC_SIZEOF_LONG >= 2)
2760 # define ACC_INT16_C(c) c##L
2761 # define ACC_UINT16_C(c) c##UL
2763 # error "ACC_INT16_C"
2766 #if !defined(ACC_INT32_C)
2767 # if (ACC_BROKEN_INTEGRAL_CONSTANTS) && (ACC_SIZEOF_INT >= 4)
2768 # define ACC_INT32_C(c) ((c) + 0)
2769 # define ACC_UINT32_C(c) ((c) + 0U)
2770 # elif (ACC_BROKEN_INTEGRAL_CONSTANTS) && (ACC_SIZEOF_LONG >= 4)
2771 # define ACC_INT32_C(c) ((c) + 0L)
2772 # define ACC_UINT32_C(c) ((c) + 0UL)
2773 # elif (ACC_SIZEOF_INT >= 4)
2774 # define ACC_INT32_C(c) c
2775 # define ACC_UINT32_C(c) c##U
2776 # elif (ACC_SIZEOF_LONG >= 4)
2777 # define ACC_INT32_C(c) c##L
2778 # define ACC_UINT32_C(c) c##UL
2779 # elif (ACC_SIZEOF_LONG_LONG >= 4)
2780 # define ACC_INT32_C(c) c##LL
2781 # define ACC_UINT32_C(c) c##ULL
2783 # error "ACC_INT32_C"
2786 #if !defined(ACC_INT64_C) && defined(acc_int64l_t)
2787 # if (ACC_BROKEN_INTEGRAL_CONSTANTS) && (ACC_SIZEOF_INT >= 8)
2788 # define ACC_INT64_C(c) ((c) + 0)
2789 # define ACC_UINT64_C(c) ((c) + 0U)
2790 # elif (ACC_BROKEN_INTEGRAL_CONSTANTS) && (ACC_SIZEOF_LONG >= 8)
2791 # define ACC_INT64_C(c) ((c) + 0L)
2792 # define ACC_UINT64_C(c) ((c) + 0UL)
2793 # elif (ACC_SIZEOF_INT >= 8)
2794 # define ACC_INT64_C(c) c
2795 # define ACC_UINT64_C(c) c##U
2796 # elif (ACC_SIZEOF_LONG >= 8)
2797 # define ACC_INT64_C(c) c##L
2798 # define ACC_UINT64_C(c) c##UL
2800 # error "ACC_INT64_C"
2803 #if !defined(SIZEOF_ACC_INT16E_T) && defined(ACC_SIZEOF_ACC_INT16E_T)
2804 # define SIZEOF_ACC_INT16E_T ACC_SIZEOF_ACC_INT16E_T
2806 #if !defined(SIZEOF_ACC_INT32E_T) && defined(ACC_SIZEOF_ACC_INT32E_T)
2807 # define SIZEOF_ACC_INT32E_T ACC_SIZEOF_ACC_INT32E_T
2809 #if !defined(SIZEOF_ACC_INT64E_T) && defined(ACC_SIZEOF_ACC_INT64E_T)
2810 # define SIZEOF_ACC_INT64E_T ACC_SIZEOF_ACC_INT64E_T
2812 #if !defined(SIZEOF_ACC_INT32L_T) && defined(ACC_SIZEOF_ACC_INT32L_T)
2813 # define SIZEOF_ACC_INT32L_T ACC_SIZEOF_ACC_INT32L_T
2815 #if !defined(SIZEOF_ACC_INT64L_T) && defined(ACC_SIZEOF_ACC_INT64L_T)
2816 # define SIZEOF_ACC_INT64L_T ACC_SIZEOF_ACC_INT64L_T
2818 #if !defined(SIZEOF_ACC_INT32F_T) && defined(ACC_SIZEOF_ACC_INT32F_T)
2819 # define SIZEOF_ACC_INT32F_T ACC_SIZEOF_ACC_INT32F_T
2821 #if !defined(SIZEOF_ACC_INTPTR_T) && defined(ACC_SIZEOF_ACC_INTPTR_T)
2822 # define SIZEOF_ACC_INTPTR_T ACC_SIZEOF_ACC_INTPTR_T
2824 #if !defined(SIZEOF_ACC_WORD_T) && defined(ACC_SIZEOF_ACC_WORD_T)
2825 # define SIZEOF_ACC_WORD_T ACC_SIZEOF_ACC_WORD_T
2827 #if 1 && !defined(acc_signo_t) && defined(__linux__) && defined(__dietlibc__) && (ACC_SIZEOF_INT != 4)
2828 # define acc_signo_t acc_int32e_t
2830 #if !defined(acc_signo_t)
2831 # define acc_signo_t int
2833 #if defined(__cplusplus)
2836 #if (ACC_BROKEN_CDECL_ALT_SYNTAX)
2837 typedef void __acc_cdecl_sighandler (*acc_sighandler_t)(acc_signo_t);
2838 #elif defined(RETSIGTYPE)
2839 typedef RETSIGTYPE (__acc_cdecl_sighandler *acc_sighandler_t)(acc_signo_t);
2841 typedef void (__acc_cdecl_sighandler *acc_sighandler_t)(acc_signo_t);
2843 #if defined(__cplusplus)
2846 # if (ACC_CFG_NO_ACC_UA_H)
2848 #if (ACC_CC_GNUC && (ACC_CC_GNUC < 0x020700ul))
2849 #elif (ACC_CC_GNUC && (ACC_CC_GNUC < 0x020800ul)) && defined(__cplusplus)
2850 #elif (ACC_CC_INTELC) && defined(_WIN32)
2851 #elif (ACC_CC_INTELC && (__INTEL_COMPILER < 700))
2853 #elif (ACC_CC_GNUC || ACC_CC_INTELC || ACC_CC_PATHSCALE)
2854 #if !defined(__acc_ua16_t) && (ACC_OPT_UNALIGNED16) && defined(acc_int16e_t)
2855 typedef struct { __acc_ua_volatile acc_uint16e_t v __attribute__((__packed__)); } __acc_ua16_t;
2856 # define __acc_ua16_t __acc_ua16_t
2858 #if !defined(__acc_ua32_t) && (ACC_OPT_UNALIGNED32) && defined(acc_int32e_t)
2859 typedef struct { __acc_ua_volatile acc_uint32e_t v __attribute__((__packed__)); } __acc_ua32_t;
2860 # define __acc_ua32_t __acc_ua32_t
2862 #if !defined(__acc_ua64_t) && (ACC_OPT_UNALIGNED64) && defined(acc_int64l_t)
2863 typedef struct { __acc_ua_volatile acc_uint64l_t v __attribute__((__packed__)); } __acc_ua64_t;
2864 # define __acc_ua64_t __acc_ua64_t
2867 #if (ACC_OPT_UNALIGNED16) && defined(acc_int16e_t)
2868 #define ACC_UA_GET16(p) (* (__acc_ua_volatile const acc_uint16e_t*) (__acc_ua_volatile const void*) (p))
2869 #define ACC_UA_SET16(p,v) ((* (__acc_ua_volatile acc_uint16e_t*) (__acc_ua_volatile void*) (p)) = (acc_uint16e_t) (v))
2870 #if (ACC_ABI_BIG_ENDIAN)
2871 # define ACC_UA_GET_BE16(p) ACC_UA_GET16(p)
2872 # define ACC_UA_SET_BE16(p,v) ACC_UA_SET16(p,v)
2873 #elif (ACC_ABI_LITTLE_ENDIAN)
2874 # define ACC_UA_GET_LE16(p) ACC_UA_GET16(p)
2875 # define ACC_UA_SET_LE16(p,v) ACC_UA_SET16(p,v)
2877 #if !(ACC_CFG_NO_INLINE_ASM) && (__acc_HAVE_forceinline)
2878 #if (ACC_ARCH_POWERPC && ACC_ABI_BIG_ENDIAN) && (ACC_CC_GNUC)
2879 #if !defined(ACC_UA_GET_LE16)
2880 extern __acc_forceinline unsigned long __ACC_UA_GET_LE16(__acc_ua_volatile const void* pp);
2881 extern __acc_forceinline unsigned long __ACC_UA_GET_LE16(__acc_ua_volatile const void* pp) {
2882 __acc_ua_volatile const acc_uint16e_t* p = (__acc_ua_volatile const acc_uint16e_t*) pp;
2884 __asm__ __volatile__("lhbrx %0,0,%1" : "=r" (v) : "r" (p), "m" (*p));
2887 #define ACC_UA_GET_LE16(p) __ACC_UA_GET_LE16(p)
2889 #if !defined(ACC_UA_SET_LE16)
2890 extern __acc_forceinline void __ACC_UA_SET_LE16(__acc_ua_volatile void* pp, unsigned long v);
2891 extern __acc_forceinline void __ACC_UA_SET_LE16(__acc_ua_volatile void* pp, unsigned long v) {
2892 __acc_ua_volatile acc_uint16e_t* p = (__acc_ua_volatile acc_uint16e_t*) pp;
2893 __asm__ __volatile__("sthbrx %2,0,%1" : "=m" (*p) : "r" (p), "r" (v));
2895 #define ACC_UA_SET_LE16(p,v) __ACC_UA_SET_LE16(p,v)
2899 #if !defined(ACC_UA_COPY16)
2900 # define ACC_UA_COPY16(d,s) ACC_UA_SET16(d, ACC_UA_GET16(s))
2903 #if (ACC_OPT_UNALIGNED32) && defined(acc_int32e_t)
2904 #define ACC_UA_GET32(p) (* (__acc_ua_volatile const acc_uint32e_t*) (__acc_ua_volatile const void*) (p))
2905 #define ACC_UA_SET32(p,v) ((* (__acc_ua_volatile acc_uint32e_t*) (__acc_ua_volatile void*) (p)) = (acc_uint32e_t) (v))
2906 #if (ACC_ABI_BIG_ENDIAN)
2907 # define ACC_UA_GET_BE32(p) ACC_UA_GET32(p)
2908 # define ACC_UA_SET_BE32(p,v) ACC_UA_SET32(p,v)
2909 #elif (ACC_ABI_LITTLE_ENDIAN)
2910 # define ACC_UA_GET_LE32(p) ACC_UA_GET32(p)
2911 # define ACC_UA_SET_LE32(p,v) ACC_UA_SET32(p,v)
2913 #if !(ACC_CFG_NO_INLINE_ASM) && (__acc_HAVE_forceinline)
2914 #if (ACC_ARCH_POWERPC && ACC_ABI_BIG_ENDIAN) && (ACC_CC_GNUC)
2915 #if !defined(ACC_UA_GET_LE32)
2916 extern __acc_forceinline unsigned long __ACC_UA_GET_LE32(__acc_ua_volatile const void* pp);
2917 extern __acc_forceinline unsigned long __ACC_UA_GET_LE32(__acc_ua_volatile const void* pp) {
2918 __acc_ua_volatile const acc_uint32e_t* p = (__acc_ua_volatile const acc_uint32e_t*) pp;
2920 __asm__ __volatile__("lwbrx %0,0,%1" : "=r" (v) : "r" (p), "m" (*p));
2923 #define ACC_UA_GET_LE32(p) __ACC_UA_GET_LE32(p)
2925 #if !defined(ACC_UA_SET_LE32)
2926 extern __acc_forceinline void __ACC_UA_SET_LE32(__acc_ua_volatile void* pp, unsigned long v);
2927 extern __acc_forceinline void __ACC_UA_SET_LE32(__acc_ua_volatile void* pp, unsigned long v) {
2928 __acc_ua_volatile acc_uint32e_t* p = (__acc_ua_volatile acc_uint32e_t*) pp;
2929 __asm__ __volatile__("stwbrx %2,0,%1" : "=m" (*p) : "r" (p), "r" (v));
2931 #define ACC_UA_SET_LE32(p,v) __ACC_UA_SET_LE32(p,v)
2935 #if !defined(ACC_UA_COPY32)
2936 # define ACC_UA_COPY32(d,s) ACC_UA_SET32(d, ACC_UA_GET32(s))
2939 #if (ACC_OPT_UNALIGNED64) && defined(acc_int64l_t)
2940 #define ACC_UA_GET64(p) (* (__acc_ua_volatile const acc_uint64l_t*) (__acc_ua_volatile const void*) (p))
2941 #define ACC_UA_SET64(p,v) ((* (__acc_ua_volatile acc_uint64l_t*) (__acc_ua_volatile void*) (p)) = (acc_uint64l_t) (v))
2942 #if (ACC_ABI_BIG_ENDIAN)
2943 # define ACC_UA_GET_BE64(p) ACC_UA_GET64(p)
2944 # define ACC_UA_SET_BE64(p,v) ACC_UA_SET64(p,v)
2945 #elif (ACC_ABI_LITTLE_ENDIAN)
2946 # define ACC_UA_GET_LE64(p) ACC_UA_GET64(p)
2947 # define ACC_UA_SET_LE64(p,v) ACC_UA_SET64(p,v)
2949 #if !defined(ACC_UA_COPY64)
2950 # define ACC_UA_COPY64(d,s) ACC_UA_SET64(d, ACC_UA_GET64(s))
2956 #if defined(ACC_WANT_ACC_TYPE_H)
2957 # undef ACC_WANT_ACC_TYPE_H
2958 # if defined(ACC_CFG_NO_ACC_TYPE_H)
2959 # error "ACC_WANT_ACC_TYPE_H with ACC_CFG_NO_ACC_TYPE_H"
2961 #if (ACC_SIZEOF_LONG_LONG+0 > 0)
2962 __acc_gnuc_extension__ typedef long long acc_llong_t;
2963 __acc_gnuc_extension__ typedef unsigned long long acc_ullong_t;
2965 #if (!(ACC_SIZEOF_SHORT+0 > 0 && ACC_SIZEOF_INT+0 > 0 && ACC_SIZEOF_LONG+0 > 0))
2966 # error "missing defines for sizes"
2968 #if (!(ACC_SIZEOF_PTRDIFF_T+0 > 0 && ACC_SIZEOF_SIZE_T+0 > 0 && ACC_SIZEOF_VOID_P+0 > 0))
2969 # error "missing defines for sizes"
2971 #if !defined(acc_int16e_t)
2972 #if (ACC_SIZEOF_LONG == 2)
2973 # define acc_int16e_t long
2974 # define acc_uint16e_t unsigned long
2975 #elif (ACC_SIZEOF_INT == 2)
2976 # define acc_int16e_t int
2977 # define acc_uint16e_t unsigned int
2978 #elif (ACC_SIZEOF_SHORT == 2)
2979 # define acc_int16e_t short int
2980 # define acc_uint16e_t unsigned short int
2981 #elif 1 && !(ACC_CFG_TYPE_NO_MODE_HI) && (ACC_CC_CLANG || (ACC_CC_GNUC >= 0x025f00ul) || ACC_CC_LLVM)
2982 typedef int __acc_int16e_hi_t __attribute__((__mode__(__HI__)));
2983 typedef unsigned int __acc_uint16e_hi_t __attribute__((__mode__(__HI__)));
2984 # define acc_int16e_t __acc_int16e_hi_t
2985 # define acc_uint16e_t __acc_uint16e_hi_t
2986 #elif (ACC_SIZEOF___INT16 == 2)
2987 # define acc_int16e_t __int16
2988 # define acc_uint16e_t unsigned __int16
2992 #if defined(acc_int16e_t)
2993 # define ACC_SIZEOF_ACC_INT16E_T 2
2995 #if !defined(acc_int32e_t)
2996 #if (ACC_SIZEOF_LONG == 4)
2997 # define acc_int32e_t long int
2998 # define acc_uint32e_t unsigned long int
2999 #elif (ACC_SIZEOF_INT == 4)
3000 # define acc_int32e_t int
3001 # define acc_uint32e_t unsigned int
3002 #elif (ACC_SIZEOF_SHORT == 4)
3003 # define acc_int32e_t short int
3004 # define acc_uint32e_t unsigned short int
3005 #elif (ACC_SIZEOF_LONG_LONG == 4)
3006 # define acc_int32e_t acc_llong_t
3007 # define acc_uint32e_t acc_ullong_t
3008 #elif 1 && !(ACC_CFG_TYPE_NO_MODE_SI) && (ACC_CC_CLANG || (ACC_CC_GNUC >= 0x025f00ul) || ACC_CC_LLVM) && (__INT_MAX__+0 > 2147483647L)
3009 typedef int __acc_int32e_si_t __attribute__((__mode__(__SI__)));
3010 typedef unsigned int __acc_uint32e_si_t __attribute__((__mode__(__SI__)));
3011 # define acc_int32e_t __acc_int32e_si_t
3012 # define acc_uint32e_t __acc_uint32e_si_t
3013 #elif 1 && !(ACC_CFG_TYPE_NO_MODE_SI) && (ACC_CC_GNUC >= 0x025f00ul) && defined(__AVR__) && (__LONG_MAX__+0 == 32767L)
3014 typedef int __acc_int32e_si_t __attribute__((__mode__(__SI__)));
3015 typedef unsigned int __acc_uint32e_si_t __attribute__((__mode__(__SI__)));
3016 # define acc_int32e_t __acc_int32e_si_t
3017 # define acc_uint32e_t __acc_uint32e_si_t
3018 # define ACC_INT32_C(c) c##LL
3019 # define ACC_UINT32_C(c) c##ULL
3020 #elif (ACC_SIZEOF___INT32 == 4)
3021 # define acc_int32e_t __int32
3022 # define acc_uint32e_t unsigned __int32
3026 #if defined(acc_int32e_t)
3027 # define ACC_SIZEOF_ACC_INT32E_T 4
3029 #if !defined(acc_int64e_t)
3030 #if (ACC_SIZEOF___INT64 == 8)
3031 # if (ACC_CC_BORLANDC) && !(ACC_CFG_TYPE_PREFER___INT64)
3032 # define ACC_CFG_TYPE_PREFER___INT64 1
3035 #if (ACC_SIZEOF_INT == 8) && (ACC_SIZEOF_INT < ACC_SIZEOF_LONG)
3036 # define acc_int64e_t int
3037 # define acc_uint64e_t unsigned int
3038 # define ACC_SIZEOF_ACC_INT64E_T ACC_SIZEOF_INT
3039 #elif (ACC_SIZEOF_LONG == 8)
3040 # define acc_int64e_t long int
3041 # define acc_uint64e_t unsigned long int
3042 # define ACC_SIZEOF_ACC_INT64E_T ACC_SIZEOF_LONG
3043 #elif (ACC_SIZEOF_LONG_LONG == 8) && !(ACC_CFG_TYPE_PREFER___INT64)
3044 # define acc_int64e_t acc_llong_t
3045 # define acc_uint64e_t acc_ullong_t
3046 # if (ACC_CC_BORLANDC)
3047 # define ACC_INT64_C(c) ((c) + 0ll)
3048 # define ACC_UINT64_C(c) ((c) + 0ull)
3050 # define ACC_INT64_C(c) c##LL
3051 # define ACC_UINT64_C(c) c##ULL
3053 # define ACC_SIZEOF_ACC_INT64E_T ACC_SIZEOF_LONG_LONG
3054 #elif (ACC_SIZEOF___INT64 == 8)
3055 # define acc_int64e_t __int64
3056 # define acc_uint64e_t unsigned __int64
3057 # if (ACC_CC_BORLANDC)
3058 # define ACC_INT64_C(c) ((c) + 0i64)
3059 # define ACC_UINT64_C(c) ((c) + 0ui64)
3061 # define ACC_INT64_C(c) c##i64
3062 # define ACC_UINT64_C(c) c##ui64
3064 # define ACC_SIZEOF_ACC_INT64E_T ACC_SIZEOF___INT64
3068 #if !defined(acc_int32l_t)
3069 #if defined(acc_int32e_t)
3070 # define acc_int32l_t acc_int32e_t
3071 # define acc_uint32l_t acc_uint32e_t
3072 # define ACC_SIZEOF_ACC_INT32L_T ACC_SIZEOF_ACC_INT32E_T
3073 #elif (ACC_SIZEOF_INT >= 4) && (ACC_SIZEOF_INT < ACC_SIZEOF_LONG)
3074 # define acc_int32l_t int
3075 # define acc_uint32l_t unsigned int
3076 # define ACC_SIZEOF_ACC_INT32L_T ACC_SIZEOF_INT
3077 #elif (ACC_SIZEOF_LONG >= 4)
3078 # define acc_int32l_t long int
3079 # define acc_uint32l_t unsigned long int
3080 # define ACC_SIZEOF_ACC_INT32L_T ACC_SIZEOF_LONG
3082 # error "acc_int32l_t"
3085 #if !defined(acc_int64l_t)
3086 #if defined(acc_int64e_t)
3087 # define acc_int64l_t acc_int64e_t
3088 # define acc_uint64l_t acc_uint64e_t
3089 # define ACC_SIZEOF_ACC_INT64L_T ACC_SIZEOF_ACC_INT64E_T
3093 #if !defined(acc_int32f_t)
3094 #if (ACC_SIZEOF_SIZE_T >= 8)
3095 # define acc_int32f_t acc_int64l_t
3096 # define acc_uint32f_t acc_uint64l_t
3097 # define ACC_SIZEOF_ACC_INT32F_T ACC_SIZEOF_ACC_INT64L_T
3099 # define acc_int32f_t acc_int32l_t
3100 # define acc_uint32f_t acc_uint32l_t
3101 # define ACC_SIZEOF_ACC_INT32F_T ACC_SIZEOF_ACC_INT32L_T
3104 #if !defined(acc_intptr_t)
3105 #if 1 && (ACC_OS_OS400 && (ACC_SIZEOF_VOID_P == 16))
3106 # define __ACC_INTPTR_T_IS_POINTER 1
3107 typedef char* acc_intptr_t;
3108 typedef char* acc_uintptr_t;
3109 # define acc_intptr_t acc_intptr_t
3110 # define acc_uintptr_t acc_uintptr_t
3111 # define ACC_SIZEOF_ACC_INTPTR_T ACC_SIZEOF_VOID_P
3112 #elif (ACC_CC_MSC && (_MSC_VER >= 1300) && (ACC_SIZEOF_VOID_P == 4) && (ACC_SIZEOF_INT == 4))
3113 typedef __w64 int acc_intptr_t;
3114 typedef __w64 unsigned int acc_uintptr_t;
3115 # define acc_intptr_t acc_intptr_t
3116 # define acc_uintptr_t acc_uintptr_t
3117 # define ACC_SIZEOF_ACC_INTPTR_T ACC_SIZEOF_INT
3118 #elif (ACC_SIZEOF_SHORT == ACC_SIZEOF_VOID_P) && (ACC_SIZEOF_INT > ACC_SIZEOF_VOID_P)
3119 # define acc_intptr_t short
3120 # define acc_uintptr_t unsigned short
3121 # define ACC_SIZEOF_ACC_INTPTR_T ACC_SIZEOF_SHORT
3122 #elif (ACC_SIZEOF_INT >= ACC_SIZEOF_VOID_P) && (ACC_SIZEOF_INT < ACC_SIZEOF_LONG)
3123 # define acc_intptr_t int
3124 # define acc_uintptr_t unsigned int
3125 # define ACC_SIZEOF_ACC_INTPTR_T ACC_SIZEOF_INT
3126 #elif (ACC_SIZEOF_LONG >= ACC_SIZEOF_VOID_P)
3127 # define acc_intptr_t long
3128 # define acc_uintptr_t unsigned long
3129 # define ACC_SIZEOF_ACC_INTPTR_T ACC_SIZEOF_LONG
3130 #elif (ACC_SIZEOF_ACC_INT64L_T >= ACC_SIZEOF_VOID_P)
3131 # define acc_intptr_t acc_int64l_t
3132 # define acc_uintptr_t acc_uint64l_t
3133 # define ACC_SIZEOF_ACC_INTPTR_T ACC_SIZEOF_ACC_INT64L_T
3135 # error "acc_intptr_t"
3138 #if !defined(acc_word_t)
3139 #if defined(ACC_WORDSIZE) && (ACC_WORDSIZE > 0)
3140 #if (ACC_WORDSIZE == ACC_SIZEOF_ACC_INTPTR_T) && !defined(__ACC_INTPTR_T_IS_POINTER)
3141 # define acc_word_t acc_uintptr_t
3142 # define acc_sword_t acc_intptr_t
3143 # define ACC_SIZEOF_ACC_WORD_T ACC_SIZEOF_ACC_INTPTR_T
3144 #elif (ACC_WORDSIZE == ACC_SIZEOF_LONG)
3145 # define acc_word_t unsigned long
3146 # define acc_sword_t long
3147 # define ACC_SIZEOF_ACC_WORD_T ACC_SIZEOF_LONG
3148 #elif (ACC_WORDSIZE == ACC_SIZEOF_INT)
3149 # define acc_word_t unsigned int
3150 # define acc_sword_t int
3151 # define ACC_SIZEOF_ACC_WORD_T ACC_SIZEOF_INT
3152 #elif (ACC_WORDSIZE == ACC_SIZEOF_SHORT)
3153 # define acc_word_t unsigned short
3154 # define acc_sword_t short
3155 # define ACC_SIZEOF_ACC_WORD_T ACC_SIZEOF_SHORT
3156 #elif (ACC_WORDSIZE == 1)
3157 # define acc_word_t unsigned char
3158 # define acc_sword_t signed char
3159 # define ACC_SIZEOF_ACC_WORD_T 1
3160 #elif (ACC_WORDSIZE == ACC_SIZEOF_ACC_INT64L_T)
3161 # define acc_word_t acc_uint64l_t
3162 # define acc_sword_t acc_int64l_t
3163 # define ACC_SIZEOF_ACC_WORD_T ACC_SIZEOF_ACC_INT64L_T
3164 #elif (ACC_ARCH_SPU) && (ACC_CC_GNUC)
3166 typedef unsigned acc_word_t __attribute__((__mode__(__V16QI__)));
3167 typedef int acc_sword_t __attribute__((__mode__(__V16QI__)));
3168 # define acc_word_t acc_word_t
3169 # define acc_sword_t acc_sword_t
3170 # define ACC_SIZEOF_ACC_WORD_T 16
3173 # error "acc_word_t"
3177 #if !defined(ACC_INT16_C)
3178 # if (ACC_BROKEN_INTEGRAL_CONSTANTS) && (ACC_SIZEOF_INT >= 2)
3179 # define ACC_INT16_C(c) ((c) + 0)
3180 # define ACC_UINT16_C(c) ((c) + 0U)
3181 # elif (ACC_BROKEN_INTEGRAL_CONSTANTS) && (ACC_SIZEOF_LONG >= 2)
3182 # define ACC_INT16_C(c) ((c) + 0L)
3183 # define ACC_UINT16_C(c) ((c) + 0UL)
3184 # elif (ACC_SIZEOF_INT >= 2)
3185 # define ACC_INT16_C(c) c
3186 # define ACC_UINT16_C(c) c##U
3187 # elif (ACC_SIZEOF_LONG >= 2)
3188 # define ACC_INT16_C(c) c##L
3189 # define ACC_UINT16_C(c) c##UL
3191 # error "ACC_INT16_C"
3194 #if !defined(ACC_INT32_C)
3195 # if (ACC_BROKEN_INTEGRAL_CONSTANTS) && (ACC_SIZEOF_INT >= 4)
3196 # define ACC_INT32_C(c) ((c) + 0)
3197 # define ACC_UINT32_C(c) ((c) + 0U)
3198 # elif (ACC_BROKEN_INTEGRAL_CONSTANTS) && (ACC_SIZEOF_LONG >= 4)
3199 # define ACC_INT32_C(c) ((c) + 0L)
3200 # define ACC_UINT32_C(c) ((c) + 0UL)
3201 # elif (ACC_SIZEOF_INT >= 4)
3202 # define ACC_INT32_C(c) c
3203 # define ACC_UINT32_C(c) c##U
3204 # elif (ACC_SIZEOF_LONG >= 4)
3205 # define ACC_INT32_C(c) c##L
3206 # define ACC_UINT32_C(c) c##UL
3207 # elif (ACC_SIZEOF_LONG_LONG >= 4)
3208 # define ACC_INT32_C(c) c##LL
3209 # define ACC_UINT32_C(c) c##ULL
3211 # error "ACC_INT32_C"
3214 #if !defined(ACC_INT64_C) && defined(acc_int64l_t)
3215 # if (ACC_BROKEN_INTEGRAL_CONSTANTS) && (ACC_SIZEOF_INT >= 8)
3216 # define ACC_INT64_C(c) ((c) + 0)
3217 # define ACC_UINT64_C(c) ((c) + 0U)
3218 # elif (ACC_BROKEN_INTEGRAL_CONSTANTS) && (ACC_SIZEOF_LONG >= 8)
3219 # define ACC_INT64_C(c) ((c) + 0L)
3220 # define ACC_UINT64_C(c) ((c) + 0UL)
3221 # elif (ACC_SIZEOF_INT >= 8)
3222 # define ACC_INT64_C(c) c
3223 # define ACC_UINT64_C(c) c##U
3224 # elif (ACC_SIZEOF_LONG >= 8)
3225 # define ACC_INT64_C(c) c##L
3226 # define ACC_UINT64_C(c) c##UL
3228 # error "ACC_INT64_C"
3231 #if !defined(SIZEOF_ACC_INT16E_T) && defined(ACC_SIZEOF_ACC_INT16E_T)
3232 # define SIZEOF_ACC_INT16E_T ACC_SIZEOF_ACC_INT16E_T
3234 #if !defined(SIZEOF_ACC_INT32E_T) && defined(ACC_SIZEOF_ACC_INT32E_T)
3235 # define SIZEOF_ACC_INT32E_T ACC_SIZEOF_ACC_INT32E_T
3237 #if !defined(SIZEOF_ACC_INT64E_T) && defined(ACC_SIZEOF_ACC_INT64E_T)
3238 # define SIZEOF_ACC_INT64E_T ACC_SIZEOF_ACC_INT64E_T
3240 #if !defined(SIZEOF_ACC_INT32L_T) && defined(ACC_SIZEOF_ACC_INT32L_T)
3241 # define SIZEOF_ACC_INT32L_T ACC_SIZEOF_ACC_INT32L_T
3243 #if !defined(SIZEOF_ACC_INT64L_T) && defined(ACC_SIZEOF_ACC_INT64L_T)
3244 # define SIZEOF_ACC_INT64L_T ACC_SIZEOF_ACC_INT64L_T
3246 #if !defined(SIZEOF_ACC_INT32F_T) && defined(ACC_SIZEOF_ACC_INT32F_T)
3247 # define SIZEOF_ACC_INT32F_T ACC_SIZEOF_ACC_INT32F_T
3249 #if !defined(SIZEOF_ACC_INTPTR_T) && defined(ACC_SIZEOF_ACC_INTPTR_T)
3250 # define SIZEOF_ACC_INTPTR_T ACC_SIZEOF_ACC_INTPTR_T
3252 #if !defined(SIZEOF_ACC_WORD_T) && defined(ACC_SIZEOF_ACC_WORD_T)
3253 # define SIZEOF_ACC_WORD_T ACC_SIZEOF_ACC_WORD_T
3255 #if 1 && !defined(acc_signo_t) && defined(__linux__) && defined(__dietlibc__) && (ACC_SIZEOF_INT != 4)
3256 # define acc_signo_t acc_int32e_t
3258 #if !defined(acc_signo_t)
3259 # define acc_signo_t int
3261 #if defined(__cplusplus)
3264 #if (ACC_BROKEN_CDECL_ALT_SYNTAX)
3265 typedef void __acc_cdecl_sighandler (*acc_sighandler_t)(acc_signo_t);
3266 #elif defined(RETSIGTYPE)
3267 typedef RETSIGTYPE (__acc_cdecl_sighandler *acc_sighandler_t)(acc_signo_t);
3269 typedef void (__acc_cdecl_sighandler *acc_sighandler_t)(acc_signo_t);
3271 #if defined(__cplusplus)
3274 # if !defined(ACC_CFG_NO_ACC_UA_H)
3275 #if (ACC_CC_GNUC && (ACC_CC_GNUC < 0x020700ul))
3276 #elif (ACC_CC_GNUC && (ACC_CC_GNUC < 0x020800ul)) && defined(__cplusplus)
3277 #elif (ACC_CC_INTELC) && defined(_WIN32)
3278 #elif (ACC_CC_INTELC && (__INTEL_COMPILER < 700))
3280 #elif (ACC_CC_GNUC || ACC_CC_INTELC || ACC_CC_PATHSCALE)
3281 #if !defined(__acc_ua16_t) && (ACC_OPT_UNALIGNED16) && defined(acc_int16e_t)
3282 typedef struct { __acc_ua_volatile acc_uint16e_t v __attribute__((__packed__)); } __acc_ua16_t;
3283 # define __acc_ua16_t __acc_ua16_t
3285 #if !defined(__acc_ua32_t) && (ACC_OPT_UNALIGNED32) && defined(acc_int32e_t)
3286 typedef struct { __acc_ua_volatile acc_uint32e_t v __attribute__((__packed__)); } __acc_ua32_t;
3287 # define __acc_ua32_t __acc_ua32_t
3289 #if !defined(__acc_ua64_t) && (ACC_OPT_UNALIGNED64) && defined(acc_int64l_t)
3290 typedef struct { __acc_ua_volatile acc_uint64l_t v __attribute__((__packed__)); } __acc_ua64_t;
3291 # define __acc_ua64_t __acc_ua64_t
3294 #if (ACC_OPT_UNALIGNED16) && defined(acc_int16e_t)
3295 #define ACC_UA_GET16(p) (* (__acc_ua_volatile const acc_uint16e_t*) (__acc_ua_volatile const void*) (p))
3296 #define ACC_UA_SET16(p,v) ((* (__acc_ua_volatile acc_uint16e_t*) (__acc_ua_volatile void*) (p)) = (acc_uint16e_t) (v))
3297 #if (ACC_ABI_BIG_ENDIAN)
3298 # define ACC_UA_GET_BE16(p) ACC_UA_GET16(p)
3299 # define ACC_UA_SET_BE16(p,v) ACC_UA_SET16(p,v)
3300 #elif (ACC_ABI_LITTLE_ENDIAN)
3301 # define ACC_UA_GET_LE16(p) ACC_UA_GET16(p)
3302 # define ACC_UA_SET_LE16(p,v) ACC_UA_SET16(p,v)
3304 #if !(ACC_CFG_NO_INLINE_ASM) && (__acc_HAVE_forceinline)
3305 #if (ACC_ARCH_POWERPC && ACC_ABI_BIG_ENDIAN) && (ACC_CC_GNUC)
3306 #if !defined(ACC_UA_GET_LE16)
3307 extern __acc_forceinline unsigned long __ACC_UA_GET_LE16(__acc_ua_volatile const void* pp);
3308 extern __acc_forceinline unsigned long __ACC_UA_GET_LE16(__acc_ua_volatile const void* pp) {
3309 __acc_ua_volatile const acc_uint16e_t* p = (__acc_ua_volatile const acc_uint16e_t*) pp;
3311 __asm__ __volatile__("lhbrx %0,0,%1" : "=r" (v) : "r" (p), "m" (*p));
3314 #define ACC_UA_GET_LE16(p) __ACC_UA_GET_LE16(p)
3316 #if !defined(ACC_UA_SET_LE16)
3317 extern __acc_forceinline void __ACC_UA_SET_LE16(__acc_ua_volatile void* pp, unsigned long v);
3318 extern __acc_forceinline void __ACC_UA_SET_LE16(__acc_ua_volatile void* pp, unsigned long v) {
3319 __acc_ua_volatile acc_uint16e_t* p = (__acc_ua_volatile acc_uint16e_t*) pp;
3320 __asm__ __volatile__("sthbrx %2,0,%1" : "=m" (*p) : "r" (p), "r" (v));
3322 #define ACC_UA_SET_LE16(p,v) __ACC_UA_SET_LE16(p,v)
3326 #if !defined(ACC_UA_COPY16)
3327 # define ACC_UA_COPY16(d,s) ACC_UA_SET16(d, ACC_UA_GET16(s))
3330 #if (ACC_OPT_UNALIGNED32) && defined(acc_int32e_t)
3331 #define ACC_UA_GET32(p) (* (__acc_ua_volatile const acc_uint32e_t*) (__acc_ua_volatile const void*) (p))
3332 #define ACC_UA_SET32(p,v) ((* (__acc_ua_volatile acc_uint32e_t*) (__acc_ua_volatile void*) (p)) = (acc_uint32e_t) (v))
3333 #if (ACC_ABI_BIG_ENDIAN)
3334 # define ACC_UA_GET_BE32(p) ACC_UA_GET32(p)
3335 # define ACC_UA_SET_BE32(p,v) ACC_UA_SET32(p,v)
3336 #elif (ACC_ABI_LITTLE_ENDIAN)
3337 # define ACC_UA_GET_LE32(p) ACC_UA_GET32(p)
3338 # define ACC_UA_SET_LE32(p,v) ACC_UA_SET32(p,v)
3340 #if !(ACC_CFG_NO_INLINE_ASM) && (__acc_HAVE_forceinline)
3341 #if (ACC_ARCH_POWERPC && ACC_ABI_BIG_ENDIAN) && (ACC_CC_GNUC)
3342 #if !defined(ACC_UA_GET_LE32)
3343 extern __acc_forceinline unsigned long __ACC_UA_GET_LE32(__acc_ua_volatile const void* pp);
3344 extern __acc_forceinline unsigned long __ACC_UA_GET_LE32(__acc_ua_volatile const void* pp) {
3345 __acc_ua_volatile const acc_uint32e_t* p = (__acc_ua_volatile const acc_uint32e_t*) pp;
3347 __asm__ __volatile__("lwbrx %0,0,%1" : "=r" (v) : "r" (p), "m" (*p));
3350 #define ACC_UA_GET_LE32(p) __ACC_UA_GET_LE32(p)
3352 #if !defined(ACC_UA_SET_LE32)
3353 extern __acc_forceinline void __ACC_UA_SET_LE32(__acc_ua_volatile void* pp, unsigned long v);
3354 extern __acc_forceinline void __ACC_UA_SET_LE32(__acc_ua_volatile void* pp, unsigned long v) {
3355 __acc_ua_volatile acc_uint32e_t* p = (__acc_ua_volatile acc_uint32e_t*) pp;
3356 __asm__ __volatile__("stwbrx %2,0,%1" : "=m" (*p) : "r" (p), "r" (v));
3358 #define ACC_UA_SET_LE32(p,v) __ACC_UA_SET_LE32(p,v)
3362 #if !defined(ACC_UA_COPY32)
3363 # define ACC_UA_COPY32(d,s) ACC_UA_SET32(d, ACC_UA_GET32(s))
3366 #if (ACC_OPT_UNALIGNED64) && defined(acc_int64l_t)
3367 #define ACC_UA_GET64(p) (* (__acc_ua_volatile const acc_uint64l_t*) (__acc_ua_volatile const void*) (p))
3368 #define ACC_UA_SET64(p,v) ((* (__acc_ua_volatile acc_uint64l_t*) (__acc_ua_volatile void*) (p)) = (acc_uint64l_t) (v))
3369 #if (ACC_ABI_BIG_ENDIAN)
3370 # define ACC_UA_GET_BE64(p) ACC_UA_GET64(p)
3371 # define ACC_UA_SET_BE64(p,v) ACC_UA_SET64(p,v)
3372 #elif (ACC_ABI_LITTLE_ENDIAN)
3373 # define ACC_UA_GET_LE64(p) ACC_UA_GET64(p)
3374 # define ACC_UA_SET_LE64(p,v) ACC_UA_SET64(p,v)
3376 #if !defined(ACC_UA_COPY64)
3377 # define ACC_UA_COPY64(d,s) ACC_UA_SET64(d, ACC_UA_GET64(s))
3382 #if defined(ACC_WANT_ACC_INCD_H)
3383 # undef ACC_WANT_ACC_INCD_H
3384 #ifndef __ACC_INCD_H_INCLUDED
3385 #define __ACC_INCD_H_INCLUDED 1
3386 #if (ACC_LIBC_NAKED)
3387 #ifndef __ACC_FALLBACK_STDDEF_H_INCLUDED
3388 #define __ACC_FALLBACK_STDDEF_H_INCLUDED 1
3389 #if defined(__PTRDIFF_TYPE__)
3390 typedef __PTRDIFF_TYPE__ acc_fallback_ptrdiff_t;
3391 #elif defined(__MIPS_PSX2__)
3392 typedef int acc_fallback_ptrdiff_t;
3394 typedef long acc_fallback_ptrdiff_t;
3396 #if defined(__SIZE_TYPE__)
3397 typedef __SIZE_TYPE__ acc_fallback_size_t;
3398 #elif defined(__MIPS_PSX2__)
3399 typedef unsigned int acc_fallback_size_t;
3401 typedef unsigned long acc_fallback_size_t;
3403 #if !defined(ptrdiff_t)
3404 typedef acc_fallback_ptrdiff_t ptrdiff_t;
3405 #ifndef _PTRDIFF_T_DEFINED
3406 #define _PTRDIFF_T_DEFINED 1
3409 #if !defined(size_t)
3410 typedef acc_fallback_size_t size_t;
3411 #ifndef _SIZE_T_DEFINED
3412 #define _SIZE_T_DEFINED 1
3415 #if !defined(__cplusplus) && !defined(wchar_t)
3416 typedef unsigned short wchar_t;
3417 #ifndef _WCHAR_T_DEFINED
3418 #define _WCHAR_T_DEFINED 1
3422 #if defined(__cplusplus) && defined(__GNUC__) && (__GNUC__ >= 4)
3424 #elif defined(__cplusplus)
3427 #define NULL ((void*)0)
3431 #define offsetof(s,m) ((size_t)((ptrdiff_t)&(((s*)0)->m)))
3434 #elif (ACC_LIBC_FREESTANDING)
3436 # include <stddef.h>
3439 # include <stdint.h>
3441 #elif (ACC_LIBC_MOSTLY_FREESTANDING)
3446 # include <stddef.h>
3449 # include <stdint.h>
3453 #if (HAVE_TIME_H) && defined(__MSL__) && defined(__cplusplus)
3456 #if HAVE_SYS_TYPES_H
3457 # include <sys/types.h>
3460 # include <sys/stat.h>
3463 # include <stdlib.h>
3464 # include <stddef.h>
3467 # include <stdlib.h>
3471 # if !STDC_HEADERS && HAVE_MEMORY_H
3472 # include <memory.h>
3474 # include <string.h>
3477 # include <strings.h>
3480 # include <inttypes.h>
3483 # include <stdint.h>
3487 # include <unistd.h>
3492 #if defined(ACC_WANT_ACC_INCE_H)
3493 # undef ACC_WANT_ACC_INCE_H
3494 #ifndef __ACC_INCE_H_INCLUDED
3495 #define __ACC_INCE_H_INCLUDED 1
3496 #if (ACC_LIBC_NAKED)
3497 #elif (ACC_LIBC_FREESTANDING)
3498 #elif (ACC_LIBC_MOSTLY_FREESTANDING)
3499 # if (HAVE_SETJMP_H)
3500 # include <setjmp.h>
3504 # include <stdarg.h>
3513 # include <malloc.h>
3516 # include <alloca.h>
3522 # include <dirent.h>
3525 # include <setjmp.h>
3528 # include <signal.h>
3530 #if (TIME_WITH_SYS_TIME)
3531 # include <sys/time.h>
3538 #elif (HAVE_SYS_UTIME_H)
3539 # include <sys/utime.h>
3548 # include <direct.h>
3556 #if defined(__TOS__) && (defined(__PUREC__) || defined(__TURBOC__))
3562 #if defined(ACC_WANT_ACC_INCI_H)
3563 # undef ACC_WANT_ACC_INCI_H
3564 #ifndef __ACC_INCI_H_INCLUDED
3565 #define __ACC_INCI_H_INCLUDED 1
3566 #if (ACC_LIBC_NAKED)
3567 #elif (ACC_LIBC_FREESTANDING)
3568 #elif (ACC_LIBC_MOSTLY_FREESTANDING)
3570 #if (ACC_OS_TOS && (ACC_CC_PUREC || ACC_CC_TURBOC))
3572 #elif (ACC_HAVE_WINDOWS_H)
3573 # if 1 && !defined(WIN32_LEAN_AND_MEAN)
3574 # define WIN32_LEAN_AND_MEAN 1
3576 # if 1 && !defined(_WIN32_WINNT)
3577 # define _WIN32_WINNT 0x0400
3579 # include <windows.h>
3580 # if (ACC_CC_BORLANDC || ACC_CC_TURBOC)
3583 #elif (ACC_OS_DOS16 || ACC_OS_DOS32 || ACC_OS_WIN16)
3584 # if (ACC_CC_AZTECC)
3587 # elif (ACC_CC_BORLANDC || ACC_CC_TURBOC)
3590 # elif (ACC_OS_DOS32 && ACC_CC_GNUC) && defined(__DJGPP__)
3591 # include <sys/exceptn.h>
3592 # elif (ACC_CC_PACIFICC)
3593 # include <unixio.h>
3596 # elif (ACC_CC_WATCOMC)
3599 #elif (ACC_OS_OS216)
3600 # if (ACC_CC_WATCOMC)
3604 #if (HAVE_SYS_MMAN_H)
3605 # include <sys/mman.h>
3607 #if (HAVE_SYS_RESOURCE_H)
3608 # include <sys/resource.h>
3610 #if (ACC_OS_DOS16 || ACC_OS_OS216 || ACC_OS_WIN16)
3611 # if defined(FP_OFF)
3612 # define ACC_PTR_FP_OFF(x) FP_OFF(x)
3613 # elif defined(_FP_OFF)
3614 # define ACC_PTR_FP_OFF(x) _FP_OFF(x)
3616 # define ACC_PTR_FP_OFF(x) (((const unsigned __far*)&(x))[0])
3618 # if defined(FP_SEG)
3619 # define ACC_PTR_FP_SEG(x) FP_SEG(x)
3620 # elif defined(_FP_SEG)
3621 # define ACC_PTR_FP_SEG(x) _FP_SEG(x)
3623 # define ACC_PTR_FP_SEG(x) (((const unsigned __far*)&(x))[1])
3626 # define ACC_PTR_MK_FP(s,o) MK_FP(s,o)
3627 # elif defined(_MK_FP)
3628 # define ACC_PTR_MK_FP(s,o) _MK_FP(s,o)
3630 # define ACC_PTR_MK_FP(s,o) ((void __far*)(((unsigned long)(s)<<16)+(unsigned)(o)))
3633 # undef ACC_PTR_FP_OFF
3634 # undef ACC_PTR_FP_SEG
3635 # undef ACC_PTR_MK_FP
3636 # define ACC_PTR_FP_OFF(x) (((const unsigned __far*)&(x))[0])
3637 # define ACC_PTR_FP_SEG(x) (((const unsigned __far*)&(x))[1])
3638 # define ACC_PTR_MK_FP(s,o) ((void __far*)(((unsigned long)(s)<<16)+(unsigned)(o)))
3644 #if defined(ACC_WANT_ACC_LIB_H)
3645 # undef ACC_WANT_ACC_LIB_H
3646 #ifndef __ACC_LIB_H_INCLUDED
3647 #define __ACC_LIB_H_INCLUDED 1
3648 #if !defined(__ACCLIB_FUNCNAME)
3649 # define __ACCLIB_FUNCNAME(f) f
3651 #if !defined(ACCLIB_EXTERN)
3652 # define ACCLIB_EXTERN(r,f) extern r __ACCLIB_FUNCNAME(f)
3654 #if !defined(ACCLIB_EXTERN_NOINLINE)
3655 # if defined(__acc_noinline)
3656 # define ACCLIB_EXTERN_NOINLINE(r,f) extern __acc_noinline r __ACCLIB_FUNCNAME(f)
3658 # define ACCLIB_EXTERN_NOINLINE(r,f) extern r __ACCLIB_FUNCNAME(f)
3661 #if !defined(__ACCLIB_CONST_CAST_RETURN)
3662 #if 1 && (ACC_CC_CLANG || ACC_CC_GNUC || ACC_CC_LLVM || ACC_CC_PATHSCALE)
3663 # define __ACCLIB_CONST_CAST_RETURN(type,var) return (type) (acc_uintptr_t) (var);
3664 #elif (ACC_CC_CLANG || ACC_CC_GNUC || ACC_CC_LLVM || ACC_CC_PATHSCALE)
3665 # define __ACCLIB_CONST_CAST_RETURN(type,var) \
3666 { union { type a; const type b; } u; u.b = (var); return u.a; }
3668 # define __ACCLIB_CONST_CAST_RETURN(type,var) return (type) (var);
3672 # define acclib_handle_t acc_int64l_t
3673 # define acclib_uhandle_t acc_uint64l_t
3674 #elif (ACC_ARCH_I386 && ACC_CC_MSC && (_MSC_VER >= 1300))
3675 typedef __w64 long acclib_handle_t;
3676 typedef __w64 unsigned long acclib_uhandle_t;
3677 # define acclib_handle_t acclib_handle_t
3678 # define acclib_uhandle_t acclib_uhandle_t
3680 # define acclib_handle_t long
3681 # define acclib_uhandle_t unsigned long
3684 ACCLIB_EXTERN(int, acc_ascii_digit) (int);
3685 ACCLIB_EXTERN(int, acc_ascii_islower) (int);
3686 ACCLIB_EXTERN(int, acc_ascii_isupper) (int);
3687 ACCLIB_EXTERN(int, acc_ascii_tolower) (int);
3688 ACCLIB_EXTERN(int, acc_ascii_toupper) (int);
3689 ACCLIB_EXTERN(int, acc_ascii_utolower) (int);
3690 ACCLIB_EXTERN(int, acc_ascii_utoupper) (int);
3692 #define acc_ascii_isdigit(c) (((unsigned)(c) - 48) < 10)
3693 #define acc_ascii_islower(c) (((unsigned)(c) - 97) < 26)
3694 #define acc_ascii_isupper(c) (((unsigned)(c) - 65) < 26)
3695 #define acc_ascii_tolower(c) ((int)(c) + (acc_ascii_isupper(c) << 5))
3696 #define acc_ascii_toupper(c) ((int)(c) - (acc_ascii_islower(c) << 5))
3697 #define acc_ascii_utolower(c) acc_ascii_tolower((unsigned char)(c))
3698 #define acc_ascii_utoupper(c) acc_ascii_toupper((unsigned char)(c))
3700 #if (ACC_HAVE_MM_HUGE_PTR)
3701 # define acc_hsize_t unsigned long
3702 # define acc_hvoid_p void __huge *
3703 # define acc_hchar_p char __huge *
3704 # define acc_hchar_pp char __huge * __huge *
3705 # define acc_hbyte_p unsigned char __huge *
3707 # define acc_hsize_t size_t
3708 # define acc_hvoid_p void *
3709 # define acc_hchar_p char *
3710 # define acc_hchar_pp char **
3711 # define acc_hbyte_p unsigned char *
3714 ACCLIB_EXTERN(acc_hvoid_p, acc_halloc) (acc_hsize_t);
3715 ACCLIB_EXTERN(void, acc_hfree) (acc_hvoid_p);
3716 #if (ACC_OS_DOS16 || ACC_OS_OS216)
3717 ACCLIB_EXTERN(void __far*, acc_dos_alloc) (unsigned long);
3718 ACCLIB_EXTERN(int, acc_dos_free) (void __far*);
3720 ACCLIB_EXTERN(int, acc_hmemcmp) (const acc_hvoid_p, const acc_hvoid_p, acc_hsize_t);
3721 ACCLIB_EXTERN(acc_hvoid_p, acc_hmemcpy) (acc_hvoid_p, const acc_hvoid_p, acc_hsize_t);
3722 ACCLIB_EXTERN(acc_hvoid_p, acc_hmemmove) (acc_hvoid_p, const acc_hvoid_p, acc_hsize_t);
3723 ACCLIB_EXTERN(acc_hvoid_p, acc_hmemset) (acc_hvoid_p, int, acc_hsize_t);
3724 ACCLIB_EXTERN(acc_hsize_t, acc_hstrlen) (const acc_hchar_p);
3725 ACCLIB_EXTERN(int, acc_hstrcmp) (const acc_hchar_p, const acc_hchar_p);
3726 ACCLIB_EXTERN(int, acc_hstrncmp)(const acc_hchar_p, const acc_hchar_p, acc_hsize_t);
3727 ACCLIB_EXTERN(int, acc_ascii_hstricmp) (const acc_hchar_p, const acc_hchar_p);
3728 ACCLIB_EXTERN(int, acc_ascii_hstrnicmp)(const acc_hchar_p, const acc_hchar_p, acc_hsize_t);
3729 ACCLIB_EXTERN(int, acc_ascii_hmemicmp) (const acc_hvoid_p, const acc_hvoid_p, acc_hsize_t);
3730 ACCLIB_EXTERN(acc_hchar_p, acc_hstrstr) (const acc_hchar_p, const acc_hchar_p);
3731 ACCLIB_EXTERN(acc_hchar_p, acc_ascii_hstristr) (const acc_hchar_p, const acc_hchar_p);
3732 ACCLIB_EXTERN(acc_hvoid_p, acc_hmemmem) (const acc_hvoid_p, acc_hsize_t, const acc_hvoid_p, acc_hsize_t);
3733 ACCLIB_EXTERN(acc_hvoid_p, acc_ascii_hmemimem) (const acc_hvoid_p, acc_hsize_t, const acc_hvoid_p, acc_hsize_t);
3734 ACCLIB_EXTERN(acc_hchar_p, acc_hstrcpy) (acc_hchar_p, const acc_hchar_p);
3735 ACCLIB_EXTERN(acc_hchar_p, acc_hstrcat) (acc_hchar_p, const acc_hchar_p);
3736 ACCLIB_EXTERN(acc_hsize_t, acc_hstrlcpy) (acc_hchar_p, const acc_hchar_p, acc_hsize_t);
3737 ACCLIB_EXTERN(acc_hsize_t, acc_hstrlcat) (acc_hchar_p, const acc_hchar_p, acc_hsize_t);
3738 ACCLIB_EXTERN(int, acc_hstrscpy) (acc_hchar_p, const acc_hchar_p, acc_hsize_t);
3739 ACCLIB_EXTERN(int, acc_hstrscat) (acc_hchar_p, const acc_hchar_p, acc_hsize_t);
3740 ACCLIB_EXTERN(acc_hchar_p, acc_hstrccpy) (acc_hchar_p, const acc_hchar_p, int);
3741 ACCLIB_EXTERN(acc_hvoid_p, acc_hmemccpy) (acc_hvoid_p, const acc_hvoid_p, int, acc_hsize_t);
3742 ACCLIB_EXTERN(acc_hchar_p, acc_hstrchr) (const acc_hchar_p, int);
3743 ACCLIB_EXTERN(acc_hchar_p, acc_hstrrchr) (const acc_hchar_p, int);
3744 ACCLIB_EXTERN(acc_hchar_p, acc_ascii_hstrichr) (const acc_hchar_p, int);
3745 ACCLIB_EXTERN(acc_hchar_p, acc_ascii_hstrrichr) (const acc_hchar_p, int);
3746 ACCLIB_EXTERN(acc_hvoid_p, acc_hmemchr) (const acc_hvoid_p, int, acc_hsize_t);
3747 ACCLIB_EXTERN(acc_hvoid_p, acc_hmemrchr) (const acc_hvoid_p, int, acc_hsize_t);
3748 ACCLIB_EXTERN(acc_hvoid_p, acc_ascii_hmemichr) (const acc_hvoid_p, int, acc_hsize_t);
3749 ACCLIB_EXTERN(acc_hvoid_p, acc_ascii_hmemrichr) (const acc_hvoid_p, int, acc_hsize_t);
3750 ACCLIB_EXTERN(acc_hsize_t, acc_hstrspn) (const acc_hchar_p, const acc_hchar_p);
3751 ACCLIB_EXTERN(acc_hsize_t, acc_hstrrspn) (const acc_hchar_p, const acc_hchar_p);
3752 ACCLIB_EXTERN(acc_hsize_t, acc_hstrcspn) (const acc_hchar_p, const acc_hchar_p);
3753 ACCLIB_EXTERN(acc_hsize_t, acc_hstrrcspn) (const acc_hchar_p, const acc_hchar_p);
3754 ACCLIB_EXTERN(acc_hchar_p, acc_hstrpbrk) (const acc_hchar_p, const acc_hchar_p);
3755 ACCLIB_EXTERN(acc_hchar_p, acc_hstrrpbrk) (const acc_hchar_p, const acc_hchar_p);
3756 ACCLIB_EXTERN(acc_hchar_p, acc_hstrsep) (acc_hchar_pp, const acc_hchar_p);
3757 ACCLIB_EXTERN(acc_hchar_p, acc_hstrrsep) (acc_hchar_pp, const acc_hchar_p);
3758 ACCLIB_EXTERN(acc_hchar_p, acc_ascii_hstrlwr) (acc_hchar_p);
3759 ACCLIB_EXTERN(acc_hchar_p, acc_ascii_hstrupr) (acc_hchar_p);
3760 ACCLIB_EXTERN(acc_hvoid_p, acc_ascii_hmemlwr) (acc_hvoid_p, acc_hsize_t);
3761 ACCLIB_EXTERN(acc_hvoid_p, acc_ascii_hmemupr) (acc_hvoid_p, acc_hsize_t);
3762 ACCLIB_EXTERN(acc_hsize_t, acc_hfread) (void *, acc_hvoid_p, acc_hsize_t);
3763 ACCLIB_EXTERN(acc_hsize_t, acc_hfwrite) (void *, const acc_hvoid_p, acc_hsize_t);
3764 #if (ACC_HAVE_MM_HUGE_PTR)
3765 ACCLIB_EXTERN(long, acc_hread) (int, acc_hvoid_p, long);
3766 ACCLIB_EXTERN(long, acc_hwrite) (int, const acc_hvoid_p, long);
3768 ACCLIB_EXTERN(long, acc_safe_hread) (int, acc_hvoid_p, long);
3769 ACCLIB_EXTERN(long, acc_safe_hwrite) (int, const acc_hvoid_p, long);
3770 ACCLIB_EXTERN(unsigned, acc_ua_get_be16) (const acc_hvoid_p);
3771 ACCLIB_EXTERN(acc_uint32l_t, acc_ua_get_be24) (const acc_hvoid_p);
3772 ACCLIB_EXTERN(acc_uint32l_t, acc_ua_get_be32) (const acc_hvoid_p);
3773 ACCLIB_EXTERN(void, acc_ua_set_be16) (acc_hvoid_p, unsigned);
3774 ACCLIB_EXTERN(void, acc_ua_set_be24) (acc_hvoid_p, acc_uint32l_t);
3775 ACCLIB_EXTERN(void, acc_ua_set_be32) (acc_hvoid_p, acc_uint32l_t);
3776 ACCLIB_EXTERN(unsigned, acc_ua_get_le16) (const acc_hvoid_p);
3777 ACCLIB_EXTERN(acc_uint32l_t, acc_ua_get_le24) (const acc_hvoid_p);
3778 ACCLIB_EXTERN(acc_uint32l_t, acc_ua_get_le32) (const acc_hvoid_p);
3779 ACCLIB_EXTERN(void, acc_ua_set_le16) (acc_hvoid_p, unsigned);
3780 ACCLIB_EXTERN(void, acc_ua_set_le24) (acc_hvoid_p, acc_uint32l_t);
3781 ACCLIB_EXTERN(void, acc_ua_set_le32) (acc_hvoid_p, acc_uint32l_t);
3782 #if defined(acc_int64l_t)
3783 ACCLIB_EXTERN(acc_uint64l_t, acc_ua_get_be64) (const acc_hvoid_p);
3784 ACCLIB_EXTERN(void, acc_ua_set_be64) (acc_hvoid_p, acc_uint64l_t);
3785 ACCLIB_EXTERN(acc_uint64l_t, acc_ua_get_le64) (const acc_hvoid_p);
3786 ACCLIB_EXTERN(void, acc_ua_set_le64) (acc_hvoid_p, acc_uint64l_t);
3788 ACCLIB_EXTERN_NOINLINE(short, acc_vget_short) (short, int);
3789 ACCLIB_EXTERN_NOINLINE(int, acc_vget_int) (int, int);
3790 ACCLIB_EXTERN_NOINLINE(long, acc_vget_long) (long, int);
3791 #if defined(acc_int64l_t)
3792 ACCLIB_EXTERN_NOINLINE(acc_int64l_t, acc_vget_acc_int64l_t) (acc_int64l_t, int);
3794 ACCLIB_EXTERN_NOINLINE(acc_hsize_t, acc_vget_acc_hsize_t) (acc_hsize_t, int);
3795 #if !(ACC_CFG_NO_FLOAT)
3796 ACCLIB_EXTERN_NOINLINE(float, acc_vget_float) (float, int);
3798 #if !(ACC_CFG_NO_DOUBLE)
3799 ACCLIB_EXTERN_NOINLINE(double, acc_vget_double) (double, int);
3801 ACCLIB_EXTERN_NOINLINE(acc_hvoid_p, acc_vget_acc_hvoid_p) (acc_hvoid_p, int);
3802 ACCLIB_EXTERN_NOINLINE(const acc_hvoid_p, acc_vget_acc_hvoid_cp) (const acc_hvoid_p, int);
3803 #if !defined(ACC_FN_PATH_MAX)
3804 #if (ACC_OS_DOS16 || ACC_OS_WIN16)
3805 # define ACC_FN_PATH_MAX 143
3806 #elif (ACC_OS_DOS32 || ACC_OS_OS2 || ACC_OS_OS216 || ACC_OS_WIN32 || ACC_OS_WIN64)
3807 # define ACC_FN_PATH_MAX 259
3809 # define ACC_FN_PATH_MAX 259
3812 #if !defined(ACC_FN_PATH_MAX)
3813 # define ACC_FN_PATH_MAX 1023
3815 #if !defined(ACC_FN_NAME_MAX)
3816 #if (ACC_OS_DOS16 || ACC_OS_WIN16)
3817 # define ACC_FN_NAME_MAX 12
3818 #elif (ACC_ARCH_M68K && ACC_OS_TOS && (ACC_CC_PUREC || ACC_CC_TURBOC))
3819 # define ACC_FN_NAME_MAX 12
3820 #elif (ACC_OS_DOS32 && ACC_CC_GNUC) && defined(__DJGPP__)
3821 #elif (ACC_OS_DOS32)
3822 # define ACC_FN_NAME_MAX 12
3825 #if !defined(ACC_FN_NAME_MAX)
3826 # define ACC_FN_NAME_MAX ACC_FN_PATH_MAX
3828 #define ACC_FNMATCH_NOESCAPE 1
3829 #define ACC_FNMATCH_PATHNAME 2
3830 #define ACC_FNMATCH_PATHSTAR 4
3831 #define ACC_FNMATCH_PERIOD 8
3832 #define ACC_FNMATCH_ASCII_CASEFOLD 16
3833 ACCLIB_EXTERN(int, acc_fnmatch) (const acc_hchar_p, const acc_hchar_p, int);
3834 #undef __ACCLIB_USE_OPENDIR
3835 #if (HAVE_DIRENT_H || ACC_CC_WATCOMC)
3836 # define __ACCLIB_USE_OPENDIR 1
3837 # if (ACC_OS_DOS32 && defined(__BORLANDC__))
3838 # elif (ACC_OS_DOS32 && ACC_CC_GNUC) && defined(__DJGPP__)
3839 # elif (ACC_OS_OS2 || ACC_OS_OS216)
3840 # elif (ACC_ARCH_M68K && ACC_OS_TOS && ACC_CC_GNUC)
3841 # elif (ACC_OS_WIN32 && !(ACC_HAVE_WINDOWS_H))
3842 # elif (ACC_OS_DOS16 || ACC_OS_DOS32 || ACC_OS_OS2 || ACC_OS_OS216 || ACC_OS_TOS || ACC_OS_WIN16 || ACC_OS_WIN32 || ACC_OS_WIN64)
3843 # undef __ACCLIB_USE_OPENDIR
3848 #if defined(__ACCLIB_USE_OPENDIR)
3850 # if (ACC_CC_WATCOMC)
3851 unsigned short f_time;
3852 unsigned short f_date;
3853 unsigned long f_size;
3855 char f_name[ACC_FN_NAME_MAX+1];
3856 #elif (ACC_OS_WIN32 || ACC_OS_WIN64)
3857 acclib_handle_t u_handle;
3859 unsigned f_size_low;
3860 unsigned f_size_high;
3861 char f_name[ACC_FN_NAME_MAX+1];
3862 #elif (ACC_OS_DOS16 || ACC_OS_DOS32 || ACC_OS_TOS || ACC_OS_WIN16)
3864 unsigned char f_attr;
3865 unsigned short f_time;
3866 unsigned short f_date;
3867 unsigned short f_size_low;
3868 unsigned short f_size_high;
3869 char f_name[ACC_FN_NAME_MAX+1];
3873 char f_name[ACC_FN_NAME_MAX+1];
3877 #define acc_dir_p acc_dir_t *
3879 ACCLIB_EXTERN(int, acc_opendir) (acc_dir_p, const char*);
3880 ACCLIB_EXTERN(int, acc_readdir) (acc_dir_p);
3881 ACCLIB_EXTERN(int, acc_closedir) (acc_dir_p);
3882 #if (ACC_CC_GNUC) && (defined(__CYGWIN__) || defined(__MINGW32__))
3883 # define acc_alloca(x) __builtin_alloca((x))
3884 #elif (ACC_CC_GNUC) && (ACC_OS_CONSOLE_PS2)
3885 # define acc_alloca(x) __builtin_alloca((x))
3886 #elif (ACC_CC_BORLANDC || ACC_CC_LCC) && defined(__linux__)
3888 # define acc_alloca(x) ((void *) (alloca((x))))
3890 #if (ACC_OS_DOS32 && ACC_CC_GNUC) && defined(__DJGPP__)
3891 # define acc_stackavail() stackavail()
3892 #elif (ACC_ARCH_I086 && ACC_CC_BORLANDC && (__BORLANDC__ >= 0x0410))
3893 # define acc_stackavail() stackavail()
3894 #elif (ACC_ARCH_I086 && ACC_CC_BORLANDC && (__BORLANDC__ >= 0x0400))
3895 # if (ACC_OS_WIN16) && (ACC_MM_TINY || ACC_MM_SMALL || ACC_MM_MEDIUM)
3897 # define acc_stackavail() stackavail()
3899 #elif ((ACC_ARCH_I086 || ACC_ARCH_I386) && (ACC_CC_DMC || ACC_CC_SYMANTECC))
3900 # define acc_stackavail() stackavail()
3901 #elif ((ACC_ARCH_I086) && ACC_CC_MSC && (_MSC_VER >= 700))
3902 # define acc_stackavail() _stackavail()
3903 #elif ((ACC_ARCH_I086) && ACC_CC_MSC)
3904 # define acc_stackavail() stackavail()
3905 #elif ((ACC_ARCH_I086 || ACC_ARCH_I386) && ACC_CC_TURBOC && (__TURBOC__ >= 0x0450))
3906 # define acc_stackavail() stackavail()
3907 #elif (ACC_ARCH_I086 && ACC_CC_TURBOC && (__TURBOC__ >= 0x0400))
3908 ACC_EXTERN_C size_t __cdecl stackavail(void);
3909 # define acc_stackavail() stackavail()
3910 #elif ((ACC_ARCH_I086 || ACC_ARCH_I386) && (ACC_CC_WATCOMC))
3911 # define acc_stackavail() stackavail()
3912 #elif (ACC_ARCH_I086 && ACC_CC_ZORTECHC)
3913 # define acc_stackavail() _chkstack()
3915 ACCLIB_EXTERN(acclib_handle_t, acc_get_osfhandle) (int);
3916 ACCLIB_EXTERN(const char *, acc_getenv) (const char *);
3917 ACCLIB_EXTERN(int, acc_isatty) (int);
3918 ACCLIB_EXTERN(int, acc_mkdir) (const char*, unsigned);
3919 ACCLIB_EXTERN(int, acc_rmdir) (const char*);
3920 ACCLIB_EXTERN(int, acc_response) (int*, char***);
3921 ACCLIB_EXTERN(int, acc_set_binmode) (int, int);
3922 #if defined(acc_int32e_t)
3923 ACCLIB_EXTERN(acc_int32e_t, acc_muldiv32s) (acc_int32e_t, acc_int32e_t, acc_int32e_t);
3924 ACCLIB_EXTERN(acc_uint32e_t, acc_muldiv32u) (acc_uint32e_t, acc_uint32e_t, acc_uint32e_t);
3926 ACCLIB_EXTERN(void, acc_wildargv) (int*, char***);
3927 ACCLIB_EXTERN_NOINLINE(void, acc_debug_break) (void);
3928 ACCLIB_EXTERN_NOINLINE(void, acc_debug_nop) (void);
3929 ACCLIB_EXTERN_NOINLINE(int, acc_debug_align_check_query) (void);
3930 ACCLIB_EXTERN_NOINLINE(int, acc_debug_align_check_enable) (int);
3931 ACCLIB_EXTERN_NOINLINE(unsigned, acc_debug_running_on_qemu) (void);
3932 ACCLIB_EXTERN_NOINLINE(unsigned, acc_debug_running_on_valgrind) (void);
3933 #if !defined(acc_int64l_t) || (ACC_CFG_NO_DOUBLE)
3934 # undef __ACCLIB_PCLOCK_USE_RDTSC
3935 # undef __ACCLIB_PCLOCK_USE_PERFCTR
3936 # undef __ACCLIB_UCLOCK_USE_RDTSC
3937 # undef __ACCLIB_UCLOCK_USE_PERFCTR
3942 double tsc_to_seconds;
3943 unsigned cpu_type, cpu_features, cpu_khz, cpu_nrctrs;
3944 const char* cpu_name;
3945 } acc_perfctr_handle_t;
3948 #if (ACC_OS_POSIX_LINUX)
3949 acc_uint64l_t pmc[18];
3951 acc_uint64l_t pmc[1];
3953 } acc_perfctr_clock_t;
3954 #ifndef acc_perfctr_handle_p
3955 #define acc_perfctr_handle_p acc_perfctr_handle_t *
3957 #ifndef acc_perfctr_clock_p
3958 #define acc_perfctr_clock_p acc_perfctr_clock_t *
3960 ACCLIB_EXTERN(int, acc_perfctr_open) (acc_perfctr_handle_p);
3961 ACCLIB_EXTERN(int, acc_perfctr_close) (acc_perfctr_handle_p);
3962 ACCLIB_EXTERN(void, acc_perfctr_read) (acc_perfctr_handle_p, acc_perfctr_clock_p);
3963 #if !(ACC_CFG_NO_DOUBLE)
3964 ACCLIB_EXTERN(double, acc_perfctr_get_elapsed) (acc_perfctr_handle_p, const acc_perfctr_clock_p, const acc_perfctr_clock_p);
3965 ACCLIB_EXTERN(double, acc_perfctr_get_elapsed_tsc) (acc_perfctr_handle_p, acc_uint64l_t);
3967 ACCLIB_EXTERN(int, acc_perfctr_flush_cpu_cache) (acc_perfctr_handle_p, unsigned);
3969 #if defined(acc_int32e_t)
3970 ACCLIB_EXTERN(int, acc_tsc_read) (acc_uint32e_t*);
3972 # undef __ACCLIB_PCLOCK_USE_RDTSC
3973 # undef __ACCLIB_UCLOCK_USE_RDTSC
3975 struct acc_pclock_handle_t;
3976 struct acc_pclock_t;
3977 typedef struct acc_pclock_handle_t acc_pclock_handle_t;
3978 typedef struct acc_pclock_t acc_pclock_t;
3979 #ifndef acc_pclock_handle_p
3980 #define acc_pclock_handle_p acc_pclock_handle_t *
3982 #ifndef acc_pclock_p
3983 #define acc_pclock_p acc_pclock_t *
3985 #define ACC_PCLOCK_REALTIME 0
3986 #define ACC_PCLOCK_MONOTONIC 1
3987 #define ACC_PCLOCK_PROCESS_CPUTIME_ID 2
3988 #define ACC_PCLOCK_THREAD_CPUTIME_ID 3
3989 struct acc_pclock_handle_t {
3994 int (*gettime) (acc_pclock_handle_p, acc_pclock_p);
3995 #if defined(acc_int64l_t)
3996 acc_uint64l_t ticks_base;
3998 #if (__ACCLIB_PCLOCK_USE_PERFCTR)
3999 acc_perfctr_handle_t pch;
4002 struct acc_pclock_t {
4003 #if defined(acc_int64l_t)
4004 acc_int64l_t tv_sec;
4006 acc_int32l_t tv_sec_high;
4007 acc_uint32l_t tv_sec_low;
4009 acc_uint32l_t tv_nsec;
4011 ACCLIB_EXTERN(int, acc_pclock_open) (acc_pclock_handle_p, int);
4012 ACCLIB_EXTERN(int, acc_pclock_open_default) (acc_pclock_handle_p);
4013 ACCLIB_EXTERN(int, acc_pclock_close) (acc_pclock_handle_p);
4014 ACCLIB_EXTERN(void, acc_pclock_read) (acc_pclock_handle_p, acc_pclock_p);
4015 #if !(ACC_CFG_NO_DOUBLE)
4016 ACCLIB_EXTERN(double, acc_pclock_get_elapsed) (acc_pclock_handle_p, const acc_pclock_p, const acc_pclock_p);
4018 ACCLIB_EXTERN(int, acc_pclock_flush_cpu_cache) (acc_pclock_handle_p, unsigned);
4019 #if !defined(acc_int64l_t) || (ACC_CFG_NO_DOUBLE)
4020 # undef __ACCLIB_UCLOCK_USE_QPC
4021 #elif (ACC_OS_CYGWIN || ACC_OS_EMX || ACC_OS_WIN32 || ACC_OS_WIN64) && (ACC_HAVE_WINDOWS_H)
4022 # define __ACCLIB_UCLOCK_USE_QPC 1
4024 # undef __ACCLIB_UCLOCK_USE_QPC
4031 #if (__ACCLIB_UCLOCK_USE_PERFCTR)
4032 acc_perfctr_handle_t pch;
4034 #if (__ACCLIB_UCLOCK_USE_QPC)
4037 } acc_uclock_handle_t;
4041 #if !(ACC_OS_DOS16 || ACC_OS_WIN16)
4042 # if !(ACC_CFG_NO_DOUBLE)
4045 # if defined(acc_int64l_t)
4050 #if (__ACCLIB_UCLOCK_USE_RDTSC)
4053 #if (__ACCLIB_UCLOCK_USE_PERFCTR)
4054 acc_perfctr_clock_t pcc;
4056 #if (__ACCLIB_UCLOCK_USE_QPC)
4060 #ifndef acc_uclock_handle_p
4061 #define acc_uclock_handle_p acc_uclock_handle_t *
4063 #ifndef acc_uclock_p
4064 #define acc_uclock_p acc_uclock_t *
4066 ACCLIB_EXTERN(int, acc_uclock_open) (acc_uclock_handle_p);
4067 ACCLIB_EXTERN(int, acc_uclock_close) (acc_uclock_handle_p);
4068 ACCLIB_EXTERN(void, acc_uclock_read) (acc_uclock_handle_p, acc_uclock_p);
4069 #if !(ACC_CFG_NO_DOUBLE)
4070 ACCLIB_EXTERN(double, acc_uclock_get_elapsed) (acc_uclock_handle_p, const acc_uclock_p, const acc_uclock_p);
4072 ACCLIB_EXTERN(int, acc_uclock_flush_cpu_cache) (acc_uclock_handle_p, unsigned);
4073 struct acc_getopt_t;
4074 typedef struct acc_getopt_t acc_getopt_t;
4075 #ifndef acc_getopt_p
4076 #define acc_getopt_p acc_getopt_t *
4078 struct acc_getopt_longopt_t;
4079 typedef struct acc_getopt_longopt_t acc_getopt_longopt_t;
4080 #ifndef acc_getopt_longopt_p
4081 #define acc_getopt_longopt_p acc_getopt_longopt_t *
4083 struct acc_getopt_longopt_t {
4089 struct acc_getopt_t {
4091 const char *progname;
4094 void (*opterr)(acc_getopt_p, const char*, void *);
4098 int argc; char** argv;
4099 int eof; int shortpos;
4100 int pending_rotate_first, pending_rotate_middle;
4102 enum { ACC_GETOPT_NO_ARG, ACC_GETOPT_REQUIRED_ARG, ACC_GETOPT_OPTIONAL_ARG, ACC_GETOPT_EXACT_ARG = 0x10 };
4103 enum { ACC_GETOPT_PERMUTE, ACC_GETOPT_RETURN_IN_ORDER, ACC_GETOPT_REQUIRE_ORDER };
4104 ACCLIB_EXTERN(void, acc_getopt_init) (acc_getopt_p g,
4105 int start_argc, int argc, char** argv);
4106 ACCLIB_EXTERN(int, acc_getopt) (acc_getopt_p g,
4107 const char* shortopts,
4108 const acc_getopt_longopt_p longopts,
4113 #ifndef acc_rand31_p
4114 #define acc_rand31_p acc_rand31_t *
4116 ACCLIB_EXTERN(void, acc_srand31) (acc_rand31_p, acc_uint32l_t);
4117 ACCLIB_EXTERN(acc_uint32l_t, acc_rand31) (acc_rand31_p);
4118 #if defined(acc_int64l_t)
4122 #ifndef acc_rand48_p
4123 #define acc_rand48_p acc_rand48_t *
4125 ACCLIB_EXTERN(void, acc_srand48) (acc_rand48_p, acc_uint32l_t);
4126 ACCLIB_EXTERN(acc_uint32l_t, acc_rand48) (acc_rand48_p);
4127 ACCLIB_EXTERN(acc_uint32l_t, acc_rand48_r32) (acc_rand48_p);
4129 #if defined(acc_int64l_t)
4133 #ifndef acc_rand64_p
4134 #define acc_rand64_p acc_rand64_t *
4136 ACCLIB_EXTERN(void, acc_srand64) (acc_rand64_p, acc_uint64l_t);
4137 ACCLIB_EXTERN(acc_uint32l_t, acc_rand64) (acc_rand64_p);
4138 ACCLIB_EXTERN(acc_uint32l_t, acc_rand64_r32) (acc_rand64_p);
4142 acc_uint32l_t s[624];
4144 #ifndef acc_randmt_p
4145 #define acc_randmt_p acc_randmt_t *
4147 ACCLIB_EXTERN(void, acc_srandmt) (acc_randmt_p, acc_uint32l_t);
4148 ACCLIB_EXTERN(acc_uint32l_t, acc_randmt) (acc_randmt_p);
4149 ACCLIB_EXTERN(acc_uint32l_t, acc_randmt_r32) (acc_randmt_p);
4150 #if defined(acc_int64l_t)
4153 acc_uint64l_t s[312];
4155 #ifndef acc_randmt64_p
4156 #define acc_randmt64_p acc_randmt64_t *
4158 ACCLIB_EXTERN(void, acc_srandmt64) (acc_randmt64_p, acc_uint64l_t);
4159 ACCLIB_EXTERN(acc_uint64l_t, acc_randmt64_r64) (acc_randmt64_p);
4161 #define ACC_SPAWN_P_WAIT 0
4162 #define ACC_SPAWN_P_NOWAIT 1
4163 ACCLIB_EXTERN(int, acc_spawnv) (int mode, const char* fn, const char* const * argv);
4164 ACCLIB_EXTERN(int, acc_spawnvp) (int mode, const char* fn, const char* const * argv);
4165 ACCLIB_EXTERN(int, acc_spawnve) (int mode, const char* fn, const char* const * argv, const char * const envp);
4168 #if defined(ACC_WANT_ACC_CXX_H)
4169 # undef ACC_WANT_ACC_CXX_H
4170 #ifndef __ACC_CXX_H_INCLUDED
4171 #define __ACC_CXX_H_INCLUDED 1
4172 #if defined(__cplusplus)
4173 #if defined(ACC_CXX_NOTHROW)
4174 #elif (ACC_CC_GNUC && (ACC_CC_GNUC < 0x020800ul))
4175 #elif (ACC_CC_BORLANDC && (__BORLANDC__ < 0x0450))
4176 #elif (ACC_CC_HIGHC)
4177 #elif (ACC_CC_MSC && (_MSC_VER < 1100))
4179 #elif (ACC_CC_TURBOC)
4180 #elif (ACC_CC_WATCOMC && !defined(_CPPUNWIND))
4181 #elif (ACC_CC_ZORTECHC)
4183 # define ACC_CXX_NOTHROW throw()
4185 #if !defined(ACC_CXX_NOTHROW)
4186 # define ACC_CXX_NOTHROW /*empty*/
4188 #if defined(__ACC_CXX_DO_NEW)
4189 #elif (ACC_CC_NDPC || ACC_CC_PGI)
4190 # define __ACC_CXX_DO_NEW { return 0; }
4191 #elif ((ACC_CC_BORLANDC || ACC_CC_TURBOC) && ACC_ARCH_I086)
4192 # define __ACC_CXX_DO_NEW { return 0; }
4194 # define __ACC_CXX_DO_NEW ;
4196 #if defined(__ACC_CXX_DO_DELETE)
4197 #elif (ACC_CC_BORLANDC || ACC_CC_TURBOC)
4198 # define __ACC_CXX_DO_DELETE { }
4200 # define __ACC_CXX_DO_DELETE ACC_CXX_NOTHROW { }
4202 #if (ACC_CC_BORLANDC && (__BORLANDC__ < 0x0450))
4203 #elif (ACC_CC_MSC && ACC_MM_HUGE)
4204 # define ACC_CXX_DISABLE_NEW_DELETE private:
4205 #elif (ACC_CC_MSC && (_MSC_VER < 1100))
4207 #elif (ACC_CC_SYMANTECC || ACC_CC_ZORTECHC)
4208 #elif (ACC_CC_TURBOC)
4209 #elif (ACC_CC_WATCOMC && (__WATCOMC__ < 1100))
4211 # define __ACC_CXX_HAVE_ARRAY_NEW 1
4213 #if (__ACC_CXX_HAVE_ARRAY_NEW)
4214 # define __ACC_CXX_HAVE_PLACEMENT_NEW 1
4216 #if (__ACC_CXX_HAVE_PLACEMENT_NEW)
4217 # if (ACC_CC_GNUC >= 0x030000ul)
4218 # define __ACC_CXX_HAVE_PLACEMENT_DELETE 1
4219 # elif (ACC_CC_INTELC)
4220 # define __ACC_CXX_HAVE_PLACEMENT_DELETE 1
4221 # elif (ACC_CC_MSC && (_MSC_VER >= 1200))
4222 # define __ACC_CXX_HAVE_PLACEMENT_DELETE 1
4223 # elif (ACC_CC_CLANG || ACC_CC_LLVM || ACC_CC_PATHSCALE)
4224 # define __ACC_CXX_HAVE_PLACEMENT_DELETE 1
4226 # define __ACC_CXX_HAVE_PLACEMENT_DELETE 1
4229 #if defined(ACC_CXX_DISABLE_NEW_DELETE)
4230 #elif defined(new) || defined(delete)
4231 # define ACC_CXX_DISABLE_NEW_DELETE private:
4232 #elif (ACC_CC_GNUC && (ACC_CC_GNUC < 0x025b00ul))
4233 # define ACC_CXX_DISABLE_NEW_DELETE private:
4234 #elif (ACC_CC_HIGHC)
4235 # define ACC_CXX_DISABLE_NEW_DELETE private:
4236 #elif !(__ACC_CXX_HAVE_ARRAY_NEW)
4237 # define ACC_CXX_DISABLE_NEW_DELETE \
4238 protected: static void operator delete(void*) __ACC_CXX_DO_DELETE \
4239 protected: static void* operator new(size_t) __ACC_CXX_DO_NEW \
4242 # define ACC_CXX_DISABLE_NEW_DELETE \
4243 protected: static void operator delete(void*) __ACC_CXX_DO_DELETE \
4244 static void operator delete[](void*) __ACC_CXX_DO_DELETE \
4245 private: static void* operator new(size_t) __ACC_CXX_DO_NEW \
4246 static void* operator new[](size_t) __ACC_CXX_DO_NEW
4248 #if defined(ACC_CXX_TRIGGER_FUNCTION)
4250 # define ACC_CXX_TRIGGER_FUNCTION \
4251 protected: virtual const void* acc_cxx_trigger_function() const; \
4254 #if defined(ACC_CXX_TRIGGER_FUNCTION_IMPL)
4256 # define ACC_CXX_TRIGGER_FUNCTION_IMPL(klass) \
4257 const void* klass::acc_cxx_trigger_function() const { return 0; }
4262 #if defined(ACC_WANT_ACC_CHK_CH)
4263 # undef ACC_WANT_ACC_CHK_CH
4264 #if !defined(ACCCHK_ASSERT)
4265 # define ACCCHK_ASSERT(expr) ACC_COMPILE_TIME_ASSERT_HEADER(expr)
4267 #if !defined(ACCCHK_ASSERT_SIGN_T)
4268 # define ACCCHK_ASSERT_SIGN_T(type,relop) \
4269 ACCCHK_ASSERT( (type) (-1) relop (type) 0 ) \
4270 ACCCHK_ASSERT( (type) (~(type)0) relop (type) 0 ) \
4271 ACCCHK_ASSERT( (type) (~(type)0) == (type) (-1) )
4273 #if !defined(ACCCHK_ASSERT_IS_SIGNED_T)
4274 # define ACCCHK_ASSERT_IS_SIGNED_T(type) ACCCHK_ASSERT_SIGN_T(type,<)
4276 #if !defined(ACCCHK_ASSERT_IS_UNSIGNED_T)
4277 # if (ACC_BROKEN_INTEGRAL_PROMOTION)
4278 # define ACCCHK_ASSERT_IS_UNSIGNED_T(type) \
4279 ACCCHK_ASSERT( (type) (-1) > (type) 0 )
4281 # define ACCCHK_ASSERT_IS_UNSIGNED_T(type) ACCCHK_ASSERT_SIGN_T(type,>)
4284 #if (ACC_CC_BORLANDC && (__BORLANDC__ >= 0x0550) && (__BORLANDC__ < 0x0560))
4285 # pragma option push -w-8055
4286 #elif (ACC_CC_BORLANDC && (__BORLANDC__ >= 0x0530) && (__BORLANDC__ < 0x0550))
4287 # pragma option push -w-osh
4289 #if (ACC_0xffffffffL - ACC_UINT32_C(4294967294) != 1)
4290 # error "preprocessor error 1"
4292 #if (ACC_0xffffffffL - ACC_UINT32_C(0xfffffffd) != 2)
4293 # error "preprocessor error 2"
4295 #define ACCCHK_VAL 1
4296 #define ACCCHK_TMP1 ACCCHK_VAL
4298 #define ACCCHK_VAL 2
4299 #define ACCCHK_TMP2 ACCCHK_VAL
4300 #if (ACCCHK_TMP1 != 2)
4301 # error "preprocessor error 3a"
4303 #if (ACCCHK_TMP2 != 2)
4304 # error "preprocessor error 3b"
4308 # error "preprocessor error 3c"
4310 #if (ACCCHK_TMP2 + 0 != 0)
4311 # error "preprocessor error 3d"
4315 #if 0 || defined(ACCCHK_CFG_PEDANTIC)
4316 # if (ACC_ARCH_MIPS) && defined(_MIPS_SZINT)
4317 ACCCHK_ASSERT((_MIPS_SZINT) == 8 * sizeof(int))
4319 # if (ACC_ARCH_MIPS) && defined(_MIPS_SZLONG)
4320 ACCCHK_ASSERT((_MIPS_SZLONG) == 8 * sizeof(long))
4322 # if (ACC_ARCH_MIPS) && defined(_MIPS_SZPTR)
4323 ACCCHK_ASSERT((_MIPS_SZPTR) == 8 * sizeof(void *))
4326 ACCCHK_ASSERT(1 == 1)
4327 ACCCHK_ASSERT(__ACC_MASK_GEN(1u,2) == 3)
4328 ACCCHK_ASSERT(__ACC_MASK_GEN(1u,8) == 255)
4329 #if (SIZEOF_INT >= 2)
4330 ACCCHK_ASSERT(__ACC_MASK_GEN(1,15) == 32767)
4331 ACCCHK_ASSERT(__ACC_MASK_GEN(1u,16) == 0xffffU)
4333 ACCCHK_ASSERT(__ACC_MASK_GEN(1ul,16) == 0xffffUL)
4335 #if (SIZEOF_INT >= 4)
4336 ACCCHK_ASSERT(__ACC_MASK_GEN(1,31) == 2147483647)
4337 ACCCHK_ASSERT(__ACC_MASK_GEN(1u,32) == 0xffffffffU)
4339 #if (SIZEOF_LONG >= 4)
4340 ACCCHK_ASSERT(__ACC_MASK_GEN(1ul,32) == 0xffffffffUL)
4342 #if (SIZEOF_LONG >= 8)
4343 ACCCHK_ASSERT(__ACC_MASK_GEN(1ul,64) == 0xffffffffffffffffUL)
4345 #if !(ACC_BROKEN_INTEGRAL_PROMOTION)
4346 ACCCHK_ASSERT(__ACC_MASK_GEN(1u,SIZEOF_INT*8) == ~0u)
4347 ACCCHK_ASSERT(__ACC_MASK_GEN(1ul,SIZEOF_LONG*8) == ~0ul)
4349 #if !(ACC_BROKEN_SIGNED_RIGHT_SHIFT)
4350 ACCCHK_ASSERT(((-1) >> 7) == -1)
4352 ACCCHK_ASSERT(((1) >> 7) == 0)
4353 ACCCHK_ASSERT((~0l & ~0) == ~0l)
4354 ACCCHK_ASSERT((~0l & ~0u) == ~0u)
4355 ACCCHK_ASSERT((~0ul & ~0) == ~0ul)
4356 ACCCHK_ASSERT((~0ul & ~0u) == ~0u)
4357 #if defined(__MSDOS__) && defined(__TURBOC__) && (__TURBOC__ < 0x0150)
4358 #elif (SIZEOF_INT == 2)
4359 ACCCHK_ASSERT((~0l & ~0u) == 0xffffU)
4360 ACCCHK_ASSERT((~0ul & ~0u) == 0xffffU)
4361 #elif (SIZEOF_INT == 4)
4362 ACCCHK_ASSERT((~0l & ~0u) == 0xffffffffU)
4363 ACCCHK_ASSERT((~0ul & ~0u) == 0xffffffffU)
4365 ACCCHK_ASSERT_IS_SIGNED_T(signed char)
4366 ACCCHK_ASSERT_IS_UNSIGNED_T(unsigned char)
4367 ACCCHK_ASSERT(sizeof(signed char) == sizeof(char))
4368 ACCCHK_ASSERT(sizeof(unsigned char) == sizeof(char))
4369 ACCCHK_ASSERT(sizeof(char) == 1)
4370 #if (ACC_CC_CILLY) && (!defined(__CILLY__) || (__CILLY__ < 0x010302L))
4372 ACCCHK_ASSERT(sizeof(char) == sizeof((char)0))
4374 #if defined(__cplusplus)
4375 ACCCHK_ASSERT(sizeof('\0') == sizeof(char))
4379 ACCCHK_ASSERT(sizeof('\0') == sizeof(int))
4382 #if defined(__acc_alignof)
4383 ACCCHK_ASSERT(__acc_alignof(char) == 1)
4384 ACCCHK_ASSERT(__acc_alignof(signed char) == 1)
4385 ACCCHK_ASSERT(__acc_alignof(unsigned char) == 1)
4386 #if defined(acc_int16e_t)
4387 ACCCHK_ASSERT(__acc_alignof(acc_int16e_t) >= 1)
4388 ACCCHK_ASSERT(__acc_alignof(acc_int16e_t) <= 2)
4390 #if defined(acc_int32e_t)
4391 ACCCHK_ASSERT(__acc_alignof(acc_int32e_t) >= 1)
4392 ACCCHK_ASSERT(__acc_alignof(acc_int32e_t) <= 4)
4395 ACCCHK_ASSERT_IS_SIGNED_T(short)
4396 ACCCHK_ASSERT_IS_UNSIGNED_T(unsigned short)
4397 ACCCHK_ASSERT(sizeof(short) == sizeof(unsigned short))
4398 #if !(ACC_ABI_I8LP16)
4399 ACCCHK_ASSERT(sizeof(short) >= 2)
4401 ACCCHK_ASSERT(sizeof(short) >= sizeof(char))
4402 #if (ACC_CC_CILLY) && (!defined(__CILLY__) || (__CILLY__ < 0x010302L))
4404 ACCCHK_ASSERT(sizeof(short) == sizeof((short)0))
4406 #if (SIZEOF_SHORT > 0)
4407 ACCCHK_ASSERT(sizeof(short) == SIZEOF_SHORT)
4409 ACCCHK_ASSERT_IS_SIGNED_T(int)
4410 ACCCHK_ASSERT_IS_UNSIGNED_T(unsigned int)
4411 ACCCHK_ASSERT(sizeof(int) == sizeof(unsigned int))
4412 #if !(ACC_ABI_I8LP16)
4413 ACCCHK_ASSERT(sizeof(int) >= 2)
4415 ACCCHK_ASSERT(sizeof(int) >= sizeof(short))
4416 ACCCHK_ASSERT(sizeof(int) == sizeof(0))
4417 ACCCHK_ASSERT(sizeof(int) == sizeof((int)0))
4418 #if (SIZEOF_INT > 0)
4419 ACCCHK_ASSERT(sizeof(int) == SIZEOF_INT)
4421 ACCCHK_ASSERT(sizeof(0) == sizeof(int))
4422 ACCCHK_ASSERT_IS_SIGNED_T(long)
4423 ACCCHK_ASSERT_IS_UNSIGNED_T(unsigned long)
4424 ACCCHK_ASSERT(sizeof(long) == sizeof(unsigned long))
4425 #if !(ACC_ABI_I8LP16)
4426 ACCCHK_ASSERT(sizeof(long) >= 4)
4428 ACCCHK_ASSERT(sizeof(long) >= sizeof(int))
4429 ACCCHK_ASSERT(sizeof(long) == sizeof(0L))
4430 ACCCHK_ASSERT(sizeof(long) == sizeof((long)0))
4431 #if (SIZEOF_LONG > 0)
4432 ACCCHK_ASSERT(sizeof(long) == SIZEOF_LONG)
4434 ACCCHK_ASSERT(sizeof(0L) == sizeof(long))
4435 ACCCHK_ASSERT_IS_UNSIGNED_T(size_t)
4436 ACCCHK_ASSERT(sizeof(size_t) >= sizeof(int))
4437 ACCCHK_ASSERT(sizeof(size_t) == sizeof(sizeof(0)))
4438 #if (SIZEOF_SIZE_T > 0)
4439 ACCCHK_ASSERT(sizeof(size_t) == SIZEOF_SIZE_T)
4441 ACCCHK_ASSERT_IS_SIGNED_T(ptrdiff_t)
4442 ACCCHK_ASSERT(sizeof(ptrdiff_t) >= sizeof(int))
4443 ACCCHK_ASSERT(sizeof(ptrdiff_t) >= sizeof(size_t))
4444 #if !(ACC_BROKEN_SIZEOF)
4445 ACCCHK_ASSERT(sizeof(ptrdiff_t) == sizeof((char*)0 - (char*)0))
4446 # if (ACC_HAVE_MM_HUGE_PTR)
4447 ACCCHK_ASSERT(4 == sizeof((char __huge*)0 - (char __huge*)0))
4450 #if (SIZEOF_PTRDIFF_T > 0)
4451 ACCCHK_ASSERT(sizeof(ptrdiff_t) == SIZEOF_PTRDIFF_T)
4453 ACCCHK_ASSERT(sizeof(void*) >= sizeof(char*))
4454 #if (SIZEOF_VOID_P > 0)
4455 ACCCHK_ASSERT(sizeof(void*) == SIZEOF_VOID_P)
4456 ACCCHK_ASSERT(sizeof(char*) == SIZEOF_VOID_P)
4458 #if (ACC_HAVE_MM_HUGE_PTR)
4459 ACCCHK_ASSERT(4 == sizeof(void __huge*))
4460 ACCCHK_ASSERT(4 == sizeof(char __huge*))
4462 #if (ACC_ABI_I8LP16)
4463 ACCCHK_ASSERT((((1u << 7) + 1) >> 7) == 1)
4464 ACCCHK_ASSERT((((1ul << 15) + 1) >> 15) == 1)
4466 ACCCHK_ASSERT((((1u << 15) + 1) >> 15) == 1)
4467 ACCCHK_ASSERT((((1ul << 31) + 1) >> 31) == 1)
4469 #if defined(__MSDOS__) && defined(__TURBOC__) && (__TURBOC__ < 0x0150)
4470 #elif 1 && (ACC_CC_SUNPROC) && !defined(ACCCHK_CFG_PEDANTIC)
4472 ACCCHK_ASSERT((int)(1u << (8*SIZEOF_INT-1)) < 0)
4474 ACCCHK_ASSERT((1u << (8*SIZEOF_INT-1)) > 0)
4475 #if 1 && (ACC_CC_SUNPROC) && !defined(ACCCHK_CFG_PEDANTIC)
4477 ACCCHK_ASSERT((long)(1ul << (8*SIZEOF_LONG-1)) < 0)
4479 ACCCHK_ASSERT((1ul << (8*SIZEOF_LONG-1)) > 0)
4480 #if defined(acc_int16e_t)
4481 ACCCHK_ASSERT(sizeof(acc_int16e_t) == 2)
4482 ACCCHK_ASSERT(sizeof(acc_int16e_t) == SIZEOF_ACC_INT16E_T)
4483 ACCCHK_ASSERT(sizeof(acc_uint16e_t) == 2)
4484 ACCCHK_ASSERT(sizeof(acc_int16e_t) == sizeof(acc_uint16e_t))
4485 ACCCHK_ASSERT_IS_SIGNED_T(acc_int16e_t)
4486 ACCCHK_ASSERT_IS_UNSIGNED_T(acc_uint16e_t)
4487 #if defined(__MSDOS__) && defined(__TURBOC__) && (__TURBOC__ < 0x0150)
4489 ACCCHK_ASSERT(((acc_uint16e_t)(~(acc_uint16e_t)0ul) >> 15) == 1)
4491 ACCCHK_ASSERT( (acc_int16e_t) (1 + ~(acc_int16e_t)0) == 0)
4492 #if defined(ACCCHK_CFG_PEDANTIC)
4493 ACCCHK_ASSERT( (acc_uint16e_t)(1 + ~(acc_uint16e_t)0) == 0)
4496 #if defined(acc_int32e_t)
4497 ACCCHK_ASSERT(sizeof(acc_int32e_t) == 4)
4498 ACCCHK_ASSERT(sizeof(acc_int32e_t) == SIZEOF_ACC_INT32E_T)
4499 ACCCHK_ASSERT(sizeof(acc_uint32e_t) == 4)
4500 ACCCHK_ASSERT(sizeof(acc_int32e_t) == sizeof(acc_uint32e_t))
4501 ACCCHK_ASSERT_IS_SIGNED_T(acc_int32e_t)
4502 ACCCHK_ASSERT(((( (acc_int32e_t)1 << 30) + 1) >> 30) == 1)
4503 ACCCHK_ASSERT_IS_UNSIGNED_T(acc_uint32e_t)
4504 ACCCHK_ASSERT(((( (acc_uint32e_t)1 << 31) + 1) >> 31) == 1)
4505 ACCCHK_ASSERT(((acc_uint32e_t)(~(acc_uint32e_t)0ul) >> 31) == 1)
4506 ACCCHK_ASSERT( (acc_int32e_t) (1 + ~(acc_int32e_t)0) == 0)
4507 #if defined(ACCCHK_CFG_PEDANTIC)
4508 ACCCHK_ASSERT( (acc_uint32e_t)(1 + ~(acc_uint32e_t)0) == 0)
4511 #if defined(acc_int32e_t)
4512 ACCCHK_ASSERT(sizeof(acc_int32l_t) >= sizeof(acc_int32e_t))
4514 ACCCHK_ASSERT(sizeof(acc_int32l_t) >= 4)
4515 ACCCHK_ASSERT(sizeof(acc_int32l_t) == SIZEOF_ACC_INT32L_T)
4516 ACCCHK_ASSERT(sizeof(acc_uint32l_t) >= 4)
4517 ACCCHK_ASSERT(sizeof(acc_int32l_t) == sizeof(acc_uint32l_t))
4518 ACCCHK_ASSERT_IS_SIGNED_T(acc_int32l_t)
4519 ACCCHK_ASSERT(((( (acc_int32l_t)1 << 30) + 1) >> 30) == 1)
4520 ACCCHK_ASSERT_IS_UNSIGNED_T(acc_uint32l_t)
4521 ACCCHK_ASSERT(((( (acc_uint32l_t)1 << 31) + 1) >> 31) == 1)
4522 ACCCHK_ASSERT(sizeof(acc_int32f_t) >= sizeof(int))
4523 #if defined(acc_int32e_t)
4524 ACCCHK_ASSERT(sizeof(acc_int32f_t) >= sizeof(acc_int32e_t))
4526 ACCCHK_ASSERT(sizeof(acc_int32f_t) >= sizeof(acc_int32l_t))
4527 ACCCHK_ASSERT(sizeof(acc_int32f_t) >= 4)
4528 ACCCHK_ASSERT(sizeof(acc_int32f_t) >= sizeof(acc_int32l_t))
4529 ACCCHK_ASSERT(sizeof(acc_int32f_t) == SIZEOF_ACC_INT32F_T)
4530 ACCCHK_ASSERT(sizeof(acc_uint32f_t) >= 4)
4531 ACCCHK_ASSERT(sizeof(acc_uint32f_t) >= sizeof(acc_uint32l_t))
4532 ACCCHK_ASSERT(sizeof(acc_int32f_t) == sizeof(acc_uint32f_t))
4533 ACCCHK_ASSERT_IS_SIGNED_T(acc_int32f_t)
4534 ACCCHK_ASSERT(((( (acc_int32f_t)1 << 30) + 1) >> 30) == 1)
4535 ACCCHK_ASSERT_IS_UNSIGNED_T(acc_uint32f_t)
4536 ACCCHK_ASSERT(((( (acc_uint32f_t)1 << 31) + 1) >> 31) == 1)
4537 #if defined(acc_int64e_t)
4538 ACCCHK_ASSERT(sizeof(acc_int64e_t) == 8)
4539 ACCCHK_ASSERT(sizeof(acc_int64e_t) == SIZEOF_ACC_INT64E_T)
4540 ACCCHK_ASSERT(sizeof(acc_uint64e_t) == 8)
4541 ACCCHK_ASSERT(sizeof(acc_int64e_t) == sizeof(acc_uint64e_t))
4542 ACCCHK_ASSERT_IS_SIGNED_T(acc_int64e_t)
4543 #if (ACC_CC_BORLANDC && (__BORLANDC__ < 0x0530))
4545 ACCCHK_ASSERT_IS_UNSIGNED_T(acc_uint64e_t)
4548 #if defined(acc_int64l_t)
4549 #if defined(acc_int64e_t)
4550 ACCCHK_ASSERT(sizeof(acc_int64l_t) >= sizeof(acc_int64e_t))
4552 ACCCHK_ASSERT(sizeof(acc_int64l_t) >= 8)
4553 ACCCHK_ASSERT(sizeof(acc_int64l_t) == SIZEOF_ACC_INT64L_T)
4554 ACCCHK_ASSERT(sizeof(acc_uint64l_t) >= 8)
4555 ACCCHK_ASSERT(sizeof(acc_int64l_t) == sizeof(acc_uint64l_t))
4556 ACCCHK_ASSERT_IS_SIGNED_T(acc_int64l_t)
4557 ACCCHK_ASSERT(((( (acc_int64l_t)1 << 62) + 1) >> 62) == 1)
4558 ACCCHK_ASSERT(((( ACC_INT64_C(1) << 62) + 1) >> 62) == 1)
4559 #if (ACC_CC_BORLANDC && (__BORLANDC__ < 0x0530))
4561 ACCCHK_ASSERT_IS_UNSIGNED_T(acc_uint64l_t)
4562 ACCCHK_ASSERT(ACC_UINT64_C(18446744073709551615) > 0)
4564 ACCCHK_ASSERT(((( (acc_uint64l_t)1 << 63) + 1) >> 63) == 1)
4565 ACCCHK_ASSERT(((( ACC_UINT64_C(1) << 63) + 1) >> 63) == 1)
4566 #if (ACC_CC_GNUC && (ACC_CC_GNUC < 0x020600ul))
4567 ACCCHK_ASSERT(ACC_INT64_C(9223372036854775807) > ACC_INT64_C(0))
4569 ACCCHK_ASSERT(ACC_INT64_C(9223372036854775807) > 0)
4571 ACCCHK_ASSERT(ACC_INT64_C(-9223372036854775807) - 1 < 0)
4572 ACCCHK_ASSERT( ACC_INT64_C(9223372036854775807) % ACC_INT32_C(2147483629) == 721)
4573 ACCCHK_ASSERT( ACC_INT64_C(9223372036854775807) % ACC_INT32_C(2147483647) == 1)
4574 ACCCHK_ASSERT(ACC_UINT64_C(9223372036854775807) % ACC_UINT32_C(2147483629) == 721)
4575 ACCCHK_ASSERT(ACC_UINT64_C(9223372036854775807) % ACC_UINT32_C(2147483647) == 1)
4577 #if !defined(__ACC_INTPTR_T_IS_POINTER)
4578 ACCCHK_ASSERT_IS_SIGNED_T(acc_intptr_t)
4579 ACCCHK_ASSERT_IS_UNSIGNED_T(acc_uintptr_t)
4581 ACCCHK_ASSERT(sizeof(acc_intptr_t) >= sizeof(void *))
4582 ACCCHK_ASSERT(sizeof(acc_intptr_t) == SIZEOF_ACC_INTPTR_T)
4583 ACCCHK_ASSERT(sizeof(acc_intptr_t) == sizeof(acc_uintptr_t))
4584 #if defined(acc_word_t)
4585 ACCCHK_ASSERT(ACC_WORDSIZE == SIZEOF_ACC_WORD_T)
4586 ACCCHK_ASSERT_IS_UNSIGNED_T(acc_word_t)
4587 ACCCHK_ASSERT_IS_SIGNED_T(acc_sword_t)
4588 ACCCHK_ASSERT(sizeof(acc_word_t) == SIZEOF_ACC_WORD_T)
4589 ACCCHK_ASSERT(sizeof(acc_word_t) == sizeof(acc_sword_t))
4591 #if defined(ACC_INT16_C)
4592 ACCCHK_ASSERT(sizeof(ACC_INT16_C(0)) >= 2)
4593 ACCCHK_ASSERT(sizeof(ACC_UINT16_C(0)) >= 2)
4594 ACCCHK_ASSERT((ACC_UINT16_C(0xffff) >> 15) == 1)
4596 #if defined(ACC_INT32_C)
4597 ACCCHK_ASSERT(sizeof(ACC_INT32_C(0)) >= 4)
4598 ACCCHK_ASSERT(sizeof(ACC_UINT32_C(0)) >= 4)
4599 ACCCHK_ASSERT((ACC_UINT32_C(0xffffffff) >> 31) == 1)
4601 #if defined(ACC_INT64_C)
4602 #if (ACC_CC_BORLANDC && (__BORLANDC__ < 0x0560))
4604 ACCCHK_ASSERT(sizeof(ACC_INT64_C(0)) >= 8)
4605 ACCCHK_ASSERT(sizeof(ACC_UINT64_C(0)) >= 8)
4607 ACCCHK_ASSERT((ACC_UINT64_C(0xffffffffffffffff) >> 63) == 1)
4608 ACCCHK_ASSERT((ACC_UINT64_C(0xffffffffffffffff) & ~0) == ACC_UINT64_C(0xffffffffffffffff))
4609 ACCCHK_ASSERT((ACC_UINT64_C(0xffffffffffffffff) & ~0l) == ACC_UINT64_C(0xffffffffffffffff))
4610 #if (SIZEOF_INT == 4)
4611 # if (ACC_CC_GNUC && (ACC_CC_GNUC < 0x020000ul))
4613 ACCCHK_ASSERT((ACC_UINT64_C(0xffffffffffffffff) & ~0u) == 0xffffffffu)
4616 #if (SIZEOF_LONG == 4)
4617 # if (ACC_CC_GNUC && (ACC_CC_GNUC < 0x020000ul))
4619 ACCCHK_ASSERT((ACC_UINT64_C(0xffffffffffffffff) & ~0ul) == 0xfffffffful)
4623 #if (ACC_MM_TINY || ACC_MM_SMALL || ACC_MM_MEDIUM)
4624 ACCCHK_ASSERT(sizeof(void*) == 2)
4625 ACCCHK_ASSERT(sizeof(ptrdiff_t) == 2)
4626 #elif (ACC_MM_COMPACT || ACC_MM_LARGE || ACC_MM_HUGE)
4627 ACCCHK_ASSERT(sizeof(void*) == 4)
4629 #if (ACC_MM_TINY || ACC_MM_SMALL || ACC_MM_COMPACT)
4630 ACCCHK_ASSERT(sizeof(void (*)(void)) == 2)
4631 #elif (ACC_MM_MEDIUM || ACC_MM_LARGE || ACC_MM_HUGE)
4632 ACCCHK_ASSERT(sizeof(void (*)(void)) == 4)
4635 ACCCHK_ASSERT(sizeof(int) == 4)
4636 ACCCHK_ASSERT(sizeof(long) == 4)
4637 ACCCHK_ASSERT(sizeof(void*) == 4)
4638 ACCCHK_ASSERT(sizeof(ptrdiff_t) == sizeof(void*))
4639 ACCCHK_ASSERT(sizeof(size_t) == sizeof(void*))
4640 ACCCHK_ASSERT(sizeof(acc_intptr_t) == sizeof(void *))
4643 ACCCHK_ASSERT(sizeof(int) == 8)
4644 ACCCHK_ASSERT(sizeof(long) == 8)
4645 ACCCHK_ASSERT(sizeof(void*) == 8)
4646 ACCCHK_ASSERT(sizeof(ptrdiff_t) == sizeof(void*))
4647 ACCCHK_ASSERT(sizeof(size_t) == sizeof(void*))
4648 ACCCHK_ASSERT(sizeof(acc_intptr_t) == sizeof(void *))
4650 #if (ACC_ABI_IP32L64)
4651 ACCCHK_ASSERT(sizeof(int) == 4)
4652 ACCCHK_ASSERT(sizeof(long) == 8)
4653 ACCCHK_ASSERT(sizeof(void*) == 4)
4654 ACCCHK_ASSERT(sizeof(ptrdiff_t) == sizeof(void*))
4655 ACCCHK_ASSERT(sizeof(size_t) == sizeof(void*))
4656 ACCCHK_ASSERT(sizeof(acc_intptr_t) == sizeof(void *))
4659 ACCCHK_ASSERT(sizeof(int) == 4)
4660 ACCCHK_ASSERT(sizeof(long) == 4)
4661 ACCCHK_ASSERT(sizeof(void*) == 8)
4662 ACCCHK_ASSERT(sizeof(ptrdiff_t) == sizeof(void*))
4663 ACCCHK_ASSERT(sizeof(size_t) == sizeof(void*))
4664 ACCCHK_ASSERT(sizeof(acc_intptr_t) == sizeof(void *))
4667 ACCCHK_ASSERT(sizeof(int) == 2)
4668 ACCCHK_ASSERT(sizeof(long) == 4)
4669 ACCCHK_ASSERT(sizeof(void*) == 4)
4670 ACCCHK_ASSERT(sizeof(acc_intptr_t) == sizeof(void *))
4673 ACCCHK_ASSERT(sizeof(int) == 4)
4674 ACCCHK_ASSERT(sizeof(long) == 8)
4675 ACCCHK_ASSERT(sizeof(void*) == 8)
4676 ACCCHK_ASSERT(sizeof(ptrdiff_t) == sizeof(void*))
4677 ACCCHK_ASSERT(sizeof(size_t) == sizeof(void*))
4678 ACCCHK_ASSERT(sizeof(acc_intptr_t) == sizeof(void *))
4681 ACCCHK_ASSERT(sizeof(size_t) == 2)
4682 ACCCHK_ASSERT(sizeof(acc_intptr_t) == sizeof(void *))
4683 #elif (ACC_ARCH_I386 || ACC_ARCH_M68K)
4684 ACCCHK_ASSERT(sizeof(size_t) == 4)
4685 ACCCHK_ASSERT(sizeof(ptrdiff_t) == 4)
4686 ACCCHK_ASSERT(sizeof(acc_intptr_t) == sizeof(void *))
4688 #if (ACC_OS_DOS32 || ACC_OS_OS2 || ACC_OS_WIN32)
4689 ACCCHK_ASSERT(sizeof(size_t) == 4)
4690 ACCCHK_ASSERT(sizeof(ptrdiff_t) == 4)
4691 ACCCHK_ASSERT(sizeof(void (*)(void)) == 4)
4692 #elif (ACC_OS_WIN64)
4693 ACCCHK_ASSERT(sizeof(size_t) == 8)
4694 ACCCHK_ASSERT(sizeof(ptrdiff_t) == 8)
4695 ACCCHK_ASSERT(sizeof(void (*)(void)) == 8)
4698 #elif (SIZEOF_INT > 1)
4699 ACCCHK_ASSERT( (int) ((unsigned char) ((signed char) -1)) == 255)
4703 #elif 1 && (ACC_CC_LCC || ACC_CC_LCCWIN32) && !defined(ACCCHK_CFG_PEDANTIC)
4704 #elif 1 && (ACC_CC_SUNPROC) && !defined(ACCCHK_CFG_PEDANTIC)
4705 #elif !(ACC_BROKEN_INTEGRAL_PROMOTION) && (SIZEOF_INT > 1)
4706 ACCCHK_ASSERT( (int)((unsigned int)((unsigned char)128) << (int)(8*sizeof(int)-8)) < 0)
4708 #if (ACC_CC_BORLANDC && (__BORLANDC__ >= 0x0530) && (__BORLANDC__ < 0x0560))
4712 #if defined(ACC_WANT_ACCLIB_UA)
4713 # undef ACC_WANT_ACCLIB_UA
4714 #define __ACCLIB_UA_CH_INCLUDED 1
4715 #if !defined(ACCLIB_PUBLIC)
4716 # define ACCLIB_PUBLIC(r,f) r __ACCLIB_FUNCNAME(f)
4718 ACCLIB_PUBLIC(unsigned, acc_ua_get_be16) (const acc_hvoid_p p)
4720 #if defined(ACC_UA_GET_BE16)
4721 return ACC_UA_GET_BE16(p);
4723 const acc_hbyte_p b = (const acc_hbyte_p) p;
4724 return ((unsigned)b[1]) | ((unsigned)b[0] << 8);
4727 ACCLIB_PUBLIC(acc_uint32l_t, acc_ua_get_be24) (const acc_hvoid_p p)
4729 const acc_hbyte_p b = (const acc_hbyte_p) p;
4730 return ((acc_uint32l_t)b[2]) | ((acc_uint32l_t)b[1] << 8) | ((acc_uint32l_t)b[0] << 16);
4732 ACCLIB_PUBLIC(acc_uint32l_t, acc_ua_get_be32) (const acc_hvoid_p p)
4734 #if defined(ACC_UA_GET_BE32)
4735 return ACC_UA_GET_BE32(p);
4737 const acc_hbyte_p b = (const acc_hbyte_p) p;
4738 return ((acc_uint32l_t)b[3]) | ((acc_uint32l_t)b[2] << 8) | ((acc_uint32l_t)b[1] << 16) | ((acc_uint32l_t)b[0] << 24);
4741 ACCLIB_PUBLIC(void, acc_ua_set_be16) (acc_hvoid_p p, unsigned v)
4743 #if defined(ACC_UA_SET_BE16)
4744 ACC_UA_SET_BE16(p, v);
4746 acc_hbyte_p b = (acc_hbyte_p) p;
4747 b[1] = (unsigned char) ((v >> 0) & 0xff);
4748 b[0] = (unsigned char) ((v >> 8) & 0xff);
4751 ACCLIB_PUBLIC(void, acc_ua_set_be24) (acc_hvoid_p p, acc_uint32l_t v)
4753 acc_hbyte_p b = (acc_hbyte_p) p;
4754 b[2] = (unsigned char) ((v >> 0) & 0xff);
4755 b[1] = (unsigned char) ((v >> 8) & 0xff);
4756 b[0] = (unsigned char) ((v >> 16) & 0xff);
4758 ACCLIB_PUBLIC(void, acc_ua_set_be32) (acc_hvoid_p p, acc_uint32l_t v)
4760 #if defined(ACC_UA_SET_BE32)
4761 ACC_UA_SET_BE32(p, v);
4763 acc_hbyte_p b = (acc_hbyte_p) p;
4764 b[3] = (unsigned char) ((v >> 0) & 0xff);
4765 b[2] = (unsigned char) ((v >> 8) & 0xff);
4766 b[1] = (unsigned char) ((v >> 16) & 0xff);
4767 b[0] = (unsigned char) ((v >> 24) & 0xff);
4770 ACCLIB_PUBLIC(unsigned, acc_ua_get_le16) (const acc_hvoid_p p)
4772 #if defined(ACC_UA_GET_LE16)
4773 return ACC_UA_GET_LE16(p);
4775 const acc_hbyte_p b = (const acc_hbyte_p) p;
4776 return ((unsigned)b[0]) | ((unsigned)b[1] << 8);
4779 ACCLIB_PUBLIC(acc_uint32l_t, acc_ua_get_le24) (const acc_hvoid_p p)
4781 const acc_hbyte_p b = (const acc_hbyte_p) p;
4782 return ((acc_uint32l_t)b[0]) | ((acc_uint32l_t)b[1] << 8) | ((acc_uint32l_t)b[2] << 16);
4784 ACCLIB_PUBLIC(acc_uint32l_t, acc_ua_get_le32) (const acc_hvoid_p p)
4786 #if defined(ACC_UA_GET_LE32)
4787 return ACC_UA_GET_LE32(p);
4789 const acc_hbyte_p b = (const acc_hbyte_p) p;
4790 return ((acc_uint32l_t)b[0]) | ((acc_uint32l_t)b[1] << 8) | ((acc_uint32l_t)b[2] << 16) | ((acc_uint32l_t)b[3] << 24);
4793 ACCLIB_PUBLIC(void, acc_ua_set_le16) (acc_hvoid_p p, unsigned v)
4795 #if defined(ACC_UA_SET_LE16)
4796 ACC_UA_SET_LE16(p, v);
4798 acc_hbyte_p b = (acc_hbyte_p) p;
4799 b[0] = (unsigned char) ((v >> 0) & 0xff);
4800 b[1] = (unsigned char) ((v >> 8) & 0xff);
4803 ACCLIB_PUBLIC(void, acc_ua_set_le24) (acc_hvoid_p p, acc_uint32l_t v)
4805 acc_hbyte_p b = (acc_hbyte_p) p;
4806 b[0] = (unsigned char) ((v >> 0) & 0xff);
4807 b[1] = (unsigned char) ((v >> 8) & 0xff);
4808 b[2] = (unsigned char) ((v >> 16) & 0xff);
4810 ACCLIB_PUBLIC(void, acc_ua_set_le32) (acc_hvoid_p p, acc_uint32l_t v)
4812 #if defined(ACC_UA_SET_LE32)
4813 ACC_UA_SET_LE32(p, v);
4815 acc_hbyte_p b = (acc_hbyte_p) p;
4816 b[0] = (unsigned char) ((v >> 0) & 0xff);
4817 b[1] = (unsigned char) ((v >> 8) & 0xff);
4818 b[2] = (unsigned char) ((v >> 16) & 0xff);
4819 b[3] = (unsigned char) ((v >> 24) & 0xff);
4822 #if defined(acc_int64l_t)
4823 ACCLIB_PUBLIC(acc_uint64l_t, acc_ua_get_be64) (const acc_hvoid_p p)
4825 #if defined(ACC_UA_GET_BE64)
4826 return ACC_UA_GET_BE64(p);
4827 #elif defined(ACC_UA_GET_BE32)
4828 const acc_hbyte_p b = (const acc_hbyte_p) p;
4829 acc_uint32e_t v0, v1;
4830 v1 = ACC_UA_GET_BE32(b + 0);
4831 v0 = ACC_UA_GET_BE32(b + 4);
4832 return ((acc_uint64l_t)v0) | ((acc_uint64l_t)v1 << 32);
4833 #elif (ACC_SIZEOF_LONG >= 8) || (ACC_SIZEOF_SIZE_T >= 8)
4834 const acc_hbyte_p b = (const acc_hbyte_p) p;
4835 return ((acc_uint64l_t)b[7]) | ((acc_uint64l_t)b[6] << 8) | ((acc_uint64l_t)b[5] << 16) | ((acc_uint64l_t)b[4] << 24) | ((acc_uint64l_t)b[3] << 32) | ((acc_uint64l_t)b[2] << 40) | ((acc_uint64l_t)b[1] << 48) | ((acc_uint64l_t)b[0] << 56);
4837 const acc_hbyte_p b = (const acc_hbyte_p) p;
4838 acc_uint32l_t v0, v1;
4839 v1 = ((acc_uint32l_t)b[3]) | ((acc_uint32l_t)b[2] << 8) | ((acc_uint32l_t)b[1] << 16) | ((acc_uint32l_t)b[0] << 24);
4841 v0 = ((acc_uint32l_t)b[3]) | ((acc_uint32l_t)b[2] << 8) | ((acc_uint32l_t)b[1] << 16) | ((acc_uint32l_t)b[0] << 24);
4842 return ((acc_uint64l_t)v0) | ((acc_uint64l_t)v1 << 32);
4845 ACCLIB_PUBLIC(void, acc_ua_set_be64) (acc_hvoid_p p, acc_uint64l_t v)
4847 #if defined(ACC_UA_SET_BE64)
4848 ACC_UA_SET_BE64(p, v);
4849 #elif defined(ACC_UA_SET_BE32)
4850 acc_hbyte_p b = (acc_hbyte_p) p;
4851 ACC_UA_SET_BE32(b + 4, (v >> 0));
4852 ACC_UA_SET_BE32(b + 0, (v >> 32));
4853 #elif (ACC_SIZEOF_LONG >= 8) || (ACC_SIZEOF_SIZE_T >= 8)
4854 acc_hbyte_p b = (acc_hbyte_p) p;
4855 b[7] = (unsigned char) ((v >> 0) & 0xff);
4856 b[6] = (unsigned char) ((v >> 8) & 0xff);
4857 b[5] = (unsigned char) ((v >> 16) & 0xff);
4858 b[4] = (unsigned char) ((v >> 24) & 0xff);
4859 b[3] = (unsigned char) ((v >> 32) & 0xff);
4860 b[2] = (unsigned char) ((v >> 40) & 0xff);
4861 b[1] = (unsigned char) ((v >> 48) & 0xff);
4862 b[0] = (unsigned char) ((v >> 56) & 0xff);
4864 acc_hbyte_p b = (acc_hbyte_p) p;
4866 x = (acc_uint32l_t) (v >> 0);
4867 b[7] = (unsigned char) ((x >> 0) & 0xff);
4868 b[6] = (unsigned char) ((x >> 8) & 0xff);
4869 b[5] = (unsigned char) ((x >> 16) & 0xff);
4870 b[4] = (unsigned char) ((x >> 24) & 0xff);
4871 x = (acc_uint32l_t) (v >> 32);
4872 b[3] = (unsigned char) ((x >> 0) & 0xff);
4873 b[2] = (unsigned char) ((x >> 8) & 0xff);
4874 b[1] = (unsigned char) ((x >> 16) & 0xff);
4875 b[0] = (unsigned char) ((x >> 24) & 0xff);
4879 #if defined(acc_int64l_t)
4880 ACCLIB_PUBLIC(acc_uint64l_t, acc_ua_get_le64) (const acc_hvoid_p p)
4882 #if defined(ACC_UA_GET_LE64)
4883 return ACC_UA_GET_LE64(p);
4884 #elif defined(ACC_UA_GET_LE32)
4885 const acc_hbyte_p b = (const acc_hbyte_p) p;
4886 acc_uint32e_t v0, v1;
4887 v0 = ACC_UA_GET_LE32(b + 0);
4888 v1 = ACC_UA_GET_LE32(b + 4);
4889 return ((acc_uint64l_t)v0) | ((acc_uint64l_t)v1 << 32);
4890 #elif (ACC_SIZEOF_LONG >= 8) || (ACC_SIZEOF_SIZE_T >= 8)
4891 const acc_hbyte_p b = (const acc_hbyte_p) p;
4892 return ((acc_uint64l_t)b[0]) | ((acc_uint64l_t)b[1] << 8) | ((acc_uint64l_t)b[2] << 16) | ((acc_uint64l_t)b[3] << 24) | ((acc_uint64l_t)b[4] << 32) | ((acc_uint64l_t)b[5] << 40) | ((acc_uint64l_t)b[6] << 48) | ((acc_uint64l_t)b[7] << 56);
4894 const acc_hbyte_p b = (const acc_hbyte_p) p;
4895 acc_uint32l_t v0, v1;
4896 v0 = ((acc_uint32l_t)b[0]) | ((acc_uint32l_t)b[1] << 8) | ((acc_uint32l_t)b[2] << 16) | ((acc_uint32l_t)b[3] << 24);
4898 v1 = ((acc_uint32l_t)b[0]) | ((acc_uint32l_t)b[1] << 8) | ((acc_uint32l_t)b[2] << 16) | ((acc_uint32l_t)b[3] << 24);
4899 return ((acc_uint64l_t)v0) | ((acc_uint64l_t)v1 << 32);
4902 ACCLIB_PUBLIC(void, acc_ua_set_le64) (acc_hvoid_p p, acc_uint64l_t v)
4904 #if defined(ACC_UA_SET_LE64)
4905 ACC_UA_SET_LE64(p, v);
4906 #elif defined(ACC_UA_SET_LE32)
4907 acc_hbyte_p b = (acc_hbyte_p) p;
4908 ACC_UA_SET_LE32(b + 0, (v >> 0));
4909 ACC_UA_SET_LE32(b + 4, (v >> 32));
4910 #elif (ACC_SIZEOF_LONG >= 8) || (ACC_SIZEOF_SIZE_T >= 8)
4911 acc_hbyte_p b = (acc_hbyte_p) p;
4912 b[0] = (unsigned char) ((v >> 0) & 0xff);
4913 b[1] = (unsigned char) ((v >> 8) & 0xff);
4914 b[2] = (unsigned char) ((v >> 16) & 0xff);
4915 b[3] = (unsigned char) ((v >> 24) & 0xff);
4916 b[4] = (unsigned char) ((v >> 32) & 0xff);
4917 b[5] = (unsigned char) ((v >> 40) & 0xff);
4918 b[6] = (unsigned char) ((v >> 48) & 0xff);
4919 b[7] = (unsigned char) ((v >> 56) & 0xff);
4921 acc_hbyte_p b = (acc_hbyte_p) p;
4923 x = (acc_uint32l_t) (v >> 0);
4924 b[0] = (unsigned char) ((x >> 0) & 0xff);
4925 b[1] = (unsigned char) ((x >> 8) & 0xff);
4926 b[2] = (unsigned char) ((x >> 16) & 0xff);
4927 b[3] = (unsigned char) ((x >> 24) & 0xff);
4928 x = (acc_uint32l_t) (v >> 32);
4929 b[4] = (unsigned char) ((x >> 0) & 0xff);
4930 b[5] = (unsigned char) ((x >> 8) & 0xff);
4931 b[6] = (unsigned char) ((x >> 16) & 0xff);
4932 b[7] = (unsigned char) ((x >> 24) & 0xff);
4937 #if defined(ACC_WANT_ACCLIB_VGET)
4938 # undef ACC_WANT_ACCLIB_VGET
4939 #define __ACCLIB_VGET_CH_INCLUDED 1
4940 #if !defined(ACCLIB_PUBLIC)
4941 # define ACCLIB_PUBLIC(r,f) r __ACCLIB_FUNCNAME(f)
4943 #if !defined(ACCLIB_PUBLIC_NOINLINE)
4944 # if !defined(__acc_noinline)
4945 # define ACCLIB_PUBLIC_NOINLINE(r,f) r __ACCLIB_FUNCNAME(f)
4946 # elif (ACC_CC_CLANG || (ACC_CC_GNUC >= 0x030400ul) || ACC_CC_LLVM)
4947 # define ACCLIB_PUBLIC_NOINLINE(r,f) __acc_noinline __attribute__((__used__)) r __ACCLIB_FUNCNAME(f)
4949 # define ACCLIB_PUBLIC_NOINLINE(r,f) __acc_noinline r __ACCLIB_FUNCNAME(f)
4952 #if (ACC_CC_CLANG || (ACC_CC_GNUC >= 0x030400ul) || ACC_CC_LLVM)
4953 extern void* volatile __acc_vget_ptr;
4954 void* volatile __attribute__((__used__)) __acc_vget_ptr = (void *) 0;
4956 extern void* volatile __acc_vget_ptr;
4957 void* volatile __acc_vget_ptr = (void *) 0;
4959 #ifndef __ACCLIB_VGET_BODY
4960 #define __ACCLIB_VGET_BODY(T) \
4961 if __acc_unlikely(__acc_vget_ptr) { \
4962 * (T *) __acc_vget_ptr = v; \
4963 * (int *) __acc_vget_ptr = expr; \
4964 v = * (T *) __acc_vget_ptr; \
4968 ACCLIB_PUBLIC_NOINLINE(short, acc_vget_short) (short v, int expr)
4970 __ACCLIB_VGET_BODY(short)
4972 ACCLIB_PUBLIC_NOINLINE(int, acc_vget_int) (int v, int expr)
4974 __ACCLIB_VGET_BODY(int)
4976 ACCLIB_PUBLIC_NOINLINE(long, acc_vget_long) (long v, int expr)
4978 __ACCLIB_VGET_BODY(long)
4980 #if defined(acc_int64l_t)
4981 ACCLIB_PUBLIC_NOINLINE(acc_int64l_t, acc_vget_acc_int64l_t) (acc_int64l_t v, int expr)
4983 __ACCLIB_VGET_BODY(acc_int64l_t)
4986 ACCLIB_PUBLIC_NOINLINE(acc_hsize_t, acc_vget_acc_hsize_t) (acc_hsize_t v, int expr)
4988 __ACCLIB_VGET_BODY(acc_hsize_t)
4990 #if !(ACC_CFG_NO_FLOAT)
4991 ACCLIB_PUBLIC_NOINLINE(float, acc_vget_float) (float v, int expr)
4993 __ACCLIB_VGET_BODY(float)
4996 #if !(ACC_CFG_NO_DOUBLE)
4997 ACCLIB_PUBLIC_NOINLINE(double, acc_vget_double) (double v, int expr)
4999 __ACCLIB_VGET_BODY(double)
5002 ACCLIB_PUBLIC_NOINLINE(acc_hvoid_p, acc_vget_acc_hvoid_p) (acc_hvoid_p v, int expr)
5004 __ACCLIB_VGET_BODY(acc_hvoid_p)
5006 #if (ACC_ARCH_I086 && ACC_CC_TURBOC && (__TURBOC__ == 0x0295)) && !defined(__cplusplus)
5007 ACCLIB_PUBLIC_NOINLINE(acc_hvoid_p, acc_vget_acc_hvoid_cp) (const acc_hvoid_p vv, int expr)
5009 acc_hvoid_p v = (acc_hvoid_p) vv;
5010 __ACCLIB_VGET_BODY(acc_hvoid_p)
5013 ACCLIB_PUBLIC_NOINLINE(const acc_hvoid_p, acc_vget_acc_hvoid_cp) (const acc_hvoid_p v, int expr)
5015 __ACCLIB_VGET_BODY(const acc_hvoid_p)
5019 #if defined(ACC_WANT_ACCLIB_HMEMCPY)
5020 # undef ACC_WANT_ACCLIB_HMEMCPY
5021 #define __ACCLIB_HMEMCPY_CH_INCLUDED 1
5022 #if !defined(ACCLIB_PUBLIC)
5023 # define ACCLIB_PUBLIC(r,f) r __ACCLIB_FUNCNAME(f)
5025 ACCLIB_PUBLIC(int, acc_hmemcmp) (const acc_hvoid_p s1, const acc_hvoid_p s2, acc_hsize_t len)
5027 #if (ACC_HAVE_MM_HUGE_PTR) || !(HAVE_MEMCMP)
5028 const acc_hbyte_p p1 = (const acc_hbyte_p) s1;
5029 const acc_hbyte_p p2 = (const acc_hbyte_p) s2;
5030 if __acc_likely(len > 0) do
5036 } while __acc_likely(--len > 0);
5039 return memcmp(s1, s2, len);
5042 ACCLIB_PUBLIC(acc_hvoid_p, acc_hmemcpy) (acc_hvoid_p dest, const acc_hvoid_p src, acc_hsize_t len)
5044 #if (ACC_HAVE_MM_HUGE_PTR) || !(HAVE_MEMCPY)
5045 acc_hbyte_p p1 = (acc_hbyte_p) dest;
5046 const acc_hbyte_p p2 = (const acc_hbyte_p) src;
5047 if (!(len > 0) || p1 == p2)
5051 while __acc_likely(--len > 0);
5054 return memcpy(dest, src, len);
5057 ACCLIB_PUBLIC(acc_hvoid_p, acc_hmemmove) (acc_hvoid_p dest, const acc_hvoid_p src, acc_hsize_t len)
5059 #if (ACC_HAVE_MM_HUGE_PTR) || !(HAVE_MEMMOVE)
5060 acc_hbyte_p p1 = (acc_hbyte_p) dest;
5061 const acc_hbyte_p p2 = (const acc_hbyte_p) src;
5062 if (!(len > 0) || p1 == p2)
5068 while __acc_likely(--len > 0);
5076 while __acc_likely(--len > 0);
5080 return memmove(dest, src, len);
5083 ACCLIB_PUBLIC(acc_hvoid_p, acc_hmemset) (acc_hvoid_p s, int c, acc_hsize_t len)
5085 #if (ACC_HAVE_MM_HUGE_PTR) || !(HAVE_MEMSET)
5086 acc_hbyte_p p = (acc_hbyte_p) s;
5087 if __acc_likely(len > 0) do
5088 *p++ = (unsigned char) c;
5089 while __acc_likely(--len > 0);
5092 return memset(s, c, len);
5096 #if defined(ACC_WANT_ACCLIB_RAND)
5097 # undef ACC_WANT_ACCLIB_RAND
5098 #define __ACCLIB_RAND_CH_INCLUDED 1
5099 #if !defined(ACCLIB_PUBLIC)
5100 # define ACCLIB_PUBLIC(r,f) r __ACCLIB_FUNCNAME(f)
5102 ACCLIB_PUBLIC(void, acc_srand31) (acc_rand31_p r, acc_uint32l_t seed)
5104 r->seed = seed & ACC_UINT32_C(0xffffffff);
5106 ACCLIB_PUBLIC(acc_uint32l_t, acc_rand31) (acc_rand31_p r)
5108 r->seed = r->seed * ACC_UINT32_C(1103515245) + 12345;
5109 r->seed &= ACC_UINT32_C(0x7fffffff);
5112 #if defined(acc_int64l_t)
5113 ACCLIB_PUBLIC(void, acc_srand48) (acc_rand48_p r, acc_uint32l_t seed)
5115 r->seed = seed & ACC_UINT32_C(0xffffffff);
5116 r->seed <<= 16; r->seed |= 0x330e;
5118 ACCLIB_PUBLIC(acc_uint32l_t, acc_rand48) (acc_rand48_p r)
5120 r->seed = r->seed * ACC_UINT64_C(25214903917) + 11;
5121 r->seed &= ACC_UINT64_C(0xffffffffffff);
5122 return (acc_uint32l_t) (r->seed >> 17);
5124 ACCLIB_PUBLIC(acc_uint32l_t, acc_rand48_r32) (acc_rand48_p r)
5126 r->seed = r->seed * ACC_UINT64_C(25214903917) + 11;
5127 r->seed &= ACC_UINT64_C(0xffffffffffff);
5128 return (acc_uint32l_t) (r->seed >> 16);
5131 #if defined(acc_int64l_t)
5132 ACCLIB_PUBLIC(void, acc_srand64) (acc_rand64_p r, acc_uint64l_t seed)
5134 r->seed = seed & ACC_UINT64_C(0xffffffffffffffff);
5136 ACCLIB_PUBLIC(acc_uint32l_t, acc_rand64) (acc_rand64_p r)
5138 r->seed = r->seed * ACC_UINT64_C(6364136223846793005) + 1;
5139 #if (ACC_SIZEOF_ACC_INT64L_T > 8)
5140 r->seed &= ACC_UINT64_C(0xffffffffffffffff);
5142 return (acc_uint32l_t) (r->seed >> 33);
5144 ACCLIB_PUBLIC(acc_uint32l_t, acc_rand64_r32) (acc_rand64_p r)
5146 r->seed = r->seed * ACC_UINT64_C(6364136223846793005) + 1;
5147 #if (ACC_SIZEOF_ACC_INT64L_T > 8)
5148 r->seed &= ACC_UINT64_C(0xffffffffffffffff);
5150 return (acc_uint32l_t) (r->seed >> 32);
5153 ACCLIB_PUBLIC(void, acc_srandmt) (acc_randmt_p r, acc_uint32l_t seed)
5157 r->s[i++] = (seed &= ACC_UINT32_C(0xffffffff));
5159 seed = seed * ACC_UINT32_C(0x6c078965) + i;
5163 ACCLIB_PUBLIC(acc_uint32l_t, acc_randmt) (acc_randmt_p r)
5165 return (__ACCLIB_FUNCNAME(acc_randmt_r32)(r)) >> 1;
5167 ACCLIB_PUBLIC(acc_uint32l_t, acc_randmt_r32) (acc_randmt_p r)
5170 if __acc_unlikely(r->n == 624) {
5174 j = i - 623; if ((int) j < 0) j += 624;
5175 v = (r->s[i] & ACC_UINT32_C(0x80000000)) ^ (r->s[j] & ACC_UINT32_C(0x7fffffff));
5176 j = i - 227; if ((int) j < 0) j += 624;
5177 r->s[i] = r->s[j] ^ (v >> 1);
5178 if (v & 1) r->s[i] ^= ACC_UINT32_C(0x9908b0df);
5179 } while (++i != 624);
5182 v ^= v >> 11; v ^= (v & ACC_UINT32_C(0x013a58ad)) << 7;
5183 v ^= (v & ACC_UINT32_C(0x0001df8c)) << 15; v ^= v >> 18;
5186 #if defined(acc_int64l_t)
5187 ACCLIB_PUBLIC(void, acc_srandmt64) (acc_randmt64_p r, acc_uint64l_t seed)
5191 r->s[i++] = (seed &= ACC_UINT64_C(0xffffffffffffffff));
5193 seed = seed * ACC_UINT64_C(0x5851f42d4c957f2d) + i;
5198 ACCLIB_PUBLIC(acc_uint32l_t, acc_randmt64) (acc_randmt64_p r)
5201 v = (__ACCLIB_FUNCNAME(acc_randmt64_r64)(r)) >> 33;
5202 return (acc_uint32l_t) v;
5205 ACCLIB_PUBLIC(acc_uint64l_t, acc_randmt64_r64) (acc_randmt64_p r)
5208 if __acc_unlikely(r->n == 312) {
5212 j = i - 311; if ((int) j < 0) j += 312;
5213 v = (r->s[i] & ACC_UINT64_C(0xffffffff80000000)) ^ (r->s[j] & ACC_UINT64_C(0x7fffffff));
5214 j = i - 156; if ((int) j < 0) j += 312;
5215 r->s[i] = r->s[j] ^ (v >> 1);
5216 if (v & 1) r->s[i] ^= ACC_UINT64_C(0xb5026f5aa96619e9);
5217 } while (++i != 312);
5220 v ^= (v & ACC_UINT64_C(0xaaaaaaaaa0000000)) >> 29;
5221 v ^= (v & ACC_UINT64_C(0x38eb3ffff6d3)) << 17;
5222 v ^= (v & ACC_UINT64_C(0x7ffbf77)) << 37;
5223 return v ^ (v >> 43);
5227 #if defined(ACC_WANT_ACCLIB_RDTSC)
5228 # undef ACC_WANT_ACCLIB_RDTSC
5229 #define __ACCLIB_RDTSC_CH_INCLUDED 1
5230 #if !defined(ACCLIB_PUBLIC)
5231 # define ACCLIB_PUBLIC(r,f) r __ACCLIB_FUNCNAME(f)
5233 #if defined(acc_int32e_t)
5234 #if (ACC_OS_WIN32 && ACC_CC_PELLESC && (__POCC__ >= 290))
5236 # pragma warn(disable:2007)
5238 #if (ACC_ARCH_AMD64 || ACC_ARCH_I386) && (ACC_ASM_SYNTAX_GNUC)
5239 #if (ACC_ARCH_AMD64 && ACC_CC_PATHSCALE)
5240 # define __ACCLIB_RDTSC_REGS : : "c" (t) : "cc", "memory", "rax", "rdx"
5241 #elif (ACC_ARCH_AMD64 && ACC_CC_INTELC)
5242 # define __ACCLIB_RDTSC_REGS : : "r" (t) : "memory", "rax", "rdx"
5243 #elif (ACC_ARCH_AMD64)
5244 # define __ACCLIB_RDTSC_REGS : : "r" (t) : "cc", "memory", "rax", "rdx"
5245 #elif (ACC_ARCH_I386 && ACC_CC_GNUC && (ACC_CC_GNUC < 0x020000ul))
5246 # define __ACCLIB_RDTSC_REGS : : "r" (t) : "ax", "dx"
5247 #elif (ACC_ARCH_I386 && ACC_CC_INTELC)
5248 # define __ACCLIB_RDTSC_REGS : : "r" (t) : "memory", "eax", "edx"
5249 #elif (ACC_ARCH_I386 && ACC_CC_PATHSCALE)
5250 # define __ACCLIB_RDTSC_REGS : : "c" (t) : "memory", "eax", "edx"
5252 # define __ACCLIB_RDTSC_REGS : : "r" (t) : "cc", "memory", "eax", "edx"
5255 ACCLIB_PUBLIC(int, acc_tsc_read) (acc_uint32e_t* t)
5257 #if (ACC_ARCH_AMD64 || ACC_ARCH_I386) && (ACC_ASM_SYNTAX_GNUC)
5258 __asm__ __volatile__(
5259 "clc \n" ".byte 0x0f,0x31\n"
5260 "movl %%eax,(%0)\n" "movl %%edx,4(%0)\n"
5264 #elif (ACC_ARCH_I386) && (ACC_ASM_SYNTAX_MSC)
5269 # if (ACC_CC_MSC && (_MSC_VER < 1200))
5280 t[0] = t[1] = 0; return -1;
5283 #if (ACC_OS_WIN32 && ACC_CC_PELLESC && (__POCC__ >= 290))
5288 #if defined(ACC_WANT_ACCLIB_DOSALLOC)
5289 # undef ACC_WANT_ACCLIB_DOSALLOC
5290 #define __ACCLIB_DOSALLOC_CH_INCLUDED 1
5291 #if !defined(ACCLIB_PUBLIC)
5292 # define ACCLIB_PUBLIC(r,f) r __ACCLIB_FUNCNAME(f)
5295 ACC_EXTERN_C unsigned short __far __pascal DosAllocHuge(unsigned short, unsigned short, unsigned short __far *, unsigned short, unsigned short);
5296 ACC_EXTERN_C unsigned short __far __pascal DosFreeSeg(unsigned short);
5298 #if (ACC_OS_DOS16 || ACC_OS_WIN16)
5299 #if !(ACC_CC_AZTECC)
5300 ACCLIB_PUBLIC(void __far*, acc_dos_alloc) (unsigned long size)
5304 if ((long)size <= 0)
5306 size = (size + 15) >> 4;
5310 ri.x.bx = (unsigned short) size;
5311 int86(0x21, &ri, &ro);
5312 if ((ro.x.cflag & 1) == 0)
5313 p = (void __far*) ACC_PTR_MK_FP(ro.x.ax, 0);
5316 ACCLIB_PUBLIC(int, acc_dos_free) (void __far* p)
5322 if (ACC_PTR_FP_OFF(p) != 0)
5326 rs.es = ACC_PTR_FP_SEG(p);
5327 int86x(0x21, &ri, &ro, &rs);
5335 ACCLIB_PUBLIC(void __far*, acc_dos_alloc) (unsigned long size)
5338 unsigned short sel = 0;
5339 if ((long)size <= 0)
5341 if (DosAllocHuge((unsigned short)(size >> 16), (unsigned short)size, &sel, 0, 0) == 0)
5342 p = (void __far*) ACC_PTR_MK_FP(sel, 0);
5345 ACCLIB_PUBLIC(int, acc_dos_free) (void __far* p)
5349 if (ACC_PTR_FP_OFF(p) != 0)
5351 if (DosFreeSeg(ACC_PTR_FP_SEG(p)) != 0)
5357 #if defined(ACC_WANT_ACCLIB_GETOPT)
5358 # undef ACC_WANT_ACCLIB_GETOPT
5359 #define __ACCLIB_GETOPT_CH_INCLUDED 1
5360 #if !defined(ACCLIB_PUBLIC)
5361 # define ACCLIB_PUBLIC(r,f) r __ACCLIB_FUNCNAME(f)
5363 ACCLIB_PUBLIC(void, acc_getopt_init) (acc_getopt_p g,
5364 int start_argc, int argc, char** argv)
5366 memset(g, 0, sizeof(*g));
5367 g->optind = start_argc;
5368 g->argc = argc; g->argv = argv;
5371 static int __ACCLIB_FUNCNAME(acc_getopt_rotate) (char** p, int first, int middle, int last)
5373 int i = middle, n = middle - first;
5374 if (first >= middle || middle >= last) return 0;
5377 char* t = p[first]; p[first] = p[i]; p[i] = t;
5378 if (++first == middle)
5380 if (++i == last) break;
5383 else if (++i == last)
5388 static int __ACCLIB_FUNCNAME(acc_getopt_perror) (acc_getopt_p g, int ret, const char* f, ...)
5393 struct { va_list ap; } s;
5395 g->opterr(g, f, &s);
5398 g->opterr(g, f, NULL);
5404 ACCLIB_PUBLIC(int, acc_getopt) (acc_getopt_p g,
5405 const char* shortopts,
5406 const acc_getopt_longopt_p longopts,
5409 #define pe __ACCLIB_FUNCNAME(acc_getopt_perror)
5410 int ordering = ACC_GETOPT_PERMUTE;
5411 int missing_arg_ret = g->bad_option;
5415 if (*shortopts == '-' || *shortopts == '+')
5416 ordering = *shortopts++ == '-' ? ACC_GETOPT_RETURN_IN_ORDER : ACC_GETOPT_REQUIRE_ORDER;
5417 if (*shortopts == ':')
5418 missing_arg_ret = *shortopts++;
5421 if (g->optopt == -1)
5422 g->optopt = g->bad_option;
5428 goto acc_label_next_shortopt;
5429 g->optind -= __ACCLIB_FUNCNAME(acc_getopt_rotate)(g->argv, g->pending_rotate_first, g->pending_rotate_middle, g->optind);
5430 g->pending_rotate_first = g->pending_rotate_middle = g->optind;
5431 if (ordering == ACC_GETOPT_PERMUTE)
5433 while (g->optind < g->argc && !(g->argv[g->optind][0] == '-' && g->argv[g->optind][1]))
5435 g->pending_rotate_middle = g->optind;
5437 if (g->optind >= g->argc)
5439 g->optind = g->pending_rotate_first;
5442 a = g->argv[g->optind];
5443 if (a[0] == '-' && a[1] == '-')
5446 const acc_getopt_longopt_p o;
5447 const acc_getopt_longopt_p o1 = NULL;
5448 const acc_getopt_longopt_p o2 = NULL;
5453 for (a += 2; a[l] && a[l] != '=' && a[l] != '#'; )
5455 for (o = longopts; l && o && o->name; ++o)
5457 if (strncmp(a, o->name, l) != 0)
5460 goto acc_label_found_o;
5461 need_exact |= o->has_arg & ACC_GETOPT_EXACT_ARG;
5465 if (!o1 || need_exact)
5466 return pe(g, g->bad_option, "unrecognized option '--%s'", a);
5468 return pe(g, g->bad_option, "option '--%s' is ambiguous (could be '--%s' or '--%s')", a, o1->name, o2->name);
5472 switch (o->has_arg & 0x2f)
5474 case ACC_GETOPT_OPTIONAL_ARG:
5478 case ACC_GETOPT_REQUIRED_ARG:
5481 else if (g->optind < g->argc)
5482 g->optarg = g->argv[g->optind++];
5484 return pe(g, missing_arg_ret, "option '--%s' requires an argument", o->name);
5486 case ACC_GETOPT_REQUIRED_ARG | 0x20:
5490 return pe(g, missing_arg_ret, "option '--%s=' requires an argument", o->name);
5494 return pe(g, g->bad_option, "option '--%s' doesn't allow an argument", o->name);
5498 *longind = (int) (o - longopts);
5506 if (a[0] == '-' && a[1])
5510 acc_label_next_shortopt:
5511 a = g->argv[g->optind] + ++g->shortpos;
5512 c = (unsigned char) *a++; s = NULL;
5513 if (c != ':' && shortopts)
5514 s = strchr(shortopts, c);
5515 if (!s || s[1] != ':')
5518 ++g->optind, g->shortpos = 0;
5522 return pe(g, g->bad_option, "invalid option '-%c'", c);
5527 ++g->optind, g->shortpos = 0;
5530 else if (s[2] != ':')
5532 if (g->optind < g->argc)
5533 g->optarg = g->argv[g->optind++];
5537 return pe(g, missing_arg_ret, "option '-%c' requires an argument", c);
5543 if (ordering == ACC_GETOPT_RETURN_IN_ORDER)
5550 g->optind -= __ACCLIB_FUNCNAME(acc_getopt_rotate)(g->argv, g->pending_rotate_first, g->pending_rotate_middle, g->optind);
5551 g->pending_rotate_first = g->pending_rotate_middle = g->optind;
5557 #if defined(ACC_WANT_ACCLIB_HALLOC)
5558 # undef ACC_WANT_ACCLIB_HALLOC
5559 #define __ACCLIB_HALLOC_CH_INCLUDED 1
5560 #if !defined(ACCLIB_PUBLIC)
5561 # define ACCLIB_PUBLIC(r,f) r __ACCLIB_FUNCNAME(f)
5563 #if (ACC_HAVE_MM_HUGE_PTR)
5564 #if 1 && (ACC_OS_DOS16 && defined(BLX286))
5565 # define __ACCLIB_HALLOC_USE_DAH 1
5566 #elif 1 && (ACC_OS_DOS16 && defined(DOSX286))
5567 # define __ACCLIB_HALLOC_USE_DAH 1
5568 #elif 1 && (ACC_OS_OS216)
5569 # define __ACCLIB_HALLOC_USE_DAH 1
5570 #elif 1 && (ACC_OS_WIN16)
5571 # define __ACCLIB_HALLOC_USE_GA 1
5572 #elif 1 && (ACC_OS_DOS16) && (ACC_CC_BORLANDC) && defined(__DPMI16__)
5573 # define __ACCLIB_HALLOC_USE_GA 1
5576 #if (__ACCLIB_HALLOC_USE_DAH)
5577 #if 0 && (ACC_OS_OS216)
5580 ACC_EXTERN_C unsigned short __far __pascal DosAllocHuge(unsigned short, unsigned short, unsigned short __far *, unsigned short, unsigned short);
5581 ACC_EXTERN_C unsigned short __far __pascal DosFreeSeg(unsigned short);
5584 #if (__ACCLIB_HALLOC_USE_GA)
5587 #include <windows.h>
5589 ACC_EXTERN_C const void __near* __far __pascal GlobalAlloc(unsigned, unsigned long);
5590 ACC_EXTERN_C const void __near* __far __pascal GlobalFree(const void __near*);
5591 ACC_EXTERN_C unsigned long __far __pascal GlobalHandle(unsigned);
5592 ACC_EXTERN_C void __far* __far __pascal GlobalLock(const void __near*);
5593 ACC_EXTERN_C int __far __pascal GlobalUnlock(const void __near*);
5596 ACCLIB_PUBLIC(acc_hvoid_p, acc_halloc) (acc_hsize_t size)
5601 #if 0 && defined(__palmos__)
5602 p = MemPtrNew(size);
5603 #elif !(ACC_HAVE_MM_HUGE_PTR)
5604 if (size < (size_t) -1)
5605 p = malloc((size_t) size);
5607 if ((long)size <= 0)
5610 #if (__ACCLIB_HALLOC_USE_DAH)
5611 unsigned short sel = 0;
5612 if (DosAllocHuge((unsigned short)(size >> 16), (unsigned short)size, &sel, 0, 0) == 0)
5613 p = (acc_hvoid_p) ACC_PTR_MK_FP(sel, 0);
5614 #elif (__ACCLIB_HALLOC_USE_GA)
5615 const void __near* h = GlobalAlloc(2, size);
5618 if (p && ACC_PTR_FP_OFF(p) != 0) {
5625 #elif (ACC_CC_MSC && (_MSC_VER >= 700))
5626 p = _halloc(size, 1);
5627 #elif (ACC_CC_MSC || ACC_CC_WATCOMC)
5628 p = halloc(size, 1);
5629 #elif (ACC_CC_DMC || ACC_CC_SYMANTECC || ACC_CC_ZORTECHC)
5630 p = farmalloc(size);
5631 #elif (ACC_CC_BORLANDC || ACC_CC_TURBOC)
5632 p = farmalloc(size);
5633 #elif (ACC_CC_AZTECC)
5636 if (size < (size_t) -1)
5637 p = malloc((size_t) size);
5643 ACCLIB_PUBLIC(void, acc_hfree) (acc_hvoid_p p)
5647 #if 0 && defined(__palmos__)
5649 #elif !(ACC_HAVE_MM_HUGE_PTR)
5652 #if (__ACCLIB_HALLOC_USE_DAH)
5653 if (ACC_PTR_FP_OFF(p) == 0)
5654 DosFreeSeg((unsigned short) ACC_PTR_FP_SEG(p));
5655 #elif (__ACCLIB_HALLOC_USE_GA)
5656 if (ACC_PTR_FP_OFF(p) == 0) {
5657 const void __near* h = (const void __near*) (unsigned) GlobalHandle(ACC_PTR_FP_SEG(p));
5663 #elif (ACC_CC_MSC && (_MSC_VER >= 700))
5665 #elif (ACC_CC_MSC || ACC_CC_WATCOMC)
5667 #elif (ACC_CC_DMC || ACC_CC_SYMANTECC || ACC_CC_ZORTECHC)
5668 farfree((void __far*) p);
5669 #elif (ACC_CC_BORLANDC || ACC_CC_TURBOC)
5670 farfree((void __far*) p);
5671 #elif (ACC_CC_AZTECC)
5679 #if defined(ACC_WANT_ACCLIB_HFREAD)
5680 # undef ACC_WANT_ACCLIB_HFREAD
5681 #define __ACCLIB_HFREAD_CH_INCLUDED 1
5682 #if !defined(ACCLIB_PUBLIC)
5683 # define ACCLIB_PUBLIC(r,f) r __ACCLIB_FUNCNAME(f)
5685 ACCLIB_PUBLIC(acc_hsize_t, acc_hfread) (void* vfp, acc_hvoid_p buf, acc_hsize_t size)
5687 FILE* fp = (FILE *) vfp;
5688 #if (ACC_HAVE_MM_HUGE_PTR)
5689 #if (ACC_MM_TINY || ACC_MM_SMALL || ACC_MM_MEDIUM)
5690 #define __ACCLIB_REQUIRE_HMEMCPY_CH 1
5691 unsigned char tmp[512];
5695 size_t n = size - l > sizeof(tmp) ? sizeof(tmp) : (size_t) (size - l);
5696 n = fread(tmp, 1, n, fp);
5699 __ACCLIB_FUNCNAME(acc_hmemcpy)((acc_hbyte_p)buf + l, tmp, (acc_hsize_t)n);
5703 #elif (ACC_MM_COMPACT || ACC_MM_LARGE || ACC_MM_HUGE)
5704 acc_hbyte_p b = (acc_hbyte_p) buf;
5709 n = ACC_PTR_FP_OFF(b); n = (n <= 1) ? 0x8000u : (0u - n);
5710 if ((acc_hsize_t) n > size - l)
5711 n = (size_t) (size - l);
5712 n = fread((void __far*)b, 1, n, fp);
5719 # error "unknown memory model"
5722 return fread(buf, 1, size, fp);
5725 ACCLIB_PUBLIC(acc_hsize_t, acc_hfwrite) (void* vfp, const acc_hvoid_p buf, acc_hsize_t size)
5727 FILE* fp = (FILE *) vfp;
5728 #if (ACC_HAVE_MM_HUGE_PTR)
5729 #if (ACC_MM_TINY || ACC_MM_SMALL || ACC_MM_MEDIUM)
5730 #define __ACCLIB_REQUIRE_HMEMCPY_CH 1
5731 unsigned char tmp[512];
5735 size_t n = size - l > sizeof(tmp) ? sizeof(tmp) : (size_t) (size - l);
5736 __ACCLIB_FUNCNAME(acc_hmemcpy)(tmp, (const acc_hbyte_p)buf + l, (acc_hsize_t)n);
5737 n = fwrite(tmp, 1, n, fp);
5743 #elif (ACC_MM_COMPACT || ACC_MM_LARGE || ACC_MM_HUGE)
5744 const acc_hbyte_p b = (const acc_hbyte_p) buf;
5749 n = ACC_PTR_FP_OFF(b); n = (n <= 1) ? 0x8000u : (0u - n);
5750 if ((acc_hsize_t) n > size - l)
5751 n = (size_t) (size - l);
5752 n = fwrite((void __far*)b, 1, n, fp);
5759 # error "unknown memory model"
5762 return fwrite(buf, 1, size, fp);
5766 #if defined(ACC_WANT_ACCLIB_HSREAD)
5767 # undef ACC_WANT_ACCLIB_HSREAD
5768 #define __ACCLIB_HSREAD_CH_INCLUDED 1
5769 #if !defined(ACCLIB_PUBLIC)
5770 # define ACCLIB_PUBLIC(r,f) r __ACCLIB_FUNCNAME(f)
5772 ACCLIB_PUBLIC(long, acc_safe_hread) (int fd, acc_hvoid_p buf, long size)
5774 acc_hbyte_p b = (acc_hbyte_p) buf;
5777 saved_errno = errno;
5781 #if (ACC_HAVE_MM_HUGE_PTR)
5782 # define __ACCLIB_REQUIRE_HREAD_CH 1
5783 errno = 0; n = acc_hread(fd, b, n);
5784 #elif (ACC_OS_DOS32) && defined(__DJGPP__)
5785 errno = 0; n = _read(fd, b, n);
5787 errno = 0; n = read(fd, b, n);
5793 if (errno == (EAGAIN)) continue;
5796 if (errno == (EINTR)) continue;
5798 if (errno == 0) errno = 1;
5803 errno = saved_errno;
5806 ACCLIB_PUBLIC(long, acc_safe_hwrite) (int fd, const acc_hvoid_p buf, long size)
5808 const acc_hbyte_p b = (const acc_hbyte_p) buf;
5811 saved_errno = errno;
5815 #if (ACC_HAVE_MM_HUGE_PTR)
5816 # define __ACCLIB_REQUIRE_HREAD_CH 1
5817 errno = 0; n = acc_hwrite(fd, b, n);
5818 #elif (ACC_OS_DOS32) && defined(__DJGPP__)
5819 errno = 0; n = _write(fd, b, n);
5821 errno = 0; n = write(fd, b, n);
5827 if (errno == (EAGAIN)) continue;
5830 if (errno == (EINTR)) continue;
5832 if (errno == 0) errno = 1;
5837 errno = saved_errno;
5841 #if defined(ACC_WANT_ACCLIB_PCLOCK)
5842 # undef ACC_WANT_ACCLIB_PCLOCK
5843 #define __ACCLIB_PCLOCK_CH_INCLUDED 1
5844 #if !defined(ACCLIB_PUBLIC)
5845 # define ACCLIB_PUBLIC(r,f) r __ACCLIB_FUNCNAME(f)
5847 #if 0 && (ACC_OS_POSIX_LINUX && ACC_ARCH_AMD64 && ACC_ASM_SYNTAX_GNUC)
5848 #ifndef acc_pclock_syscall_clock_gettime
5849 #define acc_pclock_syscall_clock_gettime acc_pclock_syscall_clock_gettime
5851 static __acc_noinline long acc_pclock_syscall_clock_gettime(long clockid, struct timespec *ts)
5854 __asm__ __volatile__("syscall\n" : "=a" (r) : "0" (228), "D" (clockid), "S" (ts) : __ACC_ASM_CLOBBER);
5858 #if 0 && (ACC_OS_POSIX_LINUX && ACC_ARCH_I386 && ACC_ASM_SYNTAX_GNUC)
5859 #ifndef acc_pclock_syscall_clock_gettime
5860 #define acc_pclock_syscall_clock_gettime acc_pclock_syscall_clock_gettime
5862 static __acc_noinline long acc_pclock_syscall_clock_gettime(long clockid, struct timespec *ts)
5865 __asm__ __volatile__("int $0x80\n" : "=a" (r) : "0" (265), "b" (clockid), "c" (ts) : __ACC_ASM_CLOBBER);
5869 #if 0 && defined(acc_pclock_syscall_clock_gettime)
5870 #ifndef acc_pclock_read_clock_gettime_r_syscall
5871 #define acc_pclock_read_clock_gettime_r_syscall acc_pclock_read_clock_gettime_r_syscall
5873 static int acc_pclock_read_clock_gettime_r_syscall(acc_pclock_handle_p h, acc_pclock_p c)
5876 if (acc_pclock_syscall_clock_gettime(0, &ts) != 0)
5878 c->tv_sec = ts.tv_sec;
5879 c->tv_nsec = ts.tv_nsec;
5880 ACC_UNUSED(h); return 0;
5883 #if (HAVE_GETTIMEOFDAY)
5884 #ifndef acc_pclock_read_gettimeofday
5885 #define acc_pclock_read_gettimeofday acc_pclock_read_gettimeofday
5887 static int acc_pclock_read_gettimeofday(acc_pclock_handle_p h, acc_pclock_p c)
5890 if (gettimeofday(&tv, 0) != 0)
5892 #if defined(acc_int64l_t)
5893 c->tv_sec = tv.tv_sec;
5896 c->tv_sec_low = tv.tv_sec;
5898 c->tv_nsec = (acc_uint32l_t) (tv.tv_usec * 1000u);
5899 ACC_UNUSED(h); return 0;
5902 #if defined(CLOCKS_PER_SEC)
5903 #ifndef acc_pclock_read_clock
5904 #define acc_pclock_read_clock acc_pclock_read_clock
5906 static int acc_pclock_read_clock(acc_pclock_handle_p h, acc_pclock_p c)
5910 #if defined(acc_int64l_t)
5911 acc_uint64l_t nsecs;
5913 secs = (double)ticks / (CLOCKS_PER_SEC);
5914 nsecs = (acc_uint64l_t) (secs * 1000000000.0);
5915 c->tv_sec = (acc_int64l_t) (nsecs / 1000000000ul);
5916 c->tv_nsec = (acc_uint32l_t) (nsecs % 1000000000ul);
5919 secs = (double)ticks / (CLOCKS_PER_SEC);
5921 c->tv_sec_low = (acc_uint32l_t) (secs + 0.5);
5924 ACC_UNUSED(h); return 0;
5927 #if 1 && defined(acc_pclock_syscall_clock_gettime)
5928 #ifndef acc_pclock_read_clock_gettime_m_syscall
5929 #define acc_pclock_read_clock_gettime_m_syscall acc_pclock_read_clock_gettime_m_syscall
5931 static int acc_pclock_read_clock_gettime_m_syscall(acc_pclock_handle_p h, acc_pclock_p c)
5934 if (acc_pclock_syscall_clock_gettime(1, &ts) != 0)
5936 c->tv_sec = ts.tv_sec;
5937 c->tv_nsec = ts.tv_nsec;
5938 ACC_UNUSED(h); return 0;
5941 #if (ACC_OS_DOS32 && ACC_CC_GNUC) && defined(__DJGPP__) && defined(UCLOCKS_PER_SEC)
5942 #ifndef acc_pclock_read_uclock
5943 #define acc_pclock_read_uclock acc_pclock_read_uclock
5945 static int acc_pclock_read_uclock(acc_pclock_handle_p h, acc_pclock_p c)
5947 acc_uint64l_t ticks;
5949 acc_uint64l_t nsecs;
5951 secs = (double)ticks / (UCLOCKS_PER_SEC);
5952 nsecs = (acc_uint64l_t) (secs * 1000000000.0);
5953 c->tv_sec = nsecs / 1000000000ul;
5954 c->tv_nsec = (acc_uint32l_t) (nsecs % 1000000000ul);
5955 ACC_UNUSED(h); return 0;
5958 #if 0 && (HAVE_CLOCK_GETTIME) && defined(CLOCK_PROCESS_CPUTIME_ID) && defined(acc_int64l_t)
5959 #ifndef acc_pclock_read_clock_gettime_p_libc
5960 #define acc_pclock_read_clock_gettime_p_libc acc_pclock_read_clock_gettime_p_libc
5962 static int acc_pclock_read_clock_gettime_p_libc(acc_pclock_handle_p h, acc_pclock_p c)
5965 if (clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &ts) != 0)
5967 c->tv_sec = ts.tv_sec;
5968 c->tv_nsec = ts.tv_nsec;
5969 ACC_UNUSED(h); return 0;
5972 #if 1 && defined(acc_pclock_syscall_clock_gettime)
5973 #ifndef acc_pclock_read_clock_gettime_p_syscall
5974 #define acc_pclock_read_clock_gettime_p_syscall acc_pclock_read_clock_gettime_p_syscall
5976 static int acc_pclock_read_clock_gettime_p_syscall(acc_pclock_handle_p h, acc_pclock_p c)
5979 if (acc_pclock_syscall_clock_gettime(2, &ts) != 0)
5981 c->tv_sec = ts.tv_sec;
5982 c->tv_nsec = ts.tv_nsec;
5983 ACC_UNUSED(h); return 0;
5986 #if (ACC_OS_CYGWIN || ACC_OS_WIN32 || ACC_OS_WIN64) && (ACC_HAVE_WINDOWS_H) && defined(acc_int64l_t)
5987 #ifndef acc_pclock_read_getprocesstimes
5988 #define acc_pclock_read_getprocesstimes acc_pclock_read_getprocesstimes
5990 static int acc_pclock_read_getprocesstimes(acc_pclock_handle_p h, acc_pclock_p c)
5992 FILETIME ct, et, kt, ut;
5993 acc_uint64l_t ticks;
5994 if (GetProcessTimes(GetCurrentProcess(), &ct, &et, &kt, &ut) == 0)
5996 ticks = ((acc_uint64l_t)ut.dwHighDateTime << 32) | ut.dwLowDateTime;
5997 if __acc_unlikely(h->ticks_base == 0)
5998 h->ticks_base = ticks;
6000 ticks -= h->ticks_base;
6001 c->tv_sec = (acc_int64l_t) (ticks / 10000000ul);
6002 c->tv_nsec = (acc_uint32l_t)(ticks % 10000000ul) * 100u;
6003 ACC_UNUSED(h); return 0;
6006 #if (HAVE_GETRUSAGE) && defined(RUSAGE_SELF)
6007 #ifndef acc_pclock_read_getrusage
6008 #define acc_pclock_read_getrusage acc_pclock_read_getrusage
6010 static int acc_pclock_read_getrusage(acc_pclock_handle_p h, acc_pclock_p c)
6013 if (getrusage(RUSAGE_SELF, &ru) != 0)
6015 #if defined(acc_int64l_t)
6016 c->tv_sec = ru.ru_utime.tv_sec;
6019 c->tv_sec_low = ru.ru_utime.tv_sec;
6021 c->tv_nsec = (acc_uint32l_t) (ru.ru_utime.tv_usec * 1000u);
6022 ACC_UNUSED(h); return 0;
6025 #if (__ACCLIB_PCLOCK_USE_PERFCTR)
6026 #ifndef acc_pclock_read_perfctr
6027 #define acc_pclock_read_perfctr acc_pclock_read_perfctr
6029 static int acc_pclock_read_perfctr(acc_pclock_handle_p h, acc_pclock_p c)
6031 acc_perfctr_clock_t pcc;
6033 acc_uint64l_t nsecs;
6034 __ACCLIB_FUNCNAME(acc_perfctr_read)(&h->pch, &pcc);
6035 if __acc_unlikely(h->ticks_base == 0)
6036 h->ticks_base = pcc.tsc;
6038 pcc.tsc -= h->ticks_base;
6039 secs = pcc.tsc * h->pch.tsc_to_seconds;
6040 nsecs = (acc_uint64l_t) (secs * 1000000000.0);
6041 c->tv_sec = nsecs / 1000000000ul;
6042 c->tv_nsec = (acc_uint32l_t) (nsecs % 1000000000ul);
6043 ACC_UNUSED(h); return 0;
6046 #if 0 && (HAVE_CLOCK_GETTIME) && defined(CLOCK_THREAD_CPUTIME_ID) && defined(acc_int64l_t)
6047 #ifndef acc_pclock_read_clock_gettime_t_libc
6048 #define acc_pclock_read_clock_gettime_t_libc acc_pclock_read_clock_gettime_t_libc
6050 static int acc_pclock_read_clock_gettime_t_libc(acc_pclock_handle_p h, acc_pclock_p c)
6053 if (clock_gettime(CLOCK_THREAD_CPUTIME_ID, &ts) != 0)
6055 c->tv_sec = ts.tv_sec;
6056 c->tv_nsec = ts.tv_nsec;
6057 ACC_UNUSED(h); return 0;
6060 #if 1 && defined(acc_pclock_syscall_clock_gettime)
6061 #ifndef acc_pclock_read_clock_gettime_t_syscall
6062 #define acc_pclock_read_clock_gettime_t_syscall acc_pclock_read_clock_gettime_t_syscall
6064 static int acc_pclock_read_clock_gettime_t_syscall(acc_pclock_handle_p h, acc_pclock_p c)
6067 if (acc_pclock_syscall_clock_gettime(3, &ts) != 0)
6069 c->tv_sec = ts.tv_sec;
6070 c->tv_nsec = ts.tv_nsec;
6071 ACC_UNUSED(h); return 0;
6074 #if (ACC_OS_CYGWIN || ACC_OS_WIN32 || ACC_OS_WIN64) && (ACC_HAVE_WINDOWS_H) && defined(acc_int64l_t)
6075 #ifndef acc_pclock_read_getthreadtimes
6076 #define acc_pclock_read_getthreadtimes acc_pclock_read_getthreadtimes
6078 static int acc_pclock_read_getthreadtimes(acc_pclock_handle_p h, acc_pclock_p c)
6080 FILETIME ct, et, kt, ut;
6081 acc_uint64l_t ticks;
6082 if (GetThreadTimes(GetCurrentThread(), &ct, &et, &kt, &ut) == 0)
6084 ticks = ((acc_uint64l_t)ut.dwHighDateTime << 32) | ut.dwLowDateTime;
6085 if __acc_unlikely(h->ticks_base == 0)
6086 h->ticks_base = ticks;
6088 ticks -= h->ticks_base;
6089 c->tv_sec = (acc_int64l_t) (ticks / 10000000ul);
6090 c->tv_nsec = (acc_uint32l_t)(ticks % 10000000ul) * 100;
6091 ACC_UNUSED(h); return 0;
6094 ACCLIB_PUBLIC(int, acc_pclock_open) (acc_pclock_handle_p h, int mode)
6098 h->h = (acclib_handle_t) 0;
6103 #if defined(acc_int64l_t)
6108 case ACC_PCLOCK_REALTIME:
6109 # if defined(acc_pclock_read_clock_gettime_r_syscall)
6110 if (acc_pclock_read_clock_gettime_r_syscall(h, &c) == 0) {
6111 h->gettime = acc_pclock_read_clock_gettime_r_syscall;
6112 h->name = "CLOCK_REALTIME/syscall";
6116 # if defined(acc_pclock_read_gettimeofday)
6117 if (acc_pclock_read_gettimeofday(h, &c) == 0) {
6118 h->gettime = acc_pclock_read_gettimeofday;
6119 h->name = "gettimeofday";
6124 case ACC_PCLOCK_MONOTONIC:
6125 # if defined(acc_pclock_read_clock_gettime_m_syscall)
6126 if (acc_pclock_read_clock_gettime_m_syscall(h, &c) == 0) {
6127 h->gettime = acc_pclock_read_clock_gettime_m_syscall;
6128 h->name = "CLOCK_MONOTONIC/syscall";
6132 # if defined(acc_pclock_read_uclock)
6133 if (acc_pclock_read_uclock(h, &c) == 0) {
6134 h->gettime = acc_pclock_read_uclock;
6139 # if defined(acc_pclock_read_clock)
6140 if (acc_pclock_read_clock(h, &c) == 0) {
6141 h->gettime = acc_pclock_read_clock;
6147 case ACC_PCLOCK_PROCESS_CPUTIME_ID:
6148 # if defined(acc_pclock_read_perfctr)
6149 if (__ACCLIB_FUNCNAME(acc_perfctr_open)(&h->pch) == 0) {
6150 h->gettime = acc_pclock_read_perfctr;
6151 h->name = "perfctr";
6155 # if defined(acc_pclock_read_getprocesstimes)
6156 if (acc_pclock_read_getprocesstimes(h, &c) == 0) {
6157 h->gettime = acc_pclock_read_getprocesstimes;
6158 h->name = "GetProcessTimes";
6162 # if defined(acc_pclock_read_clock_gettime_p_syscall)
6163 if (acc_pclock_read_clock_gettime_p_syscall(h, &c) == 0) {
6164 h->gettime = acc_pclock_read_clock_gettime_p_syscall;
6165 h->name = "CLOCK_PROCESS_CPUTIME_ID/syscall";
6169 # if defined(acc_pclock_read_clock_gettime_p_libc)
6170 if (acc_pclock_read_clock_gettime_p_libc(h, &c) == 0) {
6171 h->gettime = acc_pclock_read_clock_gettime_p_libc;
6172 h->name = "CLOCK_PROCESS_CPUTIME_ID/libc";
6176 # if defined(acc_pclock_read_getrusage)
6177 if (acc_pclock_read_getrusage(h, &c) == 0) {
6178 h->gettime = acc_pclock_read_getrusage;
6179 h->name = "getrusage";
6184 case ACC_PCLOCK_THREAD_CPUTIME_ID:
6185 # if defined(acc_pclock_read_getthreadtimes)
6186 if (acc_pclock_read_getthreadtimes(h, &c) == 0) {
6187 h->gettime = acc_pclock_read_getthreadtimes;
6188 h->name = "GetThreadTimes";
6191 # if defined(acc_pclock_read_clock_gettime_t_syscall)
6192 if (acc_pclock_read_clock_gettime_t_syscall(h, &c) == 0) {
6193 h->gettime = acc_pclock_read_clock_gettime_t_syscall;
6194 h->name = "CLOCK_THREAD_CPUTIME_ID/syscall";
6198 # if defined(acc_pclock_read_clock_gettime_t_libc)
6199 if (acc_pclock_read_clock_gettime_t_libc(h, &c) == 0) {
6200 h->gettime = acc_pclock_read_clock_gettime_t_libc;
6201 h->name = "CLOCK_THREAD_CPUTIME_ID/libc";
6210 h->h = (acclib_handle_t) 1;
6214 h->name = "unknown";
6215 for (i = 0; i < 10; i++) {
6216 __ACCLIB_FUNCNAME(acc_pclock_read)(h, &c);
6220 ACCLIB_PUBLIC(int, acc_pclock_open_default) (acc_pclock_handle_p h)
6222 if (__ACCLIB_FUNCNAME(acc_pclock_open)(h, ACC_PCLOCK_PROCESS_CPUTIME_ID) == 0)
6224 if (__ACCLIB_FUNCNAME(acc_pclock_open)(h, ACC_PCLOCK_MONOTONIC) == 0)
6226 if (__ACCLIB_FUNCNAME(acc_pclock_open)(h, ACC_PCLOCK_REALTIME) == 0)
6228 if (__ACCLIB_FUNCNAME(acc_pclock_open)(h, ACC_PCLOCK_THREAD_CPUTIME_ID) == 0)
6232 ACCLIB_PUBLIC(int, acc_pclock_close) (acc_pclock_handle_p h)
6234 h->h = (acclib_handle_t) 0;
6238 #if (__ACCLIB_PCLOCK_USE_PERFCTR)
6239 __ACCLIB_FUNCNAME(acc_perfctr_close)(&h->pch);
6243 ACCLIB_PUBLIC(void, acc_pclock_read) (acc_pclock_handle_p h, acc_pclock_p c)
6246 if (h->gettime(h, c) == 0)
6250 #if defined(acc_int64l_t)
6258 #if !(ACC_CFG_NO_DOUBLE)
6259 ACCLIB_PUBLIC(double, acc_pclock_get_elapsed) (acc_pclock_handle_p h, const acc_pclock_p start, const acc_pclock_p stop)
6261 double tstop, tstart;
6266 #if defined(acc_int64l_t)
6267 tstop = stop->tv_sec + stop->tv_nsec / 1000000000.0;
6268 tstart = start->tv_sec + start->tv_nsec / 1000000000.0;
6270 tstop = stop->tv_sec_low + stop->tv_nsec / 1000000000.0;
6271 tstart = start->tv_sec_low + start->tv_nsec / 1000000000.0;
6273 return tstop - tstart;
6276 ACCLIB_PUBLIC(int, acc_pclock_flush_cpu_cache) (acc_pclock_handle_p h, unsigned flags)
6279 #if (__ACCLIB_PCLOCK_USE_PERFCTR)
6280 return __ACCLIB_FUNCNAME(acc_perfctr_flush_cpu_cache)(&h->pch, flags);
6283 ACC_UNUSED(h); ACC_UNUSED(flags);
6286 #if defined(__ACCLIB_PCLOCK_NEED_WARN_POP)
6287 # if (ACC_CC_MSC && (_MSC_VER >= 1200))
6288 # pragma warning(pop)
6290 # error "__ACCLIB_PCLOCK_NEED_WARN_POP"
6292 # undef __ACCLIB_PCLOCK_NEED_WARN_POP
6295 #if defined(ACC_WANT_ACCLIB_UCLOCK)
6296 # undef ACC_WANT_ACCLIB_UCLOCK
6297 #define __ACCLIB_UCLOCK_CH_INCLUDED 1
6298 #if !defined(ACCLIB_PUBLIC)
6299 # define ACCLIB_PUBLIC(r,f) r __ACCLIB_FUNCNAME(f)
6301 #if (ACC_OS_DOS16 || ACC_OS_WIN16)
6302 #elif (ACC_OS_DOS32 && ACC_CC_GNUC) && defined(__DJGPP__)
6303 #elif (ACC_OS_CYGWIN || ACC_OS_WIN32 || ACC_OS_WIN64) && (ACC_HAVE_WINDOWS_H)
6304 # if ((ACC_CC_DMC && (__DMC__ < 0x838)) || ACC_CC_LCCWIN32)
6305 # define __ACCLIB_UCLOCK_USE_CLOCK 1
6307 # define __ACCLIB_UCLOCK_USE_WINMM 1
6308 # if (ACC_CC_MSC && (_MSC_VER >= 1200))
6309 # pragma warning(push)
6310 # define __ACCLIB_UCLOCK_NEED_WARN_POP 1
6312 # if (ACC_CC_MSC && (_MSC_VER >= 900))
6313 # pragma warning(disable: 4201)
6314 # elif (ACC_CC_MWERKS)
6315 # define LPUINT __ACC_MMSYSTEM_H_LPUINT
6318 # include <mmsystem.h>
6320 # if (ACC_CC_INTELC || ACC_CC_MSC || ACC_CC_PELLESC)
6321 ACC_EXTERN_C __declspec(dllimport) unsigned long __stdcall timeGetTime(void);
6323 ACC_EXTERN_C unsigned long __stdcall timeGetTime(void);
6327 # pragma DMC includelib "winmm.lib"
6328 # elif (ACC_CC_INTELC || ACC_CC_MSC || ACC_CC_PELLESC)
6329 # pragma comment(lib, "winmm.lib")
6330 # elif (ACC_CC_MWERKS && (__MWERKS__ >= 0x3000))
6331 # pragma comment(lib, "winmm.lib")
6332 # elif (ACC_CC_SYMANTECC)
6333 # pragma SC includelib "winmm.lib"
6334 # elif (ACC_CC_WATCOMC && (__WATCOMC__ >= 1050))
6335 # pragma library("winmm.lib")
6338 #elif (ACC_OS_CYGWIN || ACC_OS_DOS32 || ACC_OS_EMX || ACC_OS_OS2 || ACC_OS_OS216 || ACC_OS_TOS || ACC_OS_WIN32 || ACC_OS_WIN64)
6339 # define __ACCLIB_UCLOCK_USE_CLOCK 1
6340 #elif (ACC_OS_CONSOLE) && defined(CLOCKS_PER_SEC)
6341 # define __ACCLIB_UCLOCK_USE_CLOCK 1
6342 #elif (ACC_LIBC_ISOC90 || ACC_LIBC_ISOC99) && defined(CLOCKS_PER_SEC)
6343 # define __ACCLIB_UCLOCK_USE_CLOCK 1
6345 #if (__ACCLIB_UCLOCK_USE_CLOCK) && !defined(CLOCKS_PER_SEC)
6346 # if defined(CLK_TCK)
6347 # define CLOCKS_PER_SEC CLK_TCK
6349 # undef __ACCLIB_UCLOCK_USE_CLOCK
6352 #if (__ACCLIB_UCLOCK_USE_GETRUSAGE)
6353 # if !defined(RUSAGE_SELF)
6354 # undef __ACCLIB_UCLOCK_USE_GETRUSAGE
6357 ACCLIB_PUBLIC(int, acc_uclock_open) (acc_uclock_handle_p h)
6360 #if (__ACCLIB_UCLOCK_USE_QPC)
6363 h->h = (acclib_handle_t) 1;
6367 #if (__ACCLIB_UCLOCK_USE_PERFCTR)
6369 if (h->mode == 0 && __ACCLIB_FUNCNAME(acc_perfctr_open)(&h->pch) == 0)
6372 #if (__ACCLIB_UCLOCK_USE_QPC)
6374 if (h->mode == 0 && QueryPerformanceFrequency(&li) != 0) {
6375 double d = (double) li.QuadPart;
6376 if (d > 0.0 && QueryPerformanceCounter(&li) != 0) {
6382 for (i = 0; i < 10; i++) {
6384 __ACCLIB_FUNCNAME(acc_uclock_read)(h, &c);
6388 ACCLIB_PUBLIC(int, acc_uclock_close) (acc_uclock_handle_p h)
6390 h->h = (acclib_handle_t) 0;
6393 #if (__ACCLIB_UCLOCK_USE_PERFCTR)
6394 __ACCLIB_FUNCNAME(acc_perfctr_close)(&h->pch);
6398 ACCLIB_PUBLIC(void, acc_uclock_read) (acc_uclock_handle_p h, acc_uclock_p c)
6400 #if (__ACCLIB_UCLOCK_USE_RDTSC)
6401 __ACCLIB_FUNCNAME(acc_tsc_read)((acc_uint32e_t*) (void*) &c->tsc);
6403 #if (__ACCLIB_UCLOCK_USE_PERFCTR)
6405 __ACCLIB_FUNCNAME(acc_perfctr_read)(&h->pch, &c->pcc);
6406 if (h->mode > 0 && h->mode <= 2)
6410 #if (__ACCLIB_UCLOCK_USE_QPC)
6413 if (QueryPerformanceCounter(&li) != 0) {
6414 c->qpc = (acc_int64l_t) li.QuadPart;
6415 if (h->mode > 0 && h->mode <= 3)
6418 h->mode = 0; h->qpf = 0.0; c->qpc = 0;
6424 #if (ACC_OS_DOS16 || ACC_OS_WIN16)
6425 # if (ACC_CC_AZTECC)
6429 ri.x.ax = 0x2c00; int86(0x21, &ri, &ro);
6430 c->ticks.t32 = ro.h.ch*60UL*60UL*100UL + ro.h.cl*60UL*100UL + ro.h.dh*100UL + ro.h.dl;
6432 #elif (ACC_OS_DOS32 && ACC_CC_GNUC) && defined(__DJGPP__)
6433 c->ticks.t64 = uclock();
6434 #elif (__ACCLIB_UCLOCK_USE_CLOCK) && defined(acc_int64l_t)
6435 c->ticks.t64 = clock();
6436 #elif (__ACCLIB_UCLOCK_USE_CLOCK)
6437 c->ticks.t32 = clock();
6438 #elif (__ACCLIB_UCLOCK_USE_WINMM)
6439 c->ticks.t32 = timeGetTime();
6440 #elif (__ACCLIB_UCLOCK_USE_GETRUSAGE)
6442 if (getrusage(RUSAGE_SELF, &ru) != 0) c->ticks.td = 0;
6443 else c->ticks.td = ru.ru_utime.tv_sec + ru.ru_utime.tv_usec / 1000000.0;
6444 #elif (HAVE_GETTIMEOFDAY)
6446 if (gettimeofday(&tv, 0) != 0) c->ticks.td = 0;
6447 else c->ticks.td = tv.tv_sec + tv.tv_usec / 1000000.0;
6454 ACCLIB_PUBLIC(double, acc_uclock_get_elapsed) (acc_uclock_handle_p h, const acc_uclock_p start, const acc_uclock_p stop)
6461 #if (__ACCLIB_UCLOCK_USE_RDTSC)
6463 if (!h->name) h->name = "rdtsc";
6464 d = (double) ((acc_int64l_t)stop->tsc - (acc_int64l_t)start->tsc);
6465 return d / 1000000000.0;
6468 #if (__ACCLIB_UCLOCK_USE_PERFCTR)
6469 if (h->pch.h && h->mode == 2) {
6470 if (!h->name) h->name = "perfctr";
6471 return __ACCLIB_FUNCNAME(acc_perfctr_get_elapsed)(&h->pch, &start->pcc, &stop->pcc);
6474 #if (__ACCLIB_UCLOCK_USE_QPC)
6475 if (h->qpf > 0.0 && h->mode == 3) {
6476 if (!h->name) h->name = "qpc";
6477 if (start->qpc == 0 || stop->qpc == 0) return 0.0;
6478 return (double) (stop->qpc - start->qpc) / h->qpf;
6481 #if (ACC_OS_DOS16 || ACC_OS_WIN16)
6483 if (!h->name) h->name = "uclock";
6484 d = (double) (stop->ticks.t32 - start->ticks.t32) / 100.0;
6485 if (d < 0.0) d += 86400.0;
6486 #elif (ACC_OS_DOS32 && ACC_CC_GNUC) && defined(__DJGPP__)
6488 if (!h->name) h->name = "uclock";
6489 d = (double) (stop->ticks.t64 - start->ticks.t64) / (UCLOCKS_PER_SEC);
6490 #elif (__ACCLIB_UCLOCK_USE_CLOCK) && defined(acc_int64l_t)
6492 if (!h->name) h->name = "clock";
6495 t = stop->ticks.t64 - start->ticks.t64;
6497 t += sizeof(clock_t) == 4 ? ACC_INT64_C(0x100000000) : ACC_INT64_C(0);
6498 d = (double) t / (CLOCKS_PER_SEC);
6500 #elif (__ACCLIB_UCLOCK_USE_CLOCK)
6502 if (!h->name) h->name = "clock";
6503 d = (double) (stop->ticks.t32 - start->ticks.t32) / (CLOCKS_PER_SEC);
6504 #elif (__ACCLIB_UCLOCK_USE_WINMM)
6506 if (!h->name) h->name = "timeGetTime";
6507 d = (double) (stop->ticks.t32 - start->ticks.t32) / 1000.0;
6508 #elif (__ACCLIB_UCLOCK_USE_GETRUSAGE)
6510 if (!h->name) h->name = "getrusage";
6511 d = stop->ticks.td - start->ticks.td;
6512 #elif (HAVE_GETTIMEOFDAY)
6514 if (!h->name) h->name = "gettimeofday";
6515 d = stop->ticks.td - start->ticks.td;
6522 ACCLIB_PUBLIC(int, acc_uclock_flush_cpu_cache) (acc_uclock_handle_p h, unsigned flags)
6525 #if (__ACCLIB_UCLOCK_USE_PERFCTR)
6526 return __ACCLIB_FUNCNAME(acc_perfctr_flush_cpu_cache)(&h->pch, flags);
6529 ACC_UNUSED(h); ACC_UNUSED(flags);
6532 #if defined(__ACCLIB_UCLOCK_NEED_WARN_POP)
6533 # if (ACC_CC_MSC && (_MSC_VER >= 1200))
6534 # pragma warning(pop)
6536 # error "__ACCLIB_UCLOCK_NEED_WARN_POP"
6538 # undef __ACCLIB_UCLOCK_NEED_WARN_POP
6541 #if defined(ACC_WANT_ACCLIB_MISC)
6542 # undef ACC_WANT_ACCLIB_MISC
6543 #define __ACCLIB_MISC_CH_INCLUDED 1
6544 #if !defined(ACCLIB_PUBLIC)
6545 # define ACCLIB_PUBLIC(r,f) r __ACCLIB_FUNCNAME(f)
6547 #if !defined(ACCLIB_PUBLIC_NOINLINE)
6548 # if !defined(__acc_noinline)
6549 # define ACCLIB_PUBLIC_NOINLINE(r,f) r __ACCLIB_FUNCNAME(f)
6550 # elif (ACC_CC_CLANG || (ACC_CC_GNUC >= 0x030400ul) || ACC_CC_LLVM)
6551 # define ACCLIB_PUBLIC_NOINLINE(r,f) __acc_noinline __attribute__((__used__)) r __ACCLIB_FUNCNAME(f)
6553 # define ACCLIB_PUBLIC_NOINLINE(r,f) __acc_noinline r __ACCLIB_FUNCNAME(f)
6556 #if (ACC_OS_WIN32 && ACC_CC_PELLESC && (__POCC__ >= 290))
6558 # pragma warn(disable:2007)
6560 ACCLIB_PUBLIC(const char *, acc_getenv) (const char *s)
6565 ACC_UNUSED(s); return (const char *) 0;
6568 ACCLIB_PUBLIC(acclib_handle_t, acc_get_osfhandle) (int fd)
6573 return get_osfhandle(fd);
6574 #elif (ACC_OS_EMX && defined(__RSXNT__))
6576 #elif (ACC_OS_WIN32 && ACC_CC_GNUC) && defined(__PW32__)
6578 #elif (ACC_OS_WIN32 || ACC_OS_WIN64)
6579 # if (ACC_CC_PELLESC && (__POCC__ < 280))
6581 # elif (ACC_CC_WATCOMC && (__WATCOMC__ < 1000))
6583 # elif (ACC_CC_WATCOMC && (__WATCOMC__ < 1100))
6584 return _os_handle(fd);
6586 return _get_osfhandle(fd);
6592 ACCLIB_PUBLIC(int, acc_set_binmode) (int fd, int binary)
6594 #if (ACC_ARCH_M68K && ACC_OS_TOS && ACC_CC_GNUC) && defined(__MINT__)
6595 FILE* fp; int old_binary;
6596 if (fd == STDIN_FILENO) fp = stdin;
6597 else if (fd == STDOUT_FILENO) fp = stdout;
6598 else if (fd == STDERR_FILENO) fp = stderr;
6600 old_binary = fp->__mode.__binary;
6601 __set_binmode(fp, binary ? 1 : 0);
6602 return old_binary ? 1 : 0;
6603 #elif (ACC_ARCH_M68K && ACC_OS_TOS)
6604 ACC_UNUSED(fd); ACC_UNUSED(binary);
6606 #elif (ACC_OS_DOS16 && (ACC_CC_AZTECC || ACC_CC_PACIFICC))
6607 ACC_UNUSED(fd); ACC_UNUSED(binary);
6609 #elif (ACC_OS_DOS32 && ACC_CC_GNUC) && defined(__DJGPP__)
6610 int r; unsigned old_flags = __djgpp_hwint_flags;
6611 ACC_COMPILE_TIME_ASSERT(O_BINARY > 0)
6612 ACC_COMPILE_TIME_ASSERT(O_TEXT > 0)
6613 if (fd < 0) return -1;
6614 r = setmode(fd, binary ? O_BINARY : O_TEXT);
6615 if ((old_flags & 1u) != (__djgpp_hwint_flags & 1u))
6616 __djgpp_set_ctrl_c(!(old_flags & 1));
6617 if (r == -1) return -1;
6618 return (r & O_TEXT) ? 0 : 1;
6619 #elif (ACC_OS_WIN32 && ACC_CC_GNUC) && defined(__PW32__)
6620 if (fd < 0) return -1;
6623 #elif (ACC_OS_DOS32 && ACC_CC_HIGHC)
6625 if (fd == fileno(stdin)) fp = stdin;
6626 else if (fd == fileno(stdout)) fp = stdout;
6627 else if (fd == fileno(stderr)) fp = stderr;
6629 r = _setmode(fp, binary ? _BINARY : _TEXT);
6630 if (r == -1) return -1;
6631 return (r & _BINARY) ? 1 : 0;
6632 #elif (ACC_OS_WIN32 && ACC_CC_MWERKS) && defined(__MSL__)
6633 ACC_UNUSED(fd); ACC_UNUSED(binary);
6635 #elif (ACC_OS_CYGWIN && (ACC_CC_GNUC < 0x025a00ul))
6636 ACC_UNUSED(fd); ACC_UNUSED(binary);
6638 #elif (ACC_OS_CYGWIN || ACC_OS_DOS16 || ACC_OS_DOS32 || ACC_OS_EMX || ACC_OS_OS2 || ACC_OS_OS216 || ACC_OS_WIN16 || ACC_OS_WIN32 || ACC_OS_WIN64)
6640 #if !(ACC_CC_ZORTECHC)
6641 ACC_COMPILE_TIME_ASSERT(O_BINARY > 0)
6643 ACC_COMPILE_TIME_ASSERT(O_TEXT > 0)
6644 if (fd < 0) return -1;
6645 r = setmode(fd, binary ? O_BINARY : O_TEXT);
6646 if (r == -1) return -1;
6647 return (r & O_TEXT) ? 0 : 1;
6649 if (fd < 0) return -1;
6654 ACCLIB_PUBLIC(int, acc_isatty) (int fd)
6658 #if (ACC_OS_DOS16 && !(ACC_CC_AZTECC))
6661 ri.x.ax = 0x4400; ri.x.bx = fd;
6662 int86(0x21, &ri, &ro);
6663 if ((ro.x.cflag & 1) == 0)
6664 if ((ro.x.ax & 0x83) != 0x83)
6667 #elif (ACC_OS_DOS32 && ACC_CC_WATCOMC)
6670 ri.w.ax = 0x4400; ri.w.bx = (unsigned short) fd;
6671 int386(0x21, &ri, &ro);
6672 if ((ro.w.cflag & 1) == 0)
6673 if ((ro.w.ax & 0x83) != 0x83)
6676 #elif (ACC_HAVE_WINDOWS_H)
6678 acclib_handle_t h = __ACCLIB_FUNCNAME(acc_get_osfhandle)(fd);
6679 if ((HANDLE)h != INVALID_HANDLE_VALUE)
6682 if (GetConsoleMode((HANDLE)h, &d) == 0)
6688 return (isatty(fd)) ? 1 : 0;
6693 ACCLIB_PUBLIC(int, acc_mkdir) (const char* name, unsigned mode)
6696 ACC_UNUSED(name); ACC_UNUSED(mode);
6698 #elif (ACC_ARCH_M68K && ACC_OS_TOS && (ACC_CC_PUREC || ACC_CC_TURBOC))
6700 return Dcreate(name);
6701 #elif (ACC_OS_DOS32 && ACC_CC_GNUC) && defined(__DJGPP__)
6702 return mkdir(name, mode);
6703 #elif (ACC_OS_WIN32 && ACC_CC_GNUC) && defined(__PW32__)
6704 return mkdir(name, mode);
6705 #elif (ACC_OS_DOS16 || ACC_OS_DOS32 || ACC_OS_OS2 || ACC_OS_OS216 || ACC_OS_WIN16 || ACC_OS_WIN32 || ACC_OS_WIN64)
6707 # if (ACC_CC_HIGHC || ACC_CC_PACIFICC)
6708 return mkdir((char*) name);
6712 #elif (ACC_CC_WATCOMC)
6713 return mkdir(name, (mode_t) mode);
6715 return mkdir(name, mode);
6718 ACCLIB_PUBLIC(int, acc_rmdir) (const char* name)
6723 #elif ((ACC_OS_DOS16 || ACC_OS_DOS32) && (ACC_CC_HIGHC || ACC_CC_PACIFICC))
6724 return rmdir((char *) name);
6729 #if defined(acc_int32e_t)
6730 ACCLIB_PUBLIC(acc_int32e_t, acc_muldiv32s) (acc_int32e_t a, acc_int32e_t b, acc_int32e_t x)
6733 if __acc_likely(x != 0)
6735 #if defined(acc_int64l_t)
6736 r = (acc_int32e_t) (((acc_int64l_t) a * b) / x);
6738 ACC_UNUSED(a); ACC_UNUSED(b);
6743 ACCLIB_PUBLIC(acc_uint32e_t, acc_muldiv32u) (acc_uint32e_t a, acc_uint32e_t b, acc_uint32e_t x)
6745 acc_uint32e_t r = 0;
6746 if __acc_likely(x != 0)
6748 #if defined(acc_int64l_t)
6749 r = (acc_uint32e_t) (((acc_uint64l_t) a * b) / x);
6751 ACC_UNUSED(a); ACC_UNUSED(b);
6758 ACCLIB_PUBLIC_NOINLINE(int, acc_syscall_clock_gettime) (int c)
6763 ACC_EXTERN_C void __far __pascal DebugBreak(void);
6765 ACCLIB_PUBLIC_NOINLINE(void, acc_debug_break) (void)
6769 #elif (ACC_ARCH_I086)
6770 #elif (ACC_OS_WIN64) && (ACC_HAVE_WINDOWS_H)
6772 #elif (ACC_CFG_NO_INLINE_ASM) && (ACC_OS_WIN32) && (ACC_HAVE_WINDOWS_H)
6774 #elif (ACC_ARCH_AMD64 || ACC_ARCH_I386) && (ACC_ASM_SYNTAX_GNUC)
6775 __asm__ __volatile__("int $3\n" : : : __ACC_ASM_CLOBBER);
6776 #elif (ACC_ARCH_I386) && (ACC_ASM_SYNTAX_MSC)
6778 #elif (ACC_OS_WIN32) && (ACC_HAVE_WINDOWS_H)
6781 * (volatile int *) 0x1 = -1;
6784 ACCLIB_PUBLIC_NOINLINE(void, acc_debug_nop) (void)
6787 ACCLIB_PUBLIC_NOINLINE(int, acc_debug_align_check_query) (void)
6789 #if (ACC_ARCH_AMD64 || ACC_ARCH_I386) && (ACC_ASM_SYNTAX_GNUC)
6791 __asm__ __volatile__("pushf\n pop %0\n" : "=a" (r) : : __ACC_ASM_CLOBBER);
6792 return (int)(r >> 18) & 1;
6793 #elif (ACC_ARCH_I386) && (ACC_ASM_SYNTAX_MSC)
6800 return (int)(r >> 18) & 1;
6805 ACCLIB_PUBLIC_NOINLINE(int, acc_debug_align_check_enable) (int v)
6808 #if (ACC_ARCH_AMD64) && (ACC_ASM_SYNTAX_GNUC)
6810 __asm__ __volatile__("pushf\n orl $262144,(%%rsp)\n popf\n" : : : __ACC_ASM_CLOBBER);
6812 __asm__ __volatile__("pushf\n andl $-262145,(%%rsp)\n popf\n" : : : __ACC_ASM_CLOBBER);
6815 #elif (ACC_ARCH_I386) && (ACC_ASM_SYNTAX_GNUC)
6817 __asm__ __volatile__("pushf\n orl $262144,(%%esp)\n popf\n" : : : __ACC_ASM_CLOBBER);
6819 __asm__ __volatile__("pushf\n andl $-262145,(%%esp)\n popf\n" : : : __ACC_ASM_CLOBBER);
6822 #elif (ACC_ARCH_I386) && (ACC_ASM_SYNTAX_MSC)
6825 or dword ptr [esp],262144
6829 and dword ptr [esp],-262145
6836 ACC_UNUSED(v); return r;
6838 ACCLIB_PUBLIC_NOINLINE(unsigned, acc_debug_running_on_qemu) (void)
6841 #if (ACC_OS_POSIX_LINUX || ACC_OS_WIN32 || ACC_OS_WIN64)
6843 p = __ACCLIB_FUNCNAME(acc_getenv)("ACC_ENV_RUNNING_ON_QEMU");
6845 if (p[0] == 0) r = 0;
6846 else if ((p[0] >= '0' && p[0] <= '9') && p[1] == 0) r = p[0] - '0';
6852 ACCLIB_PUBLIC_NOINLINE(unsigned, acc_debug_running_on_valgrind) (void)
6854 #if (ACC_ARCH_AMD64 || ACC_ARCH_I386) && (ACC_ASM_SYNTAX_GNUC)
6855 volatile unsigned long args[5] = { 0x1001, 0, 0, 0, 0 };
6856 unsigned long r = 0;
6857 __asm__ __volatile__(".byte 0xc1,0xc0,0x1d,0xc1,0xc0,0x03,0xc1,0xc8,0x1b,0xc1,0xc8,0x05,0xc1,0xc0,0x0d,0xc1,0xc0,0x13\n" : "=d" (r) : "a" (&args[0]), "d" (r) : __ACC_ASM_CLOBBER);
6858 return (unsigned) r;
6863 #if (ACC_OS_WIN32 && ACC_CC_PELLESC && (__POCC__ >= 290))
6867 #if defined(ACC_WANT_ACCLIB_WILDARGV)
6868 # undef ACC_WANT_ACCLIB_WILDARGV
6869 #define __ACCLIB_WILDARGV_CH_INCLUDED 1
6870 #if !defined(ACCLIB_PUBLIC)
6871 # define ACCLIB_PUBLIC(r,f) r __ACCLIB_FUNCNAME(f)
6873 #if (ACC_OS_DOS16 || ACC_OS216 || ACC_OS_WIN16)
6874 #if 0 && (ACC_CC_MSC)
6875 ACC_EXTERN_C int __acc_cdecl __setargv(void);
6876 ACC_EXTERN_C int __acc_cdecl _setargv(void);
6877 ACC_EXTERN_C int __acc_cdecl _setargv(void) { return __setargv(); }
6880 #if (ACC_OS_WIN32 || ACC_OS_WIN64)
6881 #if (ACC_CC_INTELC || ACC_CC_MSC)
6882 ACC_EXTERN_C int __acc_cdecl __setargv(void);
6883 ACC_EXTERN_C int __acc_cdecl _setargv(void);
6884 ACC_EXTERN_C int __acc_cdecl _setargv(void) { return __setargv(); }
6888 #define __ACCLIB_HAVE_ACC_WILDARGV 1
6889 ACCLIB_PUBLIC(void, acc_wildargv) (int* argc, char*** argv)
6892 _response(argc, argv);
6893 _wildcard(argc, argv);
6897 #if (ACC_OS_CONSOLE_PSP) && defined(__PSPSDK_DEBUG__)
6898 #define __ACCLIB_HAVE_ACC_WILDARGV 1
6899 ACC_EXTERN_C int acc_psp_init_module(int*, char***, int);
6900 ACCLIB_PUBLIC(void, acc_wildargv) (int* argc, char*** argv)
6902 acc_psp_init_module(argc, argv, -1);
6905 #if !(__ACCLIB_HAVE_ACC_WILDARGV)
6906 #define __ACCLIB_HAVE_ACC_WILDARGV 1
6907 ACCLIB_PUBLIC(void, acc_wildargv) (int* argc, char*** argv)
6909 #if 1 && (ACC_ARCH_I086PM)
6910 if (ACC_MM_AHSHIFT != 3) { exit(1); }
6911 #elif 1 && (ACC_ARCH_M68K && ACC_OS_TOS && ACC_CC_GNUC) && defined(__MINT__)
6913 if (isatty(1)) __set_binmode(stdout, 0);
6914 if (isatty(2)) __set_binmode(stderr, 0);
6916 ACC_UNUSED(argc); ACC_UNUSED(argv);
6921 /* vim:set ts=4 et: */