Subversion Repositories pentevo

Rev

Blame | Last modification | View Log | Download | RSS feed

  1. #ifndef _SYSDEFS_H
  2. #define _SYSDEFS_H
  3. /* sysdefs.h */
  4. /*****************************************************************************/
  5. /* SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only                     */
  6. /*                                                                           */
  7. /* AS Port                                                                   */
  8. /*                                                                           */
  9. /* system-specific definitions                                               */
  10. /*                                                                           */
  11. /* History:  2001-04-13 activated DRSEP for Win32 platform                   */
  12. /*           2001-09-11 added MacOSX                                         */
  13. /*           2001-10-13 added ARM/Linux                                      */
  14. /*                                                                           */
  15. /*****************************************************************************/
  16.  
  17. /* Default Assumptions:
  18.    - No long long data type if C89/C++98 is used.
  19.    - long double would be available, but not the ..l() functions
  20.      we need along with it: */
  21.  
  22. #if (defined __cplusplus) && (__cplusplus>=201103L)
  23. # define AS_HAS_LONGLONG 1
  24. # define AS_HAS_LONGDOUBLE 1
  25. #elif (defined __STDC__) && (defined __STDC_VERSION__)
  26. # define AS_HAS_LONGLONG 1
  27. # define AS_HAS_LONGDOUBLE 1
  28. #else
  29. # define AS_HAS_LONGLONG 0
  30. # define AS_HAS_LONGDOUBLE 0
  31. #endif
  32.  
  33. /* NOTE:
  34.  *
  35.  * when adding new platforms, " gcc -dM -E - <<<'' " might be helpful to
  36.  * find out about predefined symbols
  37.  *
  38.  */
  39.  
  40. #ifdef _MSC_VER
  41. # define __PROTOS__
  42. # define UNUSED(x) (void)x
  43.  
  44. /*
  45.  * Windows systems using Microsoft Visual Studio.
  46.  */
  47. # ifdef _M_ARM
  48. #  define ARCHPRNAME "arm"
  49. # endif
  50. # ifdef _M_ARM64
  51. #  define ARCHPRNAME "arm64"
  52. # endif
  53. # ifdef _M_IX86
  54. #  define ARCHPRNAME "x86"
  55. # endif
  56. # ifdef _M_X64
  57. #  define ARCHPRNAME "x64"
  58. # endif
  59.  
  60. # define ARCHSYSNAME "windows-msvc"
  61.  
  62. # define DEFSMADE
  63. # define OPENRDMODE "rb"
  64. # define OPENWRMODE "wb"
  65. # define OPENUPMODE "rb+"
  66. # define IEEEFLOAT_8_DOUBLE
  67. # define SLASHARGS
  68. # define PATHSEP '\\'
  69. # define SPATHSEP "\\"
  70. # define DIRSEP ';'
  71. # define SDIRSEP ";"
  72. # define DRSEP ':'
  73. # define SDRSEP ":"
  74. # define NULLDEV "NUL"
  75. typedef signed char as_int8_t;
  76. typedef unsigned char as_uint8_t;
  77. typedef signed short as_int16_t;
  78. typedef unsigned short as_uint16_t;
  79. # define HAS16
  80. typedef signed int as_int32_t;
  81. # define PRIas_int32_t "d"
  82. typedef unsigned int as_uint32_t;
  83. #define AS_64_IS_LONGLONG
  84. # define W32_NLS
  85. #endif
  86.  
  87. /*---------------------------------------------------------------------------*/
  88. /* unify 68K platforms */
  89.  
  90. #ifdef __mc68020
  91. # ifndef __m68k
  92. #  define __m68k
  93. # endif
  94. #endif
  95.  
  96. #ifdef m68000
  97. # ifndef __m68k
  98. #  define __m68k
  99. # endif
  100. #endif
  101.  
  102. #ifdef __mc68000
  103. # ifndef __m68k
  104. #  define __m68k
  105. # endif
  106. #endif
  107.  
  108. /*---------------------------------------------------------------------------*/
  109. /* ditto for i386 platforms */
  110.  
  111. /* MSDOS only runs on x86s... */
  112.  
  113. #ifdef __MSDOS__
  114. # define __i386
  115. #endif
  116.  
  117. /* For IBMC... */
  118.  
  119. #ifdef _M_I386
  120. # define __i386
  121. #endif
  122.  
  123. #ifdef __i386__
  124. # ifndef __i386
  125. #  define __i386
  126. # endif
  127. #endif
  128.  
  129. /*---------------------------------------------------------------------------*/
  130. /* ditto for VAX platforms */
  131.  
  132. #ifdef vax
  133. # ifndef __vax__
  134. #  define __vax__
  135. # endif
  136. #endif
  137.  
  138. /*---------------------------------------------------------------------------*/
  139. /* ditto for PPC platforms */
  140.  
  141. #ifdef __PPC
  142. # ifndef _POWER
  143. #  define _POWER
  144. # endif
  145. #endif
  146.  
  147. #ifdef __ppc__
  148. # ifndef _POWER
  149. #  define _POWER
  150. # endif
  151. #endif
  152.  
  153. #ifdef __PPC__
  154. # ifndef _POWER
  155. #  define _POWER
  156. # endif
  157. #endif
  158.  
  159. #ifdef __PPC64__
  160. # ifndef _POWER4
  161. #  define _POWER4
  162. # endif
  163. #endif
  164.  
  165. /*---------------------------------------------------------------------------*/
  166. /* ditto for ARM platforms */
  167.  
  168. #ifdef __arm__
  169. # ifndef __arm
  170. #  define __arm
  171. # endif
  172. #endif
  173.  
  174. /*---------------------------------------------------------------------------*/
  175. /* If the compiler claims to be ANSI, we surely can use prototypes */
  176.  
  177. #ifdef __STDC__
  178. # define __PROTOS__
  179. # define UNUSED(x) (void)x
  180. #else
  181. # define UNUSED(x) {}
  182. #endif
  183.  
  184. /*---------------------------------------------------------------------------*/
  185. /* just a hack to allow distinguishing SunOS from Solaris on Sparcs... */
  186.  
  187. #ifdef sparc
  188. # ifndef __sparc
  189. #  define __sparc
  190. # endif
  191. #endif
  192.  
  193. #ifdef __sparc
  194. # ifndef __NetBSD__
  195. #  ifndef __FreeBSD__
  196. #   ifndef __linux__
  197. #    ifndef __SVR4
  198. #     define __sunos__
  199. #    else /* __SVR4 */
  200. #     define __solaris__
  201. #    endif /* __SVR4 */
  202. #   endif /* __linux__ */
  203. #  endif /* __FreeBSD__ */
  204. # endif /* __NetBSD */
  205. #endif /* __sparc */
  206.  
  207. #ifdef __sparc__
  208. # ifndef __sparc
  209. #  define __sparc
  210. # endif
  211. #endif
  212.  
  213. /*---------------------------------------------------------------------------*/
  214. /* similar on Sun 3's... */
  215.  
  216. #ifdef __m68k
  217. # ifndef __NetBSD__
  218. #  ifndef __linux__
  219. #   ifndef __MUNIX__
  220. #    ifndef __amiga
  221. #     define __sunos__
  222. #    endif
  223. #   endif
  224. #  endif
  225. # endif
  226. #endif
  227.  
  228. /*===========================================================================*/
  229. /* 68K platforms */
  230.  
  231. #ifdef __m68k
  232.  
  233. #define ARCHPRNAME "m68k"
  234.  
  235. /*---------------------------------------------------------------------------*/
  236. /* SUN/3 with SunOS 4.x:
  237.  
  238.    see my SunOS quarrels in the Sparc section... */
  239.  
  240. #ifdef __sunos__
  241. #ifndef __GNUC__
  242. # undef AS_HAS_LONGLONG
  243. # define AS_HAS_LONGLONG 0
  244. #endif
  245. #define ARCHSYSNAME "sun-sunos"
  246. #define DEFSMADE
  247. #define OPENRDMODE "r"
  248. #define OPENWRMODE "w"
  249. #define OPENUPMODE "r+"
  250. #define IEEEFLOAT_8_DOUBLE
  251. typedef signed char as_int8_t;
  252. typedef unsigned char as_uint8_t;
  253. typedef signed short as_int16_t;
  254. typedef unsigned short as_uint16_t;
  255. #define HAS16
  256. typedef signed int as_int32_t;
  257. #define PRIas_int32_t "d"
  258. typedef unsigned int as_uint32_t;
  259. #define AS_64_IS_LONGLONG
  260. #define memmove(s1,s2,len) bcopy(s2,s1,len)
  261. extern void bcopy();
  262. #define NO_NLS
  263. #endif
  264.  
  265. /*---------------------------------------------------------------------------*/
  266. /* SUN/3 with NetBSD 1.x:
  267.  
  268.    quite a normal 32-Bit-UNIX system */
  269.  
  270. #ifdef __NetBSD__
  271. #define ARCHSYSNAME "sun-netbsd"
  272. #define DEFSMADE
  273. #define OPENRDMODE "r"
  274. #define OPENWRMODE "w"
  275. #define OPENUPMODE "r+"
  276. #define IEEEFLOAT_8_DOUBLE
  277. typedef signed char as_int8_t;
  278. typedef unsigned char as_uint8_t;
  279. typedef signed short as_int16_t;
  280. typedef unsigned short as_uint16_t;
  281. #define HAS16
  282. typedef signed int as_int32_t;
  283. #define PRIas_int32_t "d"
  284. typedef unsigned int as_uint32_t;
  285. #define AS_64_IS_LONGLONG
  286. #define LOCALE_NLS
  287. #endif
  288.  
  289. /*---------------------------------------------------------------------------*/
  290. /* PCS/Cadmus:
  291.  
  292.    quite a bare system, lots of work required... */
  293.  
  294. #ifdef __MUNIX__
  295. #define ARCHSYSNAME "pcs-munix"
  296. #define DEFSMADE
  297. #define OPENRDMODE "r"
  298. #define OPENWRMODE "w"
  299. #define OPENUPMODE "r+"
  300. #define IEEEFLOAT_8_DOUBLE
  301. extern double strtod();
  302. #define NEEDS_STRSTR
  303. typedef char as_int8_t;
  304. typedef unsigned char as_uint8_t;
  305. typedef short as_int16_t;
  306. typedef unsigned short as_uint16_t;
  307. #define HAS16
  308. typedef int as_int32_t;
  309. #define PRIas_int32_t "d"
  310. typedef unsigned int as_uint32_t;
  311. #undef AS_HAS_LONGLONG
  312. #define AS_HAS_LONGLONG 0
  313. #define memmove(s1,s2,len) bcopy(s2,s1,len)
  314. extern char *getenv();
  315. #define NO_NLS
  316. #endif
  317.  
  318. /*---------------------------------------------------------------------------*/
  319. /* Linux/68K:
  320.  
  321.    quite a normal 32-Bit-UNIX system */
  322.  
  323. #ifdef __linux__
  324. #define ARCHSYSNAME "unknown-linux"
  325. #define DEFSMADE
  326. #define OPENRDMODE "r"
  327. #define OPENWRMODE "w"
  328. #define OPENUPMODE "r+"
  329. #if AS_HAS_LONGDOUBLE
  330. # define IEEEFLOAT_10_2P8_LONG_DOUBLE
  331. #else
  332. # define IEEEFLOAT_8_DOUBLE
  333. #endif
  334. typedef signed char as_int8_t;
  335. typedef unsigned char as_uint8_t;
  336. typedef signed short as_int16_t;
  337. typedef unsigned short as_uint16_t;
  338. #define HAS16
  339. typedef signed int as_int32_t;
  340. #define PRIas_int32_t "d"
  341. typedef unsigned int as_uint32_t;
  342. #define AS_64_IS_LONGLONG
  343. #define NO_NLS
  344. #endif
  345.  
  346. #endif /* __m68k */
  347.  
  348. /*===========================================================================*/
  349. /* SPARC platforms */
  350.  
  351. #ifdef __sparc
  352.  
  353. #define ARCHPRNAME "sparc"
  354.  
  355. /*---------------------------------------------------------------------------*/
  356. /* SUN Sparc with SunOS 4.1.x:
  357.  
  358.    don't try cc, use gcc, it's hopeless without an ANSI-compliant compiler...
  359.    SunOS does have NLS support, but it does not have D_FMT and T_FMT
  360.    I should change this ...
  361.    Though the manual pages claim that memmove and atexit exist, I could not
  362.    find them in any library :-(  Fortunately, bcopy claims to be safe for
  363.    overlapping arrays, we just have to reverse source and destination pointers.
  364.    The sources themselves contain a switch to use on_exit instead of atexit
  365.    (it uses a different callback scheme, so we cannot just make a #define here...)
  366.    To get rid of most of the messages about missing prototypes, add
  367.    -D__USE_FIXED_PROTOTYPES__ to your compiler flags!
  368.    Apart from these few points, one could claim SunOS to be quite a normal
  369.    32-bit-UNIX... */
  370.  
  371. #ifdef __sunos__
  372. #ifndef __GNUC__
  373. # undef AS_HAS_LONGLONG
  374. # define AS_HAS_LONGLONG 0
  375. #endif
  376. #define ARCHSYSNAME "sun-sunos"
  377. #define DEFSMADE
  378. #define OPENRDMODE "r"
  379. #define OPENWRMODE "w"
  380. #define OPENUPMODE "r+"
  381. #define IEEEFLOAT_8_DOUBLE
  382. typedef signed char as_int8_t;
  383. typedef unsigned char as_uint8_t;
  384. typedef signed short as_int16_t;
  385. typedef unsigned short as_uint16_t;
  386. #define HAS16
  387. typedef signed int as_int32_t;
  388. #define PRIas_int32_t "d"
  389. typedef unsigned int as_uint32_t;
  390. #define AS_64_IS_LONGLONG
  391. #define fpos_t long
  392. #ifdef __STDC__
  393. extern void bcopy();
  394. #endif
  395. #define memmove(s1,s2,len) bcopy(s2,s1,len)
  396. #define NO_NLS
  397. #endif
  398.  
  399. /*---------------------------------------------------------------------------*/
  400. /* SUN Sparc with Solaris 2.x:
  401.  
  402.    quite a normal 32-Bit-UNIX system */
  403.  
  404. #ifdef __solaris__
  405. #define ARCHSYSNAME "sun-solaris"
  406. #define DEFSMADE
  407. #define OPENRDMODE "r"
  408. #define OPENWRMODE "w"
  409. #define OPENUPMODE "r+"
  410. #define IEEEFLOAT_8_DOUBLE
  411. typedef signed char as_int8_t;
  412. typedef unsigned char as_uint8_t;
  413. typedef signed short as_int16_t;
  414. typedef unsigned short as_uint16_t;
  415. #define HAS16
  416. typedef signed int as_int32_t;
  417. #define PRIas_int32_t "d"
  418. typedef unsigned int as_uint32_t;
  419. #define AS_64_IS_LONGLONG
  420. #define LOCALE_NLS
  421. #endif
  422.  
  423. /*---------------------------------------------------------------------------*/
  424. /* Sparc with NetBSD 1.x:
  425.  
  426.    quite a normal 32-Bit-UNIX system */
  427.  
  428. #ifdef __NetBSD__
  429. #define ARCHSYSNAME "sun-netbsd"
  430. #define DEFSMADE
  431. #define OPENRDMODE "r"
  432. #define OPENWRMODE "w"
  433. #define OPENUPMODE "r+"
  434. #define IEEEFLOAT_8_DOUBLE
  435. typedef signed char as_int8_t;
  436. typedef unsigned char as_uint8_t;
  437. typedef signed short as_int16_t;
  438. typedef unsigned short as_uint16_t;
  439. #define HAS16
  440. typedef signed int as_int32_t;
  441. #define PRIas_int32_t "d"
  442. typedef unsigned int as_uint32_t;
  443. #define AS_64_IS_LONGLONG
  444. #define LOCALE_NLS
  445. #endif
  446.  
  447. /*---------------------------------------------------------------------------*/
  448. /* Sparc with Linux                                                          */
  449.  
  450. #ifdef __linux__
  451. #define ARCHSYSNAME "unknown-linux"
  452. #define DEFSMADE
  453. #define OPENRDMODE "r"
  454. #define OPENWRMODE "w"
  455. #define OPENUPMODE "r+"
  456. #define IEEEFLOAT_8_DOUBLE
  457. typedef signed char as_int8_t;
  458. typedef unsigned char as_uint8_t;
  459. typedef signed short as_int16_t;
  460. typedef unsigned short as_uint16_t;
  461. #define HAS16
  462. typedef signed int as_int32_t;
  463. #define PRIas_int32_t "d"
  464. typedef unsigned int as_uint32_t;
  465. #define AS_64_IS_LONGLONG
  466. #define LOCALE_NLS
  467. #endif
  468.  
  469. #endif /* __sparc */
  470.  
  471. /*===========================================================================*/
  472. /* Mips platforms */
  473.  
  474. #ifdef __mips
  475.  
  476. #define ARCHPRNAME "mips"
  477.  
  478. /*---------------------------------------------------------------------------*/
  479. /* R3000 with Ultrix 4.3:
  480.  
  481.    nl_langinfo prototype is there, but no function in library ?!
  482.    use long long only if you have gcc, c89 doesn't like them !
  483.    cc isn't worth trying, believe me! */
  484.  
  485. #ifdef __ultrix
  486. #ifndef __GNUC__
  487. # undef AS_HAS_LONGLONG
  488. # define AS_HAS_LONGLONG 0
  489. #endif
  490. #define ARCHSYSNAME "dec-ultrix"
  491. #define DEFSMADE
  492. #define OPENRDMODE "r"
  493. #define OPENWRMODE "w"
  494. #define OPENUPMODE "r+"
  495. #define IEEEFLOAT_8_DOUBLE
  496. #define NEEDS_STRDUP
  497. typedef signed char as_int8_t;
  498. typedef unsigned char as_uint8_t;
  499. typedef signed short as_int16_t;
  500. typedef unsigned short as_uint16_t;
  501. #define HAS16
  502. typedef signed int as_int32_t;
  503. #define PRIas_int32_t "d"
  504. typedef unsigned int as_uint32_t;
  505. #define AS_64_IS_LONGLONG
  506. #define NO_NLS
  507. #endif
  508.  
  509. /*---------------------------------------------------------------------------*/
  510. /* R2000/3000 with NetBSD 1.2:
  511.  
  512.    quite a normal 32-Bit-UNIX system */
  513.  
  514. #ifdef __NetBSD__
  515. #define ARCHSYSNAME "dec-netbsd"
  516. #define DEFSMADE
  517. #define OPENRDMODE "r"
  518. #define OPENWRMODE "w"
  519. #define OPENUPMODE "r+"
  520. #define IEEEFLOAT_8_DOUBLE
  521. typedef signed char as_int8_t;
  522. typedef unsigned char as_uint8_t;
  523. typedef signed short as_int16_t;
  524. typedef unsigned short as_uint16_t;
  525. #define HAS16
  526. typedef signed int as_int32_t;
  527. #define PRIas_int32_t "d"
  528. typedef unsigned int as_uint32_t;
  529. #define AS_64_IS_LONGLONG
  530. #define LOCALE_NLS
  531. #endif
  532.  
  533. /*---------------------------------------------------------------------------*/
  534. /* R3000/4x00 with Irix 5.x:
  535.  
  536.   quite a normal 32-Bit-UNIX system
  537.   seems also to work with 6.2... */
  538.  
  539. #ifdef __sgi
  540. #define ARCHSYSNAME "sgi-irix"
  541. #define DEFSMADE
  542. #define OPENRDMODE "r"
  543. #define OPENWRMODE "w"
  544. #define OPENUPMODE "r+"
  545. #define IEEEFLOAT_8_DOUBLE
  546. typedef signed char as_int8_t;
  547. typedef unsigned char as_uint8_t;
  548. typedef signed short as_int16_t;
  549. typedef unsigned short as_uint16_t;
  550. #define HAS16
  551. typedef signed int as_int32_t;
  552. #define PRIas_int32_t "d"
  553. typedef unsigned int as_uint32_t;
  554. #define AS_64_IS_LONGLONG
  555. #define LOCALE_NLS
  556. #endif
  557.  
  558. /*---------------------------------------------------------------------------*/
  559. /* R3000/4x00 with Linux:
  560.  
  561.   quite a normal 32-Bit-UNIX system */
  562.  
  563. #ifdef __linux__
  564. #define ARCHSYSNAME "unknown-linux"
  565. #define DEFSMADE
  566. #define OPENRDMODE "r"
  567. #define OPENWRMODE "w"
  568. #define OPENUPMODE "r+"
  569. #define IEEEFLOAT_8_DOUBLE
  570. typedef signed char as_int8_t;
  571. typedef unsigned char as_uint8_t;
  572. typedef signed short as_int16_t;
  573. typedef unsigned short as_uint16_t;
  574. #define HAS16
  575. typedef signed int as_int32_t;
  576. #define PRIas_int32_t "d"
  577. typedef unsigned int as_uint32_t;
  578. #define AS_64_IS_LONGLONG
  579. #define LOCALE_NLS
  580. #endif
  581.  
  582. #endif /* __mips */
  583.  
  584. /*===========================================================================*/
  585. /* HP-PA platforms */
  586.  
  587. #ifdef __hppa
  588.  
  589. #define ARCHPRNAME "parisc"
  590.  
  591. /*---------------------------------------------------------------------------*/
  592. /* HP-PA 1.x with HP-UX: */
  593.  
  594. #ifdef __hpux
  595. #define ARCHSYSNAME "hp-hpux"
  596. #define DEFSMADE
  597. #define OPENRDMODE "r"
  598. #define OPENWRMODE "w"
  599. #define OPENUPMODE "r+"
  600. #define IEEEFLOAT_8_DOUBLE
  601. typedef signed char as_int8_t;
  602. typedef unsigned char as_uint8_t;
  603. typedef signed short as_int16_t;
  604. typedef unsigned short as_uint16_t;
  605. #define HAS16
  606. typedef signed int as_int32_t;
  607. #define PRIas_int32_t "d"
  608. typedef unsigned int as_uint32_t;
  609. #define AS_64_IS_LONGLONG
  610. #define LOCALE_NLS
  611. #endif
  612.  
  613. #endif /* __hppa */
  614.  
  615. /*===========================================================================*/
  616. /* POWER 64 bit platforms */
  617.  
  618. #ifdef _POWER64
  619.  
  620. #define ARCHPRNAME "ppc64"
  621.  
  622. /*---------------------------------------------------------------------------*/
  623. /* POWER64 with Linux (Macintosh) */
  624.  
  625. #ifdef __linux__
  626.  
  627. #define ARCHSYSNAME "unknown-linux"
  628. #define DEFSMADE
  629. #define OPENRDMODE "r"
  630. #define OPENWRMODE "w"
  631. #define OPENUPMODE "r+"
  632. #define IEEEFLOAT_8_DOUBLE
  633. typedef signed char as_int8_t;
  634. typedef unsigned char as_uint8_t;
  635. typedef signed short as_int16_t;
  636. typedef unsigned short as_uint16_t;
  637. #define HAS16
  638. typedef signed int as_int32_t;
  639. #define PRIas_int32_t "d"
  640. typedef unsigned int as_uint32_t;
  641. #define AS_64_IS_LONG
  642. #define LOCALE_NLS
  643. #endif
  644.  
  645. /*===========================================================================*/
  646. /* POWER(32) platforms */
  647.  
  648. #elif defined _POWER
  649.  
  650. #define ARCHPRNAME "ppc"
  651.  
  652. /*---------------------------------------------------------------------------*/
  653. /* POWER with AIX 4.1: rs6000 */
  654.  
  655. #ifdef _AIX
  656. #define ARCHSYSNAME "ibm-aix"
  657. #define DEFSMADE
  658. #define OPENRDMODE "r"
  659. #define OPENWRMODE "w"
  660. #define OPENUPMODE "r+"
  661. #define IEEEFLOAT_8_DOUBLE
  662. typedef signed char as_int8_t;
  663. typedef unsigned char as_uint8_t;
  664. typedef signed short as_int16_t;
  665. typedef unsigned short as_uint16_t;
  666. #define HAS16
  667. typedef signed int as_int32_t;
  668. #define PRIas_int32_t "d"
  669. typedef unsigned int as_uint32_t;
  670. #undef AS_HAS_LONGLONG
  671. #define AS_HAS_LONGLONG
  672. #define AS_64_IS_LONGLONG
  673. #define LOCALE_NLS
  674. #endif
  675.  
  676. /*---------------------------------------------------------------------------*/
  677. /* POWER with Linux (Macintosh) */
  678.  
  679. #ifdef __linux__
  680.  
  681. #define ARCHSYSNAME "unknown-linux"
  682. #define DEFSMADE
  683. #define OPENRDMODE "r"
  684. #define OPENWRMODE "w"
  685. #define OPENUPMODE "r+"
  686. #define IEEEFLOAT_8_DOUBLE
  687. typedef signed char as_int8_t;
  688. typedef unsigned char as_uint8_t;
  689. typedef signed short as_int16_t;
  690. typedef unsigned short as_uint16_t;
  691. #define HAS16
  692. typedef signed int as_int32_t;
  693. #define PRIas_int32_t "d"
  694. typedef unsigned int as_uint32_t;
  695. #define AS_64_IS_LONGLONG
  696. #define LOCALE_NLS
  697. #endif
  698.  
  699. /*---------------------------------------------------------------------------*/
  700. /* POWER with OSX (Macintosh) */
  701.  
  702. #ifdef __APPLE__
  703. #define ARCHSYSNAME "apple-macosx"
  704. #define DEFSMADE
  705. #define OPENRDMODE "r"
  706. #define OPENWRMODE "w"
  707. #define OPENUPMODE "r+"
  708. #define IEEEFLOAT_8_DOUBLE
  709. typedef signed char as_int8_t;
  710. typedef unsigned char as_uint8_t;
  711. typedef signed short as_int16_t;
  712. typedef unsigned short as_uint16_t;
  713. #define HAS16
  714. typedef signed int as_int32_t;
  715. #define PRIas_int32_t "d"
  716. typedef unsigned int as_uint32_t;
  717. #undef AS_HAS_LONGLONG
  718. #define AS_HAS_LONGLONG
  719. #define AS_64_IS_LONGLONG
  720. #define NO_NLS
  721. #endif
  722.  
  723. #endif /* _POWER */
  724.  
  725. /*===========================================================================*/
  726. /* VAX platforms */
  727.  
  728. #ifdef __vax__
  729.  
  730. #define ARCHPRNAME "vax"
  731.  
  732. /*---------------------------------------------------------------------------*/
  733. /* VAX with Ultrix: */
  734.  
  735. #ifdef __ultrix
  736. #ifndef __GNUC__
  737. # undef AS_HAS_LONGLONG
  738. # define AS_HAS_LONGLONG 0
  739. #endif
  740. #define ARCHSYSNAME "dec-ultrix"
  741. #define DEFSMADE
  742. #define OPENRDMODE "r"
  743. #define OPENWRMODE "w"
  744. #define OPENUPMODE "r+"
  745. #define HOST_DECFLOAT
  746. #define NEEDS_STRDUP
  747. #define NEED_GETTIMEOFDAY
  748. #define BKOKEN_SPRINTF
  749. typedef signed char as_int8_t;
  750. typedef unsigned char as_uint8_t;
  751. typedef signed short as_int16_t;
  752. typedef unsigned short as_uint16_t;
  753. #define HAS16
  754. typedef signed int as_int32_t;
  755. #define PRIas_int32_t "d"
  756. typedef unsigned int as_uint32_t;
  757. #define AS_64_IS_LONGLONG
  758. #define NO_NLS
  759. #endif
  760.  
  761. /*---------------------------------------------------------------------------*/
  762. /* VAX with NetBSD 1.x:
  763.  
  764.    quite a normal 32-Bit-UNIX system - except for the float format... */
  765.  
  766. #ifdef __NetBSD__
  767. #define ARCHSYSNAME "vax-netbsd"
  768. #define DEFSMADE
  769. #define OPENRDMODE "r"
  770. #define OPENWRMODE "w"
  771. #define OPENUPMODE "r+"
  772. #define HOST_DECFLOAT
  773. typedef signed char as_int8_t;
  774. typedef unsigned char as_uint8_t;
  775. typedef signed short as_int16_t;
  776. typedef unsigned short as_uint16_t;
  777. #define HAS16
  778. typedef signed int as_int32_t;
  779. #define PRIas_int32_t "d"
  780. typedef unsigned int as_uint32_t;
  781. #define AS_64_IS_LONGLONG
  782. #define LOCALE_NLS
  783. #endif
  784.  
  785. #endif /* vax */
  786.  
  787. #ifdef __aarch64__
  788.  
  789. #define ARCHPRNAME "aarch64"
  790.  
  791. /*---------------------------------------------------------------------------*/
  792. /* AArch64 with Linux and GCC: */
  793.  
  794. #ifdef __linux__
  795. #define ARCHSYSNAME "unknown-linux"
  796. #define DEFSMADE
  797. #define OPENRDMODE "r"
  798. #define OPENWRMODE "w"
  799. #define OPENUPMODE "r+"
  800. #define IEEEFLOAT_8_DOUBLE
  801. typedef signed char as_int8_t;
  802. typedef unsigned char as_uint8_t;
  803. typedef signed short as_int16_t;
  804. typedef unsigned short as_uint16_t;
  805. #define HAS16
  806. typedef signed int as_int32_t;
  807. #define PRIas_int32_t "d"
  808. typedef unsigned int as_uint32_t;
  809. #define AS_64_IS_LONG
  810. #define LOCALE_NLS
  811. #endif
  812.  
  813. /*---------------------------------------------------------------------------*/
  814. /* AArch64 with macOS (Apple M-series CPU) */
  815.  
  816. #ifdef __APPLE__
  817. #define ARCHSYSNAME "apple-darwin"
  818. #define DEFSMADE
  819. #define OPENRDMODE "r"
  820. #define OPENWRMODE "w"
  821. #define OPENUPMODE "r+"
  822. #define IEEEFLOAT_8_DOUBLE
  823. typedef signed char as_int8_t;
  824. typedef unsigned char as_uint8_t;
  825. typedef signed short as_int16_t;
  826. typedef unsigned short as_uint16_t;
  827. #define HAS16
  828. typedef signed int as_int32_t;
  829. #define PRIas_int32_t "d"
  830. typedef unsigned int as_uint32_t;
  831. #define AS_64_IS_LONG
  832. #define LOCALE_NLS
  833. #endif
  834.  
  835. #endif /* __aarch64__ */
  836.  
  837. /*===========================================================================*/
  838. /* DEC Alpha platforms */
  839.  
  840. #ifdef __alpha
  841.  
  842. #define ARCHPRNAME "alpha"
  843.  
  844. /*---------------------------------------------------------------------------*/
  845. /* DEC Alpha with Digital UNIX and DEC C / GCC:
  846.  
  847.    Alpha is a 64 bit machine, so we do not need to use extra longs
  848.    OSF has full NLS support */
  849.  
  850. #ifdef __osf__
  851. #define ARCHSYSNAME "dec-osf"
  852. #define DEFSMADE
  853. #define OPENRDMODE "r"
  854. #define OPENWRMODE "w"
  855. #define OPENUPMODE "r+"
  856. #define IEEEFLOAT_8_DOUBLE
  857. typedef signed char as_int8_t;
  858. typedef unsigned char as_uint8_t;
  859. typedef signed short as_int16_t;
  860. typedef unsigned short as_uint16_t;
  861. #define HAS16
  862. typedef signed int as_int32_t;
  863. #define PRIas_int32_t "d"
  864. typedef unsigned int as_uint32_t;
  865. #define AS_64_IS_LONG
  866. #define LOCALE_NLS
  867. #endif
  868.  
  869. /*---------------------------------------------------------------------------*/
  870. /* DEC Alpha with Linux and GCC:
  871.  
  872.    see OSF... */
  873.  
  874. #ifdef __linux__
  875. #define ARCHSYSNAME "unknown-linux"
  876. #define DEFSMADE
  877. #define OPENRDMODE "r"
  878. #define OPENWRMODE "w"
  879. #define OPENUPMODE "r+"
  880. #define IEEEFLOAT_8_DOUBLE
  881. typedef signed char as_int8_t;
  882. typedef unsigned char as_uint8_t;
  883. typedef signed short as_int16_t;
  884. typedef unsigned short as_uint16_t;
  885. #define HAS16
  886. typedef signed int as_int32_t;
  887. #define PRIas_int32_t "d"
  888. typedef unsigned int as_uint32_t;
  889. #define AS_64_IS_LONG
  890. #define LOCALE_NLS
  891. #endif
  892.  
  893. /*---------------------------------------------------------------------------*/
  894. /* DEC Alpha with NetBSD and GCC:
  895.  
  896.    see OSF... */
  897.  
  898. #ifdef __NetBSD__
  899. #define ARCHSYSNAME "unknown-netbsd"
  900. #define DEFSMADE
  901. #define OPENRDMODE "r"
  902. #define OPENWRMODE "w"
  903. #define OPENUPMODE "r+"
  904. #define IEEEFLOAT_8_DOUBLE
  905. typedef signed char as_int8_t;
  906. typedef unsigned char as_uint8_t;
  907. typedef signed short as_int16_t;
  908. typedef unsigned short as_uint16_t;
  909. #define HAS16
  910. typedef signed int as_int32_t;
  911. #define PRIas_int32_t "d"
  912. typedef unsigned int as_uint32_t;
  913. #define AS_64_IS_LONG
  914. #define LOCALE_NLS
  915. #endif
  916.  
  917. #ifdef __FreeBSD__
  918. #define ARCHSYSNAME "unknown-freebsd"
  919. #define DEFSMADE
  920. #define OPENRDMODE "r"
  921. #define OPENWRMODE "w"
  922. #define OPENUPMODE "r+"
  923. #define IEEEFLOAT_8_DOUBLE
  924. typedef signed char as_int8_t;
  925. typedef unsigned char as_uint8_t;
  926. typedef signed short as_int16_t;
  927. typedef unsigned short as_uint16_t;
  928. #define HAS16
  929. typedef signed int as_int32_t;
  930. #define PRIas_int32_t "d"
  931. typedef unsigned int as_uint32_t;
  932. #define AS_64_IS_LONG
  933. #define NO_NLS
  934. #endif
  935.  
  936. #endif /* __alpha */
  937.  
  938. /*===========================================================================*/
  939. /* Intel i386 platforms */
  940.  
  941. #ifdef __i386
  942.  
  943. #define ARCHPRNAME "i386"
  944.  
  945. /*---------------------------------------------------------------------------*/
  946. /* Intel i386 with NetBSD 1.x and GCC: (tested on 1.5.3)
  947.  
  948.    principally, a normal 32-bit UNIX */
  949.  
  950. #ifdef __NetBSD__
  951. #define ARCHSYSNAME "i386-netbsd"
  952. #define DEFSMADE
  953. #define OPENRDMODE "r"
  954. #define OPENWRMODE "w"
  955. #define OPENUPMODE "r+"
  956. #define IEEEFLOAT_8_DOUBLE
  957. typedef signed char as_int8_t;
  958. typedef unsigned char as_uint8_t;
  959. typedef signed short as_int16_t;
  960. typedef unsigned short as_uint16_t;
  961. #define HAS16
  962. typedef signed int as_int32_t;
  963. #define PRIas_int32_t "d"
  964. typedef unsigned int as_uint32_t;
  965. #define AS_64_IS_LONGLONG
  966. #define LOCALE_NLS
  967. #endif
  968.  
  969. /*---------------------------------------------------------------------------*/
  970. /* Intel i386 with Linux and GCC:
  971.  
  972.    principally, a normal 32-bit *NIX */
  973.  
  974. #ifdef __linux__
  975.  
  976. #define ARCHSYSNAME "unknown-linux"
  977. #define DEFSMADE
  978. #define OPENRDMODE "r"
  979. #define OPENWRMODE "w"
  980. #define OPENUPMODE "r+"
  981. #if AS_HAS_LONGDOUBLE
  982. # define IEEEFLOAT_10_12_LONG_DOUBLE
  983. #else
  984. # define IEEEFLOAT_8_DOUBLE
  985. #endif
  986. typedef signed char as_int8_t;
  987. typedef unsigned char as_uint8_t;
  988. typedef signed short as_int16_t;
  989. typedef unsigned short as_uint16_t;
  990. #define HAS16
  991. typedef signed int as_int32_t;
  992. #define PRIas_int32_t "d"
  993. typedef unsigned int as_uint32_t;
  994. #define AS_64_IS_LONGLONG
  995. #define LOCALE_NLS
  996. #endif
  997.  
  998. /*---------------------------------------------------------------------------*/
  999. /* Intel i386 with FreeBSD and GCC:
  1000.  
  1001.    principally, a normal 32-bit *NIX */
  1002.  
  1003. #ifdef __FreeBSD__
  1004. #define ARCHSYSNAME "unknown-freebsd"
  1005. #define DEFSMADE
  1006. #define OPENRDMODE "r"
  1007. #define OPENWRMODE "w"
  1008. #define OPENUPMODE "r+"
  1009. #define IEEEFLOAT_8_DOUBLE
  1010. typedef signed char as_int8_t;
  1011. typedef unsigned char as_uint8_t;
  1012. typedef signed short as_int16_t;
  1013. typedef unsigned short as_uint16_t;
  1014. #define HAS16
  1015. typedef signed int as_int32_t;
  1016. #define PRIas_int32_t "d"
  1017. typedef unsigned int as_uint32_t;
  1018. #define AS_64_IS_LONGLONG
  1019. #define NO_NLS
  1020. #endif
  1021.  
  1022. /*---------------------------------------------------------------------------*/
  1023. /* Intel i386 with Darwin and GCC:
  1024.    principally, a normal 32-bit *NIX */
  1025.  
  1026. #ifdef __APPLE__
  1027. #define ARCHSYSNAME "apple-osx"
  1028. #define DEFSMADE
  1029. #define OPENRDMODE "r"
  1030. #define OPENWRMODE "w"
  1031. #define OPENUPMODE "r+"
  1032. #define IEEEFLOAT_8_DOUBLE
  1033. typedef signed char as_int8_t;
  1034. typedef unsigned char as_uint8_t;
  1035. typedef signed short as_int16_t;
  1036. typedef unsigned short as_uint16_t;
  1037. #define HAS16
  1038. typedef signed int as_int32_t;
  1039. #define PRIas_int32_t "d"
  1040. typedef unsigned int as_uint32_t;
  1041. #define AS_64_IS_LONGLONG
  1042. #define LOCALE_NLS
  1043. #endif
  1044.  
  1045. /*---------------------------------------------------------------------------*/
  1046. /* Intel i386 with Windows and Cygnus GCC:
  1047.  
  1048.    well, not really a UNIX... */
  1049.  
  1050. #ifdef _WIN32
  1051.  
  1052. /* no long long data type if C89 is used */
  1053.  
  1054. #if (defined __STDC__) && (!defined __STDC_VERSION__)
  1055. # define NOLONGLONG
  1056. #endif
  1057.  
  1058. #define ARCHSYSNAME "unknown-win32"
  1059. #define DEFSMADE
  1060. #define OPENRDMODE "rb"
  1061. #define OPENWRMODE "wb"
  1062. #define OPENUPMODE "rb+"
  1063. #define IEEEFLOAT_8_DOUBLE
  1064. #define SLASHARGS
  1065. #define PATHSEP '\\'
  1066. #define SPATHSEP "\\"
  1067. #define DIRSEP ';'
  1068. #define SDIRSEP ";"
  1069. #define DRSEP ':'
  1070. #define SDRSEP ":"
  1071. #define NULLDEV "NUL"
  1072. typedef signed char as_int8_t;
  1073. typedef unsigned char as_uint8_t;
  1074. typedef signed short as_int16_t;
  1075. typedef unsigned short as_uint16_t;
  1076. #define HAS16
  1077. typedef signed int as_int32_t;
  1078. #define PRIas_int32_t "d"
  1079. typedef unsigned int as_uint32_t;
  1080. #define AS_64_IS_LONGLONG
  1081. #define W32_NLS
  1082. #endif
  1083.  
  1084. /*---------------------------------------------------------------------------*/
  1085. /* Intel i386 with OS/2 and emx-GCC:
  1086.  
  1087.    well, not really a UNIX... */
  1088.  
  1089. #ifdef __EMX__
  1090. #define ARCHSYSNAME "unknown-os2"
  1091. #define DEFSMADE
  1092. #define OPENRDMODE "rb"
  1093. #define OPENWRMODE "wb"
  1094. #define OPENUPMODE "rb+"
  1095. #define IEEEFLOAT_8_DOUBLE
  1096. #define SLASHARGS
  1097. #define PATHSEP '\\'
  1098. #define SPATHSEP "\\"
  1099. #define DIRSEP ';'
  1100. #define SDIRSEP ";"
  1101. #define DRSEP ':'
  1102. #define SDRSEP ":"
  1103. #define NULLDEV "NUL"
  1104. typedef signed char as_int8_t;
  1105. typedef unsigned char as_uint8_t;
  1106. typedef signed short as_int16_t;
  1107. typedef unsigned short as_uint16_t;
  1108. #define HAS16
  1109. typedef signed int as_int32_t;
  1110. #define PRIas_int32_t "d"
  1111. typedef unsigned int as_uint32_t;
  1112. #define AS_64_IS_LONGLONG
  1113. #define OS2_NLS
  1114. #endif
  1115.  
  1116. /*---------------------------------------------------------------------------*/
  1117. /* Intel i386 with OS/2 and IBMC:
  1118.  
  1119. well, not really a UNIX... */
  1120.  
  1121. #ifdef __IBMC__
  1122. #define DEFSMADE
  1123. #define NODUP
  1124. #define OPENRDMODE "rb"
  1125. #define OPENWRMODE "wb"
  1126. #define OPENUPMODE "rb+"
  1127. #define IEEEFLOAT_8_DOUBLE
  1128. #define SLASHARGS
  1129. #define PATHSEP '\\'
  1130. #define SPATHSEP "\\"
  1131. #define DRSEP ':'
  1132. #define SDRSEP ":"
  1133. #define NULLDEV "NUL"
  1134. typedef signed char as_int8_t;
  1135. typedef unsigned char as_uint8_t;
  1136. typedef signed short as_int16_t;
  1137. typedef unsigned short as_uint16_t;
  1138. #define HAS16
  1139. typedef signed int as_int32_t;
  1140. #define PRIas_int32_t "d"
  1141. typedef unsigned int as_uint32_t;
  1142. #undef AS_HAS_LONGLONG
  1143. #define AS_HAS_LONGLONG 0
  1144. #define OS2_NLS
  1145. #endif
  1146.  
  1147. /*---------------------------------------------------------------------------*/
  1148. /* Intel x86 with MS-DOS and Borland-C:
  1149.  
  1150.    well, not really a UNIX...
  1151.    assure we get a usable memory model */
  1152.  
  1153. #ifdef __MSDOS__
  1154. #ifdef __TURBOC__
  1155. #ifndef __LARGE__
  1156. #error Wrong memory model - use large!
  1157. #endif
  1158. #undef ARCHPRNAME
  1159. #ifdef __DPMI16__
  1160. #define ARCHPRNAME "i286"
  1161. #define ARCHSYSNAME "unknown-dpmi"
  1162. #else
  1163. #define ARCHPRNAME "i86"
  1164. #define ARCHSYSNAME "unknown-msdos"
  1165. #endif
  1166. #define CKMALLOC
  1167. #define HEAPRESERVE 4096
  1168. #define DEFSMADE
  1169. #define OPENRDMODE "rb"
  1170. #define OPENWRMODE "wb"
  1171. #define OPENUPMODE "rb+"
  1172. #define IEEEFLOAT_8_DOUBLE
  1173. /*
  1174. #define IEEEFLOAT_10_10_LONG_DOUBLE
  1175. #define HUGE_VALL _LHUGE_VAL
  1176. #define strtold(s,e) _strtold(s,e)
  1177. */
  1178. #define SLASHARGS
  1179. #define PATHSEP '\\'
  1180. #define SPATHSEP "\\"
  1181. #define DIRSEP ';'
  1182. #define SDIRSEP ";"
  1183. #define DRSEP ':'
  1184. #define SDRSEP ":"
  1185. #define NULLDEV "NUL"
  1186. typedef signed char as_int8_t;
  1187. typedef unsigned char as_uint8_t;
  1188. typedef signed short as_int16_t;
  1189. typedef unsigned short as_uint16_t;
  1190. #define HAS16
  1191. typedef signed long as_int32_t;
  1192. #define PRIas_int32_t "ld"
  1193. typedef unsigned long as_uint32_t;
  1194. #undef AS_HAS_LONGLONG
  1195. #define AS_HAS_LONGLONG 0
  1196. #define DOS_NLS
  1197. #define __PROTOS__
  1198. #undef UNUSED
  1199. #define UNUSED(x) (void)x
  1200. #endif
  1201. #endif
  1202.  
  1203. #endif /* __i386 */
  1204.  
  1205.  
  1206. /*===========================================================================*/
  1207. /* Intel x86_64 platforms */
  1208.  
  1209. #if  (defined __k8__) || (defined __x86_64) || (defined __x86_64__)
  1210.  
  1211. #define ARCHPRNAME "x86_64"
  1212.  
  1213. /*---------------------------------------------------------------------------*/
  1214. /* x86-64/amd64 with Linux/FreeBSD, OSX and GCC:
  1215.  
  1216.    Principally, a normal *NIX. */
  1217.  
  1218. #if defined(__linux__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__APPLE__)
  1219.  
  1220. #ifdef __linux__
  1221. #define ARCHSYSNAME "unknown-linux"
  1222. #elif defined __FreeBSD__
  1223. #define ARCHSYSNAME "unknown-freebsd"
  1224. #elif defined __NetBSD__
  1225. #define ARCHSYSNAME "unknown-netbsd"
  1226. #else
  1227. #define ARCHSYSNAME "apple-osx"
  1228. #endif
  1229.  
  1230. #define DEFSMADE
  1231. #define OPENRDMODE "r"
  1232. #define OPENWRMODE "w"
  1233. #define OPENUPMODE "r+"
  1234. #if AS_HAS_LONGDOUBLE
  1235. # define IEEEFLOAT_10_16_LONG_DOUBLE
  1236. #else
  1237. # define IEEEFLOAT_8_DOUBLE
  1238. #endif
  1239. typedef signed char as_int8_t;
  1240. typedef unsigned char as_uint8_t;
  1241. typedef signed short as_int16_t;
  1242. typedef unsigned short as_uint16_t;
  1243. #define HAS16
  1244. typedef signed int as_int32_t;
  1245. #define PRIas_int32_t "d"
  1246. typedef unsigned int as_uint32_t;
  1247. #define AS_64_IS_LONG
  1248. #define LOCALE_NLS
  1249.  
  1250. #endif /* __linux__ || __FreeBSD__ || __NetBSD__ || __APPLE__ */
  1251.  
  1252. /*---------------------------------------------------------------------------*/
  1253. /* Intel x86-64 with WIN32 and MinGW:
  1254.  
  1255.    Well, not really a UNIX...note that in contrast to Unix-like systems,
  1256.    the size of 'long' remains 32 bit.  One still has to use 'long long' to
  1257.    get 64 bits. */
  1258.  
  1259. #ifdef _WIN32
  1260.  
  1261. #define ARCHSYSNAME "unknown-win64"
  1262. #define DEFSMADE
  1263. #define OPENRDMODE "rb"
  1264. #define OPENWRMODE "wb"
  1265. #define OPENUPMODE "rb+"
  1266. #if AS_HAS_LONGDOUBLE
  1267. # define IEEEFLOAT_10_16_LONG_DOUBLE
  1268. #else
  1269. # define IEEEFLOAT_8_DOUBLE
  1270. #endif
  1271. #define SLASHARGS
  1272. #define PATHSEP '\\'
  1273. #define SPATHSEP "\\"
  1274. #define DIRSEP ';'
  1275. #define SDIRSEP ";"
  1276. #define DRSEP ':'
  1277. #define SDRSEP ":"
  1278. #define NULLDEV "NUL"
  1279. typedef signed char as_int8_t;
  1280. typedef unsigned char as_uint8_t;
  1281. typedef signed short as_int16_t;
  1282. typedef unsigned short as_uint16_t;
  1283. #define HAS16
  1284. typedef signed int as_int32_t;
  1285. #define PRIas_int32_t "d"
  1286. typedef unsigned int as_uint32_t;
  1287. #define AS_64_IS_LONGLONG
  1288. #define NO_NLS
  1289.  
  1290. #endif /* _WIN32 */
  1291.  
  1292. #endif /* __k8__ || __x86_64 || __x86_64__ */
  1293.  
  1294. /*===========================================================================*/
  1295. /* ARM platform */
  1296.  
  1297. #ifdef __arm
  1298.  
  1299. #define ARCHPRNAME "arm"
  1300.  
  1301. /*---------------------------------------------------------------------------*/
  1302. /* ARM linux with GCC */
  1303.  
  1304. #ifdef __linux__
  1305. #define ARCHSYSNAME "unknown-linux-arm"
  1306. #define DEFSMADE
  1307. #define OPENRDMODE "r"
  1308. #define OPENWRMODE "w"
  1309. #define OPENUPMODE "r+"
  1310. #define IEEEFLOAT_8_DOUBLE
  1311. typedef signed char as_int8_t;
  1312. typedef unsigned char as_uint8_t;
  1313. typedef signed short as_int16_t;
  1314. typedef unsigned short as_uint16_t;
  1315. #define HAS16
  1316. typedef signed int as_int32_t;
  1317. #define PRIas_int32_t "d"
  1318. typedef unsigned int as_uint32_t;
  1319. #define AS_64_IS_LONGLONG
  1320. #define LOCALE_NLS
  1321. #endif /* __linux__ */
  1322.  
  1323. /*---------------------------------------------------------------------------*/
  1324. /* Psion PDA (ARM cpu) with SymbianOS Epoc32 rel.5 and installed epocemx-GCC:
  1325.  
  1326.    well, not really a UNIX... */
  1327.  
  1328. #ifdef __EPOC32__
  1329.  
  1330. #ifdef __EPOCEMX__
  1331. #define ARCHSYSNAME "psion-epoc32-epocemx"
  1332. #define DEFSMADE
  1333. #define OPENRDMODE "r"
  1334. #define OPENWRMODE "w"
  1335. #define OPENUPMODE "r+"
  1336. #define IEEEFLOAT_8_DOUBLE
  1337. typedef signed char as_int8_t;
  1338. typedef unsigned char as_uint8_t;
  1339. typedef signed short as_int16_t;
  1340. typedef unsigned short as_uint16_t;
  1341. #define HAS16
  1342. typedef signed int as_int32_t;
  1343. #define PRIas_int32_t "d"
  1344. typedef unsigned int as_uint32_t;
  1345. #define AS_64_IS_LONGLONG
  1346. #define NO_NLS
  1347. #endif /* __EPOCEMX__ */
  1348.  
  1349.  
  1350. #endif /* __EPOC32__ */
  1351.  
  1352. #endif /* __arm */
  1353.  
  1354. /*===========================================================================*/
  1355. /* RISC-V platform */
  1356.  
  1357. #ifdef __riscv
  1358.  
  1359. #define ARCHPRNAME "riscv"
  1360.  
  1361. /*---------------------------------------------------------------------------*/
  1362. /* RISC-V linux with GCC */
  1363.  
  1364. #ifdef __linux__
  1365. #define ARCHSYSNAME "unknown-linux-riscv"
  1366. #define DEFSMADE
  1367. #define OPENRDMODE "r"
  1368. #define OPENWRMODE "w"
  1369. #define OPENUPMODE "r+"
  1370. #define IEEEFLOAT_8_DOUBLE
  1371. typedef signed char as_int8_t;
  1372. typedef unsigned char as_uint8_t;
  1373. typedef signed short as_int16_t;
  1374. typedef unsigned short as_uint16_t;
  1375. #define HAS16
  1376. typedef signed int as_int32_t;
  1377. #define PRIas_int32_t "d"
  1378. typedef unsigned int as_uint32_t;
  1379. #define AS_64_IS_LONGLONG
  1380. #define LOCALE_NLS
  1381. #endif /* __linux__ */
  1382.  
  1383. #endif /* __riscv */
  1384.  
  1385. /*===========================================================================*/
  1386. /* Misc... */
  1387.  
  1388. /*---------------------------------------------------------------------------*/
  1389. /* Just for curiosity, it won't work without 16 bit int's... */
  1390.  
  1391. #ifdef _CRAYMPP
  1392. #define OPENRDMODE "r"
  1393. #define OPENWRMODE "w"
  1394. #define OPENUPMODE "r+"
  1395. #define IEEEFLOAT_8_DOUBLE
  1396. typedef signed char as_int8_t;
  1397. typedef unsigned char as_uint8_t;
  1398. typedef signed short as_int32_t;
  1399. #define PRIas_int32_t "d"
  1400. typedef unsigned short as_uint32_t;
  1401. #define AS_64_IS_LONG
  1402. #define LOCALE_NLS
  1403. #endif
  1404.  
  1405. /*===========================================================================*/
  1406. /* Post-Processing: check for definition, add defaults */
  1407.  
  1408. /* Host provides 64 bit int as long long: can only use it if long long
  1409.    is available: */
  1410.  
  1411. #ifdef AS_64_IS_LONGLONG
  1412. # if AS_HAS_LONGLONG
  1413. typedef signed long long as_int64_t;
  1414. typedef unsigned long long as_uint64_t;
  1415. #  define HAS64
  1416. # endif /* AS_HAS_LONGLONG */
  1417. #endif /* AS_64_IS_LONGLONG */
  1418.  
  1419. /* Host provides 64 bit int as long: use it and define long long
  1420.    away (we don't need it): */
  1421.  
  1422. #ifdef AS_64_IS_LONG
  1423. typedef signed long as_int64_t;
  1424. typedef unsigned long as_uint64_t;
  1425. # define HAS64
  1426. # undef AS_HAS_LONGLONG
  1427. # define AS_HAS_LONGLONG 0
  1428. #endif /* AS_64_IS_LONG */
  1429.  
  1430. /* Some VAX compilers internally seem to use D float
  1431.    and are unable to parse the G float DBL_MAX literal
  1432.    of 8.98...E+308 from float.h.
  1433.    So we put a hand-crafted constant in memory: */
  1434.  
  1435. #ifdef HOST_DECFLOAT
  1436.  typedef double as_float_t;
  1437. # ifdef __GFLOAT
  1438.    extern double as_decfloat_get_max_gfloat(void);
  1439. #  define AS_FLOAT_MAX as_decfloat_get_max_gfloat()
  1440. # else
  1441. #  define AS_FLOAT_MAX DBL_MAX
  1442. # endif
  1443. # define AS_FLOAT_DIG DBL_DIG
  1444. # define AS_HUGE_VAL HUGE_VAL
  1445. # define as_strtof(s,e) strtod(s,e)
  1446. #endif /* HOST_DECFLOAT */
  1447.  
  1448. #ifdef IEEEFLOAT_8_DOUBLE
  1449.  typedef double as_float_t;
  1450. # define AS_FLOAT_MAX DBL_MAX
  1451. # define AS_FLOAT_DIG DBL_DIG
  1452. # define AS_HUGE_VAL HUGE_VAL
  1453. # define as_strtof(s,e) strtod(s,e)
  1454. #endif /* IEEEFLOAT_8_DOUBLE */
  1455.  
  1456. #ifdef IEEEFLOAT_10_16_LONG_DOUBLE
  1457. # define IEEEFLOAT_10_LONG_DOUBLE
  1458. # define XPRIas_float_t "L"
  1459. #endif /* IEEEFLOAT_10_16_LONG_DOUBLE */
  1460.  
  1461. #ifdef IEEEFLOAT_10_12_LONG_DOUBLE
  1462. # define IEEEFLOAT_10_LONG_DOUBLE
  1463. # define XPRIas_float_t "L"
  1464. #endif /* IEEEFLOAT_10_12_LONG_DOUBLE */
  1465.  
  1466. #ifdef IEEEFLOAT_10_10_LONG_DOUBLE
  1467. # define IEEEFLOAT_10_LONG_DOUBLE
  1468. # define XPRIas_float_t "L"
  1469. #endif /* IEEEFLOAT_10_10_LONG_DOUBLE */
  1470.  
  1471. #ifdef IEEEFLOAT_10_2P8_LONG_DOUBLE
  1472. # define IEEEFLOAT_10_LONG_DOUBLE
  1473. # define XPRIas_float_t "L"
  1474. #endif /* IEEEFLOAT_10_2P8_LONG_DOUBLE */
  1475.  
  1476. #ifdef IEEEFLOAT_10_LONG_DOUBLE
  1477.  typedef long double as_float_t;
  1478. # define AS_FLOAT_MAX LDBL_MAX
  1479. # define AS_FLOAT_DIG LDBL_DIG
  1480. # define AS_HUGE_VAL HUGE_VALL
  1481. # define as_strtof(s,e) strtold(s,e)
  1482. # define as_fabs(f) fabsl(f)
  1483. # define as_ldexp(f,e) ldexpl(f,e)
  1484. # define as_frexp(f,e) frexpl(f,e)
  1485. # define as_modf(f,e) modfl(f,e)
  1486. # define as_sqrt(f) sqrtl(f)
  1487. # define as_sin(f) sinl(f)
  1488. # define as_cos(f) cosl(f)
  1489. # define as_tan(f) tanl(f)
  1490. # define as_asin(f) asinl(f)
  1491. # define as_acos(f) acosl(f)
  1492. # define as_atan(f) atanl(f)
  1493. # define as_exp(f) expl(f)
  1494. # define as_log(f) logl(f)
  1495. # define as_log10(f) log10l(f)
  1496. # define as_sinh(f) sinh(f)
  1497. # define as_cosh(f) coshl(f)
  1498. # define as_tanh(f) tanhl(f)
  1499. #endif /* IEEEFLOAT_10_LONG_DOUBLE */
  1500.  
  1501. #ifndef as_strtof
  1502. # define as_strtof(s,e) strtod(s,e)
  1503. #endif
  1504. #ifndef XPRIas_float_t
  1505. # define XPRIas_float_t ""
  1506. #endif
  1507. #ifndef as_fabs
  1508. # define as_fabs(f) fabs(f)
  1509. #endif
  1510. #ifndef as_ldexp
  1511. # define as_ldexp(f,e) ldexp(f,e)
  1512. #endif
  1513. #ifndef as_frexp
  1514. # define as_frexp(f,e) frexp(f,e)
  1515. #endif
  1516. #ifndef as_modf
  1517. # define as_modf(f,e) modf(f,e)
  1518. #endif
  1519. #ifndef as_sqrt
  1520. # define as_sqrt(f) sqrt(f)
  1521. #endif
  1522. #ifndef as_sin
  1523. # define as_sin(f) sin(f)
  1524. #endif
  1525. #ifndef as_cos
  1526. # define as_cos(f) cos(f)
  1527. #endif
  1528. #ifndef as_tan
  1529. # define as_tan(f) tan(f)
  1530. #endif
  1531. #ifndef as_asin
  1532. # define as_asin(f) asin(f)
  1533. #endif
  1534. #ifndef as_acos
  1535. # define as_acos(f) acos(f)
  1536. #endif
  1537. #ifndef as_atan
  1538. # define as_atan(f) atan(f)
  1539. #endif
  1540. #ifndef as_sinh
  1541. # define as_sinh(f) sinh(f)
  1542. #endif
  1543. #ifndef as_exp
  1544. # define as_exp(f) exp(f)
  1545. #endif
  1546. #ifndef as_log
  1547. # define as_log(f) log(f)
  1548. #endif
  1549. #ifndef as_log10
  1550. # define as_log10(f) log10(f)
  1551. #endif
  1552. #ifndef as_cosh
  1553. # define as_cosh(f) cosh(f)
  1554. #endif
  1555. #ifndef as_tanh
  1556. # define as_tanh(f) tanh(f)
  1557. #endif
  1558.  
  1559. #ifdef DEFSMADE
  1560. #ifndef PATHSEP
  1561. #define PATHSEP '/'
  1562. #define SPATHSEP "/"
  1563. #define DIRSEP ':'
  1564. #define SDIRSEP ":"
  1565. #endif
  1566. #ifndef NULLDEV
  1567. #define NULLDEV "/dev/null"
  1568. #endif
  1569. #else
  1570. #error "your platform so far is not included in AS's header files!"
  1571. #error "please edit sysdefs.h!"
  1572. #endif
  1573.  
  1574. #ifdef CKMALLOC
  1575. #define malloc(s) ckmalloc(s)
  1576. #define realloc(p,s) ckrealloc(p,s)
  1577.  
  1578. #include <stddef.h>
  1579.  
  1580. extern void *ckmalloc(size_t s);
  1581.  
  1582. extern void *ckrealloc(void *p, size_t s);
  1583. #endif
  1584. #endif /* _SYSDEFS_H */
  1585.