1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114
|
/* $Id: compiler.h,v 1.171.2.8 2003/03/07 13:28:33 stas_degteff Exp $
* SMAPI; Modified Squish MSGAPI
*
* Squish MSGAPI0 is copyright 1991 by Scott J. Dudley. All rights reserved.
* Modifications released to the public domain.
*
* Use of this file is subject to the restrictions contain in the Squish
* MSGAPI0 licence agreement. Please refer to licence.txt for complete
* details of the licencing restrictions. If you do not find the text
* of this agreement in licence.txt, or if you do not have this file,
* you should contact Scott Dudley at FidoNet node 1:249/106 or Internet
* e-mail Scott.Dudley@f106.n249.z1.fidonet.org.
*
* In no event should you proceed to use any of the source files in this
* archive without having accepted the terms of the MSGAPI0 licensing
* agreement, or such other agreement as you are able to reach with the
* author.
*
* Modifications from MSGAPI are made by HUSKY: http://husky.sf.net
*/
/*
* Please define this compiler-specific stuff for each new compiler:
*
* _stdc - Standard calling sequence. This should be the type of function
* required for function pointers for qsort() et al.
*
* _fast - Fastest calling sequence supported. If the default calling
* sequence is the fastest, or if your compiler only has one,
* define this to nothing.
*
* _intr - For defining interrupt functions. For some idiotic reason,
* MSC requires that interrupt routines be declared
* as "cdecl interrupt", instead of just "interrupt".
*
* _intcast - interrupt cast modifyer
*
* _veccast - vector cast modifyer
*
* far - use pointer with any segment part, actually for x86 16 bit only
* and in other cases must be set to empty value
*
* near - (used for x86 16 bit only) use one-segment pointer
*
* pascal - pascal style calling conversion code modifyer
*
* cdecl - C declarations modifyer (alternate to pascal usually)
* Declare if compiler don't support this.
*
* _loadds - (used for x86 16 bit only) 'load data segment' code modifyer
*
* SMAPI_EXT - external variables & external functions call modifier
* (usualy 'extern' for static linkage)
*
* _XPENTRY - system procedures calling (conversion) modifyer
* ("pascal", "_system" & etc)
*
*
*======================
* HAS_* please set to 1 for usage: #if HAS_...
*======================
* HAS_snprintf - snprintf() presents
* HAS_asprintf - asprintf() presents
* HAS_asnprintf - asnprintf() presents
* HAS_vasprintf - vasprintf() presents
* HAS_vsnprintf - vsnprintf() presents
* HAS_spawnvp - spawnwp() presents
* HAS_getpid - getpid() presents
* HAS_mktime - mktime() presents or defined here
* HAS_strftime - strftime() presents
* HAS_sopen - sopen() presents
* HAS_sleep - sleep() presents or defined here
* HAS_dos_read - dos_read() presents or defined here
* HAS_popen_close - popen(); pclose() ("pipe open" and "pipe close")
* HAS_strupr - strupr() presents
* HAS_strcasecmp - strcasecmp() usualy in <string.h>
* HAS_strncasecmp - strncasecmp() usualy in <string.h>
* HAS_stricmp - stricmp() eq strcasecmp()
* HAS_strnicmp - strnicmp() eq strncasecmp()
* HAS_strlwr - strlwr() lower string (string.h)
* HAS_strupr - strupr() upper string (string.h)
*
* HAS_MALLOC_H - may be used "#include <malloc.h>" for malloc() etc.
* HAS_DOS_H - may be used "#include <dos.h>"
* HAS_DPMI_H - may be used "#include <dpmi.h>"
* HAS_DIR_H - may be used "#include <dir.h>" for findfirst() etc.
* HAS_DIRENT_H - may be used "#include <dirent.h>" for opendir() etc.
* HAS_IO_H - may be used "#include <io.h>"
* HAS_UNISTD_H - may be used "#include <unistd.h>"
* HAS_PROCESS_H - may be used "#include <process.h>"
* HAS_SHARE_H - may be used "#include <share.h>" for sopen() etc.
* HAS_PWD_H - may be used "#include <pwd.h>"
* HAS_GRP_H - may be used "#include <grp.h>"
* HAS_UTIME_H - may be used "#include <utime.h>"
* HAS_SYS_UTIME_H - #include <sys/utime.h> in alternate to <utime.h>
* HAS_SYS_PARAM_H - #include <sys/params.h>
* HAS_SYS_MOUNT_H - #include <sys/mount.h>
* HAS_SYS_WAIT_H - #include <sys/wait.h>
* HAS_SYS_STATVFS_H - #include <sys/statvfs.h>
* HAS_SYS_VFS_H - #include <sys/vfs.h>
* HAS_SYS_SYSEXITS_H - #include <sys/sysexits.h>
* HAS_SYSEXITS_H - #include <sysexits.h>
*
* USE_SYSTEM_COPY - OS have system call for files copiing (see
* copy_file() and move_file() functions)
* USE_SYSTEM_COPY_WIN32 - Windows 9x/NT system copy routine
* USE_SYSTEM_COPY_OS2 - OS/2 system copy routine
* USE_STAT_MACROS - may use stat() macro and non-POSIX (important!)
* S_ISREG and S_ISDIR macros. (See fexist.c)
*
*
***************************************************************************
* Functions "my*" & etc
*
* mysleep(x) - wait x seconds
* mymkdir(d) - make directory
* strcasecmp(s1,s2) - case-incencitive strings comparition, declare if
* present with other name or include header-file
* stricmp(s1,s2) - also as above
* strncasecmp(s1,s2) - case-incencitive strings comparition not more n chars,
* declare if present with other name or include header
* strnicmp(s1,s2) - also as above
*
* farread(a,b,c) - for flat memory models declare as read(a,b,c)
* farwrite(a,b,c) - for flat memory models declare as write(a,b,c)
* NEED_trivial_farread - macro-flag: need use my own trivial_farread()
* instead farread() (implemented in structrw.c)
* NEED_trivial_farwrite - macro-flag: need use my own trivial_farwrite()
* instead farwrite() (implemented in structrw.c)
* MAXPATHLEN - max path len value for disk i/o functions
*
***************************************************************************
* Memory and platforms
*
* __BIG_ENDIAN__ - big endian bytes order in memory
* __LITTLE_ENDIAN__ - little endian bytes order in memory (like Intel x86)
*
* 16bit Intel x86 memory models (compiler-predefined)
* __TINY__ - 64K data, 64K code, stack in code or data
* __SMALL__ - 64K data, 64K code, stack apart
* __MEDIUM__ - 64K data, 1M (640K+HMB+UMB) code, stack apart
* __COMPACT__ - 1M data, 64K code, stack apart
* __LARGE__ - 1M data, 1M code, stack apart
* __HUGE__ - similar to the __LARGE__ except for two additional features:
* Its segment is normalized during pointer arithmetic so that
* pointer comparisons are accurate. And, huge pointers can be
* incremented without suffering from segment wrap around.
* __NEARCODE__ - 64K code
* __FARCODE__ - 1M code
* __NEARDATA__ - 64K data
* __FARDATA__ - 1M data
*
* __FLAT__ - must be declared for any flat memory model, usualy all
* not 16 bit dos, os/2 and windows; predefined for some compilers
* - 64K data
*
***************************************************************************
* Platforms & OS (binary targets)
*
* __NT__ - Windows NT/2000/XP target
* __WIN32__ - Windows 95/98/Me/NT/2000/XP target
* __OS2__ - OS/2 target (32 bit or 16 bit), 32bit is __OS2__ && __FLAT__
* __DOS__ - MS/PC/... DOS target (32 bit or 16 bit), 32bit is __DOS__ && __FLAT__
* __DOS16__ - MS/PC/... DOS target 16 bit
* __DPMI__ - DOS 32 bit (extenders: dos4g, farcall, rsx, ...)
* __MACOS__ - MacOS (Unix clone)
* __UNIX__ - All unix-like OS
* __BSD__ - BSD UNIX clones (BSDI, BSD/OS, FreeBSD, NetBSD, OpenBSD & etc)
* __LINUX__ - GNU/Linux (unix clone)
* __AMIGA__ - AmigaOS
* __ALPHA__ - The Alpha CPU
* __X86__ - Intel's x86 series CPU
* __PPC__ - The PowerPC CPU
* __MPPC__ - The PowerPC CPU on Apple Macintosh
*
*--------------------------------------------------------------------------
* CPU
*
* __186__ - Intel 80186 CPU
* __286__ - Intel 80286 CPU
* __386__ - Intel 80386 CPU
* __486__ - Intel 80486 CPU
* __586__ - Intel Pentium CPU
* __686__ - Intel Pentium Pro CPU
* __786__ - Intel Pentium II CPU
*
*/
/**************************************************************************
* For informaion: list of predefined macroses for known compilers. *
**************************************************************************
Common macroses for GNU C
-------------------------------------------------------------------
__GNUC__ Major version number (2.95.* : 2)
__GNUC_MINOR__ Minor version number (2.95.* : 95)
__VERSION__ String's compiler version representation
===================================================================
MINGW32 for 32-bit Windows NT on Intel and AXP; (GNU C clone)
MINGW32 cross-compiler from unixes; (GNU C clone)
Cygwin GCC with option -mno-cygwin. (GNU C clone)
-------------------------------------------------------------------
__MINGW32__ __GNUC__ __STDC__
--CygWin v1.3.16-1 with gcc 3.2:-----------------------------------
__GNUC__=3 (0x3); __GNUC_MINOR__=2 (0x2)
__VERSION__=3.2 20020927 (prerelease)
--MinGW v1.1 with gcc-2.95.3---------------------------------------
__GNUC__=2 (0x2); __GNUC_MINOR__=95 (0x5F)
__VERSION__=2.95.3-6 (mingw special)
===================================================================
DJGPP (DOS DPMI) (GNU C clone)
-------------------------------------------------------------------
__DJGPP__ __DJGPP DJGPP MSDOS __MSDOS__ __GNUC__ __STDC__
__unix__ unix __i386__
Some values:
__GNUC__=3 (0x3); __GNUC_MINOR__=2 (0x2)
__VERSION__=3.2
__DJGPP__ =__DJGPP =DJGPP =2
DJGPP_MINOR = __DJGPP_MINOR =__DJGPP_MINOR__ =3
===================================================================
EMX (OS/2) (GNU C clone)
-------------------------------------------------------------------
__EMX__
__GNUC__ __VERSION__ __STDC__
__CHAR_UNSIGNED__ (or __CHAR_SIGNED__)
__32BIT__ - if build 32bit code
---Some values (EMX rev 61):---------------------------------------
__GNUC__=2 (0x2); __GNUC_MINOR__=8 (0x8)
__VERSION__=2.8.1
__STDC__=1 (0x1); __STDC_VERSION__=199409 (0x30AF1);
===================================================================
GNU C on FreeBSD
-------------------------------------------------------------------
__FreeBSD__ __unix__ unix __GNUC__ __STDC__
--- Some values (FreeBSD 4.7) -------------------------------------
__GNUC__=2 (0x2); __GNUC_MINOR__=95 (0x5F)
__VERSION__=2.95.4 20020320 [FreeBSD]
__STDC__=1 (0x1); __STDC_VERSION__=199409 (0x30AF1);
__unix__ = 1
__FreeBSD__ = 4
===================================================================
GNU C on Sun
-------------------------------------------------------------------
__sun__
===================================================================
GNU C on BeOS 5
-------------------------------------------------------------------
__BEOS__ __i386__ _X86_ __i386 i386 __ELF__ __INTEL__ __PIC__ __pic__
Values:
__declspec(x) __attribute__((x))
__cdecl __attribute__((__cdecl__))
__stdcall __attribute__((__stdcall__))
intel pentium specific defines:
__pentium__ __i586__ i586 __i586 __pentium pentium
===================================================================
===================================================================
Watcom C: OS/2 32bit target
-------------------------------------------------------------------
__WATCOMC__ __OS2__ __FLAT__ __386__ M_I386 _M_I386 __STDC__
===================================================================
Watcom C: OS/2 16bit target
-------------------------------------------------------------------
__WATCOMC__ __OS2__ __I86__ M_I86 _M_I86
===================================================================
Watcom C: Windows NT and Windows 95 target (-bt=nt)
-------------------------------------------------------------------
__WATCOMC__ __NT__ __FLAT__ __386__ M_I386 _M_I386
===================================================================
Watcom C: Windows 16bit or 32bit target (-bt=windows), not win95/nt
-------------------------------------------------------------------
Win32s: __WATCOMC__ __WINDOWS__ __WINDOWS_386__ __386__ M_I386 _M_I386
Windows: __WATCOMC__ __WINDOWS__ _WINDOWS __I86__ M_I86 _M_I86
===================================================================
Watcom C: DOS 16 bit destination (-bt=dos)
-------------------------------------------------------------------
__WATCOMC__ __DOS__ _DOS MSDOS __I86__ M_I86 _M_I86
===================================================================
Memory model macroses in Watcom C DOS 16 bit destination:
-------------------------------------------------------------------
Model small: __SMALL__ M_I86SM _M_I86SM
Model medium: __MEDIUM__ M_I86MM _M_I86MM
Model compact: __COMPACT__ M_I86CM _M_I86CM
Model large: __LARGE__ M_I86LM _M_I86LM
Model huge: __HUGE__ M_I86HM _M_I86HM
===================================================================
Watcom C: DOS/4G destination (-bt=dos4g) - from WatcomC help
-------------------------------------------------------------------
__WATCOMC__ __DOS4G__ __FLAT__ __386__ __DOS4G__ M_I386 _M_I386
===================================================================
Watcom C other - from WatcomC help & test program
-------------------------------------------------------------------
The __NETWARE__ and __NETWARE_386__ macros are defined when the build
target is "NETWARE" (Novell NetWare)
The __QNX__ macro is defined when the build target is "QNX" (16-bit
or 32-bit QNX).
Watcom C++ predefines the macro __cplusplus to identify the compiler
as a C++ compiler. Also __WATCOM_CPLUSPLUS
-------------------------------------------------------------------
__WATCOMC__ value is compiler_version*100
__WATCOMC__=1100 (0x44C) - Watcom C 11.0c
===================================================================
Watcom C compiler options macros - from WatcomC help
-------------------------------------------------------------------
Option Macro
====== ===================
bm _MT
br _DLL
fpi __FPI__
fpi87 __FPI__
j __CHAR_SIGNED__
oi __INLINE_FUNCTIONS
za NO_EXT_KEYS
zw __WINDOWS__
zW __WINDOWS__
zWs __WINDOWS__
====== ===================
Option All 16-bit only 32-bit only
====== =========== ================= =================
mf __FLAT__ M_386FM _M_386FM
ms __SMALL__ M_I86SM _M_I86SM M_386SM _M_386SM
mm __MEDIUM__ M_I86MM _M_I86MM M_386MM _M_386MM
mc __COMPACT__ M_I86CM _M_I86CM M_386CM _M_386CM
ml __LARGE__ M_I86LM _M_I86LM M_386LM _M_386LM
mh __HUGE__ M_I86HM _M_I86HM
===================================================================
===================================================================
Borland C and Turbo C
-------------------------------------------------------------------
__TURBOC__ = 397 (0x18D) for TurboC 2.0
__TURBOC__ =1040 (0x410) for Borland C++ 3.1
__TURBOC__ =1120 (0x460) for Borland C++ 5.02
__TURBOC__ =1360 (0x550) for Borland C++ 5.5
__BCPLUSPLUS__ =0x340 Borland C++ 5.0 (Defined for C++ compilation)
__BORLANDC__ =0x500 Borland C++ 5.0 Version number
===================================================================
Borland C and Turbo C for DOS
-------------------------------------------------------------------
__TURBOC__ __MSDOS__
===================================================================
Borland C for Win32
-------------------------------------------------------------------
__TURBOC__ __WIN32__ __FLAT__
===================================================================
Borland C for OS/2
-------------------------------------------------------------------
__TURBOC__ __OS2__
===================================================================
Otther Borland C macros
-------------------------------------------------------------------
__BCOPT__ =1 Defined in any compiler that has an optimizer
__CDECL__ =1 Defined if Calling Convention is set to C;
otherwise undefined
_CHAR_UNSIGNED 1 Defined by default indicating that the default char is
unsigned char. Use the -K option to undefine this macro.
===================================================================
===================================================================
Microsoft Visual C/C++
-------------------------------------------------------------------
_MSC_VER value is greated or eq 1200
_MSC_VER=1200 (0x4B0) - MS Visual C++ v6.0 sp5:
--------
_WIN32 Defined for applications for Win32. Always defined.
_CHAR_UNSIGNED Default char type is unsigned. Defined when /J is specified.
__cplusplus Defined for C++ programs only.
_CPPRTTI Defined for code compiled with /GR (Enable Run-Time Type Information).
_CPPUNWIND Defined for code compiled with /GX (Enable Exception Handling).
_DLL Defined when /MD or /MDd (Multithread DLL) is specified.
_M_ALPHA Defined for DEC ALPHA platforms. It is defined as 1 by the ALPHA compiler, and it is not defined if another compiler is used.
_M_IX86 Defined for x86 processors. See Table 1.3 for more details.
_M_MPPC Defined for Power Macintosh platforms. Default is 601 (/QP601). See Table 1.4 for more details.
_M_MRX000 Defined for MIPS platforms. Default is 4000 (/QMR4000). See Table 1.5 for more details.
_M_PPC Defined for PowerPC platforms. Default is 604 (/QP604). See Table 1.6 for more details.
_MFC_VER Defines the MFC version. Defined as 0x0421 for Microsoft Foundation Class Library 4.21. Always defined.
_MSC_EXTENSIONS This macro is defined when compiling with the /Ze compiler option (the default). Its value, when defined, is 1.
_MSC_VER Defines the compiler version. Defined as 1200 for Microsoft Visual C++ 6.0. Always defined.
_MT Defined when /MD or /MDd (Multithreaded DLL) or /MT or /MTd (Multithreaded) is specified.
-------------------------------------------------------------------
_M_IX86 = 300 - CPU 80486 (/G3)
_M_IX86 = 400 - CPU 80486 (/G4)
_M_IX86 = 500 - CPU 80486 (/G5) - default
_M_IX86 = 600 - CPU 80486 (/G6)
_M_MPPC = 601 - PowerPC 601 (/QP601) - Default
_M_MPPC = 603 - PowerPC 603 (/QP603)
_M_MPPC = 604 - PowerPC 604 (/QP604)
_M_MPPC = 620 - PowerPC 620 (/QP620)
_M_PPC = 601 - PowerPC 601 /QP601
_M_PPC = 603 - PowerPC 603 /QP603
_M_PPC = 604 - PowerPC 604 /QP604 - Default
_M_PPC = 620 - PowerPC 620 /QP620
_M_MRX000 = 4000 - R4000 (/QMR4000) - Default
_M_MRX000 = 4100 - R4100 (/QMR4100)
_M_MRX000 = 4200 - R4200 (/QMR4200)
_M_MRX000 = 4400 - R4400 (/QMR4400)
_M_MRX000 = 4600 - R4600 (/QMR4600)
_M_MRX000 = 10000 - R10000 (/QMR10000)
===================================================================
Microsoft C for MS-DOS or OS/2
-------------------------------------------------------------------
_MSC_VER value is less 1200
===================================================================
Microsoft Quick C 2.0 for MS-DOS
-------------------------------------------------------------------
_QC MSDOS __STDC__ M_I86 M_I8086
M_I286 is defined if buld code for system based on 80286
_QC = 1
__STDC__ = 0
===================================================================
===================================================================
MetaWare High C/C++ for OS/2
-------------------------------------------------------------------
__HIGHC__
===================================================================
===================================================================
IBM C/Set++
-------------------------------------------------------------------
__IBMC__
===================================================================
**************************************************************************/
#ifndef __COMPILER_H__
#define __COMPILER_H__
/* small code to demonstrate gcc 2.96 bugs:
char q[2048], *p;
int qq(void)
{ return p[p-q-1];
}
*/
#if defined(__GNUC__)
#if (__GNUC__==2) && (__GNUC_MINOR__>95) /* don't place in one line for prevent old compilers warnings */
#warning Latest GNU C branch 2 is 2.95.*. Your version is not GNU C and not supported. You may use it for your risk.
#warning Download and install GNU C release from www.gnu.org only, please.
#endif
#endif
/**** Compiler defines ****/
#if defined(__DJGPP__) /* DJGPP for MS-DOS (DPMI)*/
# ifndef __DPMI__
# define __DPMI__
# endif
# ifndef __FLAT__
# define __FLAT__
# endif
#endif
#if defined(__RSXNT__)
# ifndef __NT__
# define __NT__
# endif
#endif
#if defined(__EMX__) && defined(__NT__)
# ifndef __RSXNT__
# define __RSXNT__
# endif
#endif
#if defined(__EMX__) && defined(__32BIT__)
# ifndef __386__
# define __386__
# endif
# ifndef __X86__
# define __X86__
# endif
#endif
#if defined(__MINGW32__) /* MinGW32 & cygwin's 'gcc -mno-cygwin' ***********/
#ifndef __NT__
# define __NT__
#endif
#ifndef __WIN32__
# define __WIN32__
#endif
#ifndef __FLAT__
# define __FLAT__
#endif
#endif
#if defined(_MSC_VER)
# if (_MSC_VER >= 1200) /* MS Visual C/C++ */
# define __MSVC__
# ifndef __WIN32__
# define __WIN32__
# endif
# endif
# if (_MSC_VER < 1200)
/* Microsoft C or Microsoft QuickC for MS-DOS or OS/2 */
# define __MSC__
# ifdef __OS2__
# ifndef __MSC__OS2__
# define __MSC__OS2__
# endif
# endif
# ifdef __DOS__
# ifndef __MSC__DOS__
# define __MSC__DOS__
# endif
# endif
# endif
#endif
/* Watcom C */
#if defined(__WATCOMC__)
# if defined(__DOS__) && !defined(__WATCOMC__DOS__)
# define __WATCOMC__DOS__
# endif
# if defined(__DOS4G__) && !defined(__WATCOMC__DOS4G__)
# define __WATCOMC__DOS4G__
# endif
# if (defined(__OS2__) || defined(__OS2V2__)) && !defined(__WATCOMC__OS2__)
# define __WATCOMC__OS2__
# endif
# if defined(__NT__)
# ifndef __WIN32__
# define __WIN32__
# endif
# if !defined(__WATCOMC__NT__)
# define __WATCOMC__NT__
# endif
# if !defined(__WATCOMC__WIN32__)
# define __WATCOMC__WIN32__
# endif
# endif
# if defined(__QNX__)
# if !defined(__UNIX__)
# define __UNIX__
# endif
# if !defined(__WATCOMC__QNX__)
# define __WATCOMC__QNX__
# endif
# endif
#endif
/* Turbo C/C++ & Borland C/C++ */
#if defined(__TURBOC__)
# if defined(__MSDOS__) /* Turbo C/C++ & Borland C/C++ for MS-DOS */
# if !defined(__TURBOC__DOS__)
# define __TURBOC__DOS__
# endif
# endif
# if defined(__WIN32__) && !defined(__TURBOC__WIN32__)
# define __TURBOC__WIN32__ /* Borland C/C++ for Win32 */
# endif
# if defined(__OS2__) && !defined(__TURBOC__OS2__)
# define __TURBOC__OS2__ /* Borland C/C++ for OS/2 */
# endif
#endif
/* IBM C */
#if defined(__IBMC__)
# if !defined(UNIX)
# if !defined(__IBMC__OS2__)
# define __IBMC__OS2__ /* IBM C/Set++ for OS/2 */
# endif
# else
# if !defined(__IBMC__UNIX__)
# define __IBMC__UNIX__ /* IBM C/Set++ for unix */
# endif
# if !defined(__UNIX__)
# define __UNIX__
# endif
# endif
#endif
#if defined(__sun__)
# if !defined(__SUN__)
# define __SUN__
# endif
#endif
#if defined(__linux__) || defined(__Linux__) || defined(linux) || defined(__linux) || defined(LINUX)
# if !defined(__LINUX__)
# define __LINUX__
# endif
# if !defined(__UNIX__)
# define __UNIX__
# endif
#endif
#if defined( __svr4__ ) || defined( __SVR4 )
# if !defined(__SVR4__)
# define __SVR4__
# endif
# if !defined(__UNIX__)
# define __UNIX__
# endif
#endif
#if defined(BSD)
# if !defined(__BSD__)
# define __BSD__
# endif
# if !defined(__UNIX__)
# define __UNIX__
# endif
#endif
#if defined(__DOS4G__) /* DOS4G/W dos-dpmi extender */
#ifndef __DPMI__
# define __DPMI__
#endif
#ifndef __FLAT__
# define __FLAT__
#endif
#endif
/**** OS defines ****/
#if defined(__TURBOC__DOS__) && !defined(__DOS__)
# define __DOS__
#endif
#if defined(__MSDOS__) || defined(DOS) || defined(MSDOS)
# if !defined(__DOS__)
# define __DOS__
# endif
#endif
#if defined(__DOS__)
# if !defined(__FLAT__) && !defined(__DPMI__)
# define __DOS16__
# endif
#endif
#if defined(__OS2V2__) && !defined(__OS2__)
/* Watcom C: wcl -bt=os2v2 */
# define __OS2__
#endif
#if defined(_M_MPPC)
# if !defined(__MACOS__)
# define __MACOS__
# endif
#endif
#if defined(__WIN32) || defined(_WIN32) || defined(WIN32)
# if !defined(__WIN32__)
# define __WIN32__
# endif
#endif
#if defined(NT) || defined(WINNT)
# if !defined(__NT__)
# define __NT__
# endif
#endif
/* defined in MINGW32 & cygwin's gcc with '-mno_cygwin' option *
* This is NOT needed for pure Cygwin builds, Cygwin == UNIX !! */
#if defined(__MINGW32__) && !defined(__NT__)
# define __NT__
#endif
#if defined(__CYGWIN__) && !defined(__UNIX__) /* Pure cygwin */
# define __UNIX__
#endif
#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__)
# if !defined(__UNIX__)
# define __UNIX__
# endif
# if !defined(__BSD__)
# define __BSD__
# endif
#endif
#if defined(__SUN__) || defined(__LINUX__)
# if !defined(__UNIX__)
# define __UNIX__
# endif
#endif
#if defined(_AIX)
# if !defined(__AIX__)
# define __AIX__
# endif
# if !defined(__UNIX__)
# define __UNIX__
# endif
#endif
#if defined(__osf__)
# if !defined(__OSF__)
# define __OSF__
# endif
# if !defined(__UNIX__)
# define __UNIX__
# endif
#endif
#if defined(__hpux)
# if !defined(__HPUX__)
# define __HPUX__
# endif
# if !defined(__UNIX__)
# define __UNIX__
# endif
#endif
/*
BeOS is NOT Unix, but sometime it seem's to Be ... ;)
*/
#if defined (__BEOS__) || defined(__BeOS__)
# if !defined(__UNIX__)
# define __UNIX__
# endif
#endif
#if defined(SASC) /* SAS C for AmigaDOS ***************/
# if !defined(__UNIX__)
# define __UNIX__
# endif
#endif
#if defined(UNIX) || defined(_UNIX) || defined(__unix) || defined(__unix__) || defined(unix)
# ifdef __DJGPP__
# undef __UNIX__
# undef UNIX
# undef _UNIX
# undef __unix__
# undef unix
# else
# ifndef __UNIX__
# define __UNIX__
# endif
# endif
#endif
/***** Platforms *************************************************************/
#if defined(SASC) && !defined(__AMIGA__) /* SAS C for AmigaDOS ***************/
# define __AMIGA__
#endif
#if defined(__alpha) || defined(__alpha__) || defined(_M_ALPHA) || defined(M_ALPHA)
# ifndef __ALPHA__
# define __ALPHA__
# endif
#endif
#if defined(_M_IX86) /* MS Visual C predefined */
# ifndef __X86__
# define __X86__
# endif
# if _M_IX86 >= 300
# ifndef __386__
# define __386__
# endif
# endif
# if _M_IX86 >= 400
# ifndef __486__
# define __486__
# endif
# endif
# if _M_IX86 >= 500
# ifndef __586__
# define __586__
# endif
# endif
# if _M_IX86 >= 600
# ifndef __686__
# define __686__
# endif
# endif
#endif
#if defined(__IX86__) || defined(_X86_)
# ifndef __X86__
# define __X86__
# endif
#endif
#if defined(__i386__) || defined(__i386) || defined(i386)
# ifndef __X86__
# define __X86__
# endif
# ifndef __386__
# define __386__
# endif
#endif
#if defined(__i686__) || defined(__i686) || defined(i686)
# ifndef __X86__
# define __X86__
# endif
# ifndef __686__
# define __686__
# endif
#endif
#if defined(_M_MPPC) /* Power PC Macintosh */
#endif
#if defined(_M_PPC) /* Power PC */
# ifndef __PPC__
# define __PPC__
# endif
#endif
#if defined(_M_MRX000) /* MIPS */
#endif
#ifdef __ALPHA__
# ifndef __BIG_ENDIAN__
# define __BIG_ENDIAN__
# endif
# ifndef __FLAT__
# define __FLAT__
# endif
#endif
#if defined(__X86__)
# ifndef __LITTLE_ENDIAN__
# define __LITTLE_ENDIAN__
# endif
#endif
#ifdef __SUN__
# ifndef __FLAT__
# define __FLAT__
# endif
#endif
#if defined (__CYGWIN__) || defined(__MINGW32__)
# ifndef __X86__
# define __X86__
# endif
# ifndef __386__
# define __386__
# endif
# ifndef __LITTLE_ENDIAN__
# define __LITTLE_ENDIAN__
# endif
# ifndef __FLAT__
# define __FLAT__
# endif
#endif
#if defined(__DOS__) || defined(__DPMI__)
# ifndef __LITTLE_ENDIAN__
# define __LITTLE_ENDIAN__
# endif
#endif
#if defined(__NT__)
# if !defined(__WIN32__)
# define __WIN32__
# endif
#endif
#ifdef __386__
# ifndef __LITTLE_ENDIAN__
# define __LITTLE_ENDIAN__
# endif
# ifndef __FLAT__
# define __FLAT__
# endif
# ifndef __X86__
# define __X86__
# endif
# ifndef __186__
# define __186__
# endif
# ifndef __286__
# define __286__
# endif
#endif
/***** memory models *********************************************************/
#if defined(__DPMI__) || defined(__WIN32__) || defined(__NT__) || defined(__UNIX__)
# ifndef __FLAT__
# define __FLAT__
# endif
#endif
#if defined(__OS2__) && !defined(_MSC_VER)
#if !defined(__386__) && !defined(__FLAT__)
#error Please check your compiler to target: 16 bit or 32 bit and sent report to husky developers: http:\/\/sf.net/projects/husky
#endif
# ifndef __386__
# define __386__
# endif
# ifndef __FLAT__
# define __FLAT__
# endif
#endif
#ifdef __WATCOMC__DOS__
/* WATCOM has both M_I86xxx and __modeltype__ macros */
# if defined(M_I86SM) && ! defined(__SMALL__)
# define __SMALL__
# endif
# if defined(M_I86MM) && !defined(__MEDIUM__)
# define __MEDIUM__
# endif
# if defined(M_I86CM) && !defined(__COMPACT__)
# define __COMPACT__
# endif
# if defined(M_I86LM) && !defined(__LARGE__)
# define __LARGE__
# endif
# if defined(M_I86HM) && !defined(__HUGE__)
# define __HUGE__
# endif
#endif /* ifdef __WATCOMC__DOS__ */
/* Handle 386 "flat" memory model */
#if defined(__FLAT__)
/* Other macros may get defined by braindead compilers */
# ifdef __SMALL__
# undef __SMALL__
# endif
# ifdef __TINY__
# undef __TINY__
# endif
# ifdef __MEDIUM__
# undef __MEDIUM__
# endif
# ifdef __COMPACT__
# undef __COMPACT__
# endif
# ifdef __LARGE__
# undef __LARGE__
# endif
# ifdef __HUGE__
# undef __HUGE__
# endif
/*
* Code is really "near"
*/
# undef __FARCODE__
# undef __FARDATA__
/* Everything should be "near" in the flat model */
# ifdef near
# undef near
# define near
# endif
# ifdef far
# undef far
# define far
# endif
# ifdef huge
# undef huge
# define huge
# endif
#endif /* ifdef __FLAT__ */
#if defined(__SMALL__) || defined(__TINY__)
# define __NEARCODE__
# define __NEARDATA__
#endif
#ifdef __MEDIUM__
# define __FARCODE__
# define __NEARDATA__
#endif
#ifdef __COMPACT__
# define __NEARCODE__
# define __FARDATA__
#endif
#if defined(__LARGE__) || defined(__HUGE__)
# define __FARCODE__
# define __FARDATA__
#endif
/***** compiler-specific stuff **********************************************/
#ifdef __MSVC__ /* MS Visual C/C++ *****************************************/
# ifdef _MAKE_DLL
# define _MAKE_DLL_MVC_
# ifndef _SMAPI_EXT
# define SMAPI_EXT __declspec(dllimport)
# else
# define SMAPI_EXT __declspec(dllexport)
# endif /* _SMAPI_EXT */
/* must be included before function redefenition like '#define fileno _fileno' */
# include <sys/stat.h>
# include <stdio.h>
/* system functions substitutions for DLL build */
# define fileno _fileno
# define read _read
# define lseek _lseek
# define sopen _sopen
# define write _write
# define tell _tell
# define close _close
# define unlink _unlink
# define tzset _tzset
# define stricmp _stricmp
# define strnicmp _strnicmp
# define rmdir _rmdir
# define fstat _fstat
# define strdup _strdup
# define strupr _strupr
# define strlwr _strlwr
# define stat _stat
# define getpid _getpid
# define chsize _chsize
# define open _open
# define access _access
# define spawnvp _spawnvp
# define dup _dup
# define mktemp _mktemp
# define fdopen _fdopen
# define chdir _chdir
# define getcwd _getcwd
# define isatty _isatty
# else /* ifdef _MAKE_DLL */
# define SMAPI_EXT extern
# endif /* ifdef _MAKE_DLL */
# include <limits.h>
# ifndef MAXPATHLEN
# define MAXPATHLEN _MAX_PATH
# endif
/* must be included before macro redefenition '# define SH_DENYNONE _SH_DENYNO' */
# include <share.h>
# ifndef SH_DENYNONE
# ifdef _SH_DENYNO
# define SH_DENYNONE _SH_DENYNO
# else
# pragma message("Please set SH_DENYNONE to proprietary value: used for file locking")
# endif
# endif
# ifndef SH_DENYNO
# ifdef SH_DENYNONE
# define SH_DENYNO SH_DENYNONE
# else
# pragma message("Please set SH_DENYNO to proprietary value: used for file locking")
# endif
# endif
/* must be included before function redefenition '#define P_WAIT _P_WAIT' */
# include <process.h>
# ifndef P_WAIT
# ifdef _P_WAIT
# define P_WAIT _P_WAIT /* process.h */
# else
# pragma message("Please set P_WAIT to proprietary value: used for spawnvp() call")
# endif
# endif
# define _stdc
# ifndef pascal
# define pascal
# endif
# ifndef far
# define far
# endif
# define _fast
# define near
# define _XPENTRY
# define _intr
# define _intcast
# define _veccast
# define _loadds
# define cdecl
# define strcasecmp stricmp
# define strncasecmp strnicmp
# define sleep(x) Sleep(1000L*(x))
# define mysleep(x) Sleep(1000L*(x))
# define farread read
# define farwrite write
# define mode_t int
/* define macrofunctions for fexist.c */
# ifndef S_ISDIR
# define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
# endif
# ifndef S_ISREG
# define S_ISREG(m) (((m) & S_IFMT) == S_IFREG)
# endif
/* define constants for 2nd parameter of access() function */
# ifndef F_OK /* does file exist */
# define F_OK 0
# endif
# ifndef X_OK /* is it executable by caller */
# define X_OK 1
# endif
# ifndef R_OK /* is it readable by caller */
# define R_OK 04
# endif
# ifndef W_OK /* is it writable by caller */
# define W_OK 02
# endif
# define mymkdir _mkdir
# define snprintf _snprintf
# define vsnprintf _vsnprintf
# define HAS_snprintf /* snprintf() presents */
# define HAS_vsnprintf /* vsnprintf() presents */
# define HAS_spawnvp /* spawnwp() presents */
# define HAS_strftime
# define HAS_mktime
# define HAS_sopen
# define HAS_sleep
# define HAS_strupr
# define USE_SYSTEM_COPY /* OS have system call for files copiing */
# define USE_SYSTEM_COPY_WIN32
# define USE_STAT_MACROS /* S_ISDIR, S_ISREG and stat() presents */
# define HAS_IO_H /* may use "#include <io.h> */
# define HAS_SHARE_H /* may use "#include <share.h> */
# define HAS_MALLOC_H /* use "#include <malloc.h>" for malloc() etc. */
# define HAS_DIRECT_H
# define HAS_SYS_UTIME_H /* #include <sys/utime.h> in alternate to <utime.h> */
# define HAS_DIRECT_H /* #include <direct.h> */
# define HAS_PROCESS_H /* may use "#include <process.h> */
SMAPI_EXT int unlock(int handle, long ofs, long length);
SMAPI_EXT int lock(int handle, long ofs, long length);
/* End: MS Visual C/C++ ******************************************************/
#elif defined(__MSC__) /* Microsoft C or Microsoft QuickC for MS-DOS or OS/2 */
# ifndef __LITTLE_ENDIAN__
# define __LITTLE_ENDIAN__
# endif
# define _stdc cdecl
# define _intr cdecl interrupt far
# define _intcast void (_intr *)()
# define _veccast _intcast
# if _MSC_VER >= 600
# define _fast _fastcall
# else
# define _fast pascal
# endif
# define farmalloc(n) _fmalloc(n)
# define farfree(p) _ffree(p)
# define farrealloc(p,n) _frealloc(p,n)
# if _MSC_VER >= 600
# define farcalloc(a,b) _fcalloc(a,b)
# else
void far *farcalloc(int n, int m);
# endif
int unlock(int handle, long ofs, long length);
int lock(int handle, long ofs, long length);
# ifdef __OS2__
/* just don't use 16 bit OS/2, we doubt that it still works */
# define farread read
# define farwrite write
# define _XPENTRY pascal far
# define mysleep(x) DosSleep(1000L*(x))
# define sleep(x) DosSleep(1000L*(x))
# define HAS_sleep 1
# else
# define _XPENTRY
# endif
# define HAS_MALLOC_H /* use "#include <malloc.h>" for malloc() etc. */
# define HAS_IO_H 1 /* may use "#include <io.h> */
# define HAS_SHARE_H 1 /* may use "#include <share.h> */
# define HAS_PROCESS_H /* may use "#include <process.h> */
# define USE_STAT_MACROS
/* End: Microsoft C or Microsoft QuickC for MS-DOS or OS/2 *******************/
/* Begin: Watcom C all variants (DOS, Win, OS/2, QNX) ************************/
#elif defined(__WATCOMC__)
# define mode_t int
# define SMAPI_EXT extern
# define strcasecmp stricmp
# define strncasecmp strnicmp
# define snprintf _snprintf
# define vsnprintf _vsnprintf
# define HAS_snprintf
# define HAS_vsnprintf
# define HAS_spawnvp
# define HAS_getpid
# define HAS_strftime /* strftime() in time.h */
# define HAS_mktime /* mktime() in time.h */
# define HAS_MALLOC_H /* may be used "#include <malloc.h>" (see alc.h) */
# define HAS_IO_H /* may use "#include <io.h> */
# define HAS_SHARE_H /* may use "#include <share.h> */
# define HAS_DIRECT_H
# define HAS_SYS_UTIME_H /* #include <sys/utime.h> in alternate to <utime.h> */
# define HAS_DOS_H
# define HAS_SIGNAL_H 1 /* <signal.h> */
# define HAS_PROCESS_H /* may use "#include <process.h> */
# define mymkdir(x) mkdir(x) /*<direct.h>*/
# define HAS_mkdir
# include <dos.h>
# define mysleep(x) sleep(x) /* dos.h */
# define HAS_sleep
# if defined(__WATCOMC__DOS4G__)
/* WATCOM C/C++ for DOS4G*/
# define _stdc cdecl
# define _intr interrupt far
# define _intcast void (_intr *)()
# define _veccast _intcast
# define _fast pascal
# define farread read
# define farwrite write
# define _XPENTRY pascal
/* End: WATCOM C/C++ for MS-DOS4G */
# elif defined(__WATCOMC__DOS__)
/* WATCOM C/C++ for MS-DOS or DOS4G*/
# define _stdc cdecl
# define _intr interrupt far
# define _intcast void (_intr *)()
# define _veccast _intcast
# define _fast pascal
# ifdef __FAR_DATA__
# define farread read
# define farwrite write
# else
# define farread trivial_farread
# define farwrite trivial_farwrite
# define NEED_trivial_farread 1
# define NEED_trivial_farwrite 1
int trivial_farread( int handle, void far *buffer, unsigned len );
int trivial_farwrite( int handle, void far *buffer, unsigned len );
# endif
# define HAS_dos_read 1 /* dos_read() */
# define dos_read _dos_read /* _dos_read() in dos.h */
# define _XPENTRY pascal
/* End: WATCOM C/C++ for MS-DOS */
# elif defined(__WATCOMC__OS2__)
/* WATCOM C/C++ for OS/2 */
# define _stdc
# define _intr
# define _intcast
# define _veccast
# define _fast
# define farread read
# define farwrite write
# define _XPENTRY _System
/*# define mysleep(x) DosSleep(x*1000)*/ /* os2/bsedos.h */
/* End: WATCOM C/C++ for OS/2 */
# elif defined(__WATCOMC__NT__)
/* WATCOM C/C++ for Windows NT */
# define _stdc
# define _intr
# define _intcast
# define _veccast
# define _fast
# define farread read
# define farwrite write
# define _XPENTRY pascal
/*# define mysleep(x) Sleep(x*1000) */ /* winbase.h */
# include <limits.h>
# ifndef MAXPATHLEN
# define MAXPATHLEN NAME_MAX
# endif
/* End: WATCOM C/C++ for Windows NT */
# endif
/* End: Watcom C all variants ************************************************/
#elif defined(__HIGHC__) /* MetaWare High C/C++ for OS/2 ***********************/
#ifndef __LITTLE_ENDIAN__
# define __LITTLE_ENDIAN__
#endif
# define _stdc
# define _intr
# define _intcast
# define _veccast
# define _fast
# define pascal
# define near
# define far
# define farread read
# define farwrite write
# define mysleep(x) DosSlep(1000L*(x))
# define sleep(x) DosSlep(1000L*(x))
# define HAS_sleep 1
# define unlock(a,b,c) unused(a)
# define lock(a,b,c) 0
# error "Don't know how to implement record locking."
/* Using an executable that does no support record locking is
discouraged in a multitasking environment. If you want to
do it anyway, you may uncomment this line. Record lokcing is used
to obtain a lock on the very first byte of a SQD file which
indicates that no other program should use the message area now.
*/
# define _XPENTRY
# define HAS_MALLOC_H 1 /* use "#include <malloc.h>" for malloc() etc. */
# define HAS_IO_H 1 /* may use "#include <io.h> */
# define HAS_SHARE_H 1 /* may use "#include <share.h> */
# define HAS_PROCESS_H /* may use "#include <process.h> */
/* End: MetaWare High C/C++ for OS/2 */
#elif defined(__MINGW32__) /* MinGW32 & cygwin's 'gcc -mno-cygwin' ***********/
/* Applied to:
- MINGW32 for 32-bit Windows NT on Intel and AXP;
- MINGW32 cross-compiler from unixes;
- Cygwin GCC with option -mno-cygwin.
*/
#ifndef __LITTLE_ENDIAN__
# define __LITTLE_ENDIAN__
#endif
# define _stdc
# define _intr
# define _intcast
# define _veccast
# define _fast
# define _loadds
# define cdecl
# define pascal __stdcall
# define near
# undef far
# define far
# define _XPENTRY
# define SMAPI_EXT extern
# define farread _read
# define farwrite _write
# define fdopen _fdopen
# define close _close
# define open _open
# define lseek _lseek
# define tell _tell
# define write _write
# define read _read
# define sleep(sec) _sleep((sec)*1000l)
# define mysleep(sec) _sleep((sec)*1000l)
# define HAS_sleep 1
# define mymkdir mkdir
/*# define strcasecmp stricmp*/
/*# define strncasecmp strnicmp*/
int unlock(int handle, long ofs, long length);
int lock(int handle, long ofs, long length);
/* older mingw headers are too lazy ... */
# include <share.h>
# define sopen _sopen
# ifndef SH_DENYRW
# define SH_DENYRW 0x10
# endif
# ifndef SH_DENYWR
# define SH_DENYWR 0x20
# endif
# ifndef SH_DENYRD
# define SH_DENYRD 0x30
# endif
# ifndef SH_DENYNO
# define SH_DENYNO 0x40
# endif
# define HAS_spawnvp /* spawnvp() present */
# define HAS_mktime /* time.h */
# define HAS_strftime /* time.h */
# define HAS_ACCESS /* access() in io.h */
# define HAS_sopen
# define HAS_MALLOC_H /* may use "#include <malloc.h>" for malloc() etc. */
# define HAS_IO_H /* may use "#include <io.h> */
# define HAS_SHARE_H /* may use "#include <share.h> */
# define HAS_DIRENT_H /* may use "#include <dirent.h> */
# define HAS_SYS_UTIME_H /* #include <sys/utime.h> in alternate to <utime.h> */
# define HAS_PROCESS_H /* may use "#include <process.h> */
# define USE_STAT_MACROS
/* end: MinGW32 **************************************************************/
#elif defined(__EMX__)/* EMX for 32-bit OS/2 and RSX for Windows NT **********/
#ifndef __LITTLE_ENDIAN__
# define __LITTLE_ENDIAN__ /* using to select functions/macroses for read & write binary values */
#endif
# define _stdc
# define _intr
# define _intcast
# define _veccast
# define _fast
# define _loadds
# define cdecl
# define pascal
# if defined(__32BIT__)
# define near
# undef far
# define far
# define farread(a,b,c) read(a,b,c)
# define farwrite(a,b,c) write(a,b,c)
# endif
# define mymkdir(a) mkdir((a), 0)
int unlock(int handle, long ofs, long length);
int lock(int handle, long ofs, long length);
# define strcasecmp stricmp
# define strncasecmp strnicmp
# define _XPENTRY
# define SMAPI_EXT extern
# define mysleep(x) sleep(x)
# define HAS_sleep 1 /* sleep(): stdlib.h, unistd.h */
# define HAS_snprintf 1
# define HAS_vsnprintf 1
# define HAS_getpid 1 /* getpid() in process.h, unistd.h */
# define HAS_spawnvp 1 /* spawnvp() in process.h */
# define HAS_strftime 1 /* strftime() in time.h */
# define HAS_mktime 1 /* mktime() in time.h */
# define HAS_popen_close 1 /* popen(); pclose() */
# define HAS_DIRENT_H 1 /* use "#include <dirent.h>" for opendir() etc. */
# define HAS_IO_H 1 /* use "#include <io.h>" */
# define HAS_SHARE_H 1 /* may use "#include <share.h> */
# define HAS_UNISTD_H 1 /* use "#include <unistd.h> */
# define HAS_SIGNAL_H 1 /* <signal.h> */
# define HAS_PROCESS_H 1 /* may use "#include <process.h> */
# define HAS_DIS_H 1 /* <dos.h> */
# define USE_STAT_MACROS
/* End: EMX for 32-bit OS/2 and RSX for Windows NT ***************************/
#elif defined(__DJGPP__) /* DJGPP for MS-DOS (DPMI)***************************/
#ifndef __LITTLE_ENDIAN__
# define __LITTLE_ENDIAN__ /* using to select functions/macroses for read & write binary values */
#endif
# ifndef __FLAT__
# define __FLAT__ /* DOS flat memory */
# endif
# define _stdc
# define _intr
# define _intcast
# define _veccast
# define _fast
# define _loadds
# define cdecl
# define pascal
# define near
/*# undef far*/
# define far
# define _XPENTRY
# define SMAPI_EXT extern
# define farread read
# define farwrite write
# define mymkdir(a) mkdir((a), 0)
# if defined(__dj_include_fcntl_h_) && !defined( SH_DENYNONE)
# ifdef SH_DENYNO
# define SH_DENYNONE SH_DENYNO
# else
# define SH_DENYNONE 0
# endif
# endif
# include <unistd.h>
# include <io.h>
# define mysleep(x) sleep(x)
# define HAS_sleep 1
# define HAS_spawnvp 1 /* spawnvp() in process.h */
# define HAS_strftime 1 /* strftime() in time.h */
# define HAS_mktime 1 /* mktime() in time.h */
# define HAS_popen_close 1 /* popen(); pclose() */
# define HAS_sopen 1 /* sopen() : in io.h */
# define HAS_DIR_H 1 /* use "#include <dir.h>" for findfirst() etc. */
# define HAS_DIRENT_H 1 /* use "#include <dirent.h>" for DIR, opendir() etc. */
# define HAS_DIRECT_H 1 /* use "#include <direct.h>" for DIR, opendir() etc. */
# define HAS_DOS_H 1
# define HAS_DPMI_H 1
# define HAS_IO_H 1 /* use "#include <io.h> */
# define HAS_SHARE_H 1 /* may use "#include <share.h> */
# define HAS_UNISTD_H 1 /* use "#include <unistd.h> */
# define HAS_SIGNAL_H 1 /* <signal.h> */
# define HAS_PROCESS_H /* may use "#include <process.h> */
# define USE_STAT_MACROS
/* End: DJGPP for MS-DOS (DPMI) **********************************************/
#elif defined(__TURBOC__)/* Borland Turbo C/C++ & Borland C/C++ **************/
# define HAS_MALLOC_H 1 /* use "#include <malloc.h>" for malloc() etc. */
# define HAS_DIR_H 1 /* use "#include <dir.h>" for findfirst() etc. */
# define HAS_DOS_H 1 /* use "#include <dos.h>" for delay(), intr() etc. */
# define HAS_IO_H 1 /* access(), open(), ... */
# define HAS_SHARE_H 1 /* may use "#include <share.h> */
# define HAS_PROCESS_H /* may use "#include <process.h> */
#if __TURBOC__ == 0x0295
# define HAS_strftime
# define HAS_mktime
#endif
# if defined(__TURBOC__DOS__)/* Turbo C/C++ & Borland C/C++ for MS-DOS */
/* for BC++ 3.1 */
# define strcasecmp stricmp
# define strncasecmp strncmpi
# define _stdc cdecl
# define _intr interrupt far
# define _intcast void (_intr *)()
# define _veccast _intcast
# define _fast _fastcall
# define _loadds
/* #include <conio.h> */
# define mysleep(x) delay(x);
# define sleep(x) delay(x);
# define HAS_sleep 1
# ifndef _XPENTRY
# define _XPENTRY
# endif
# define mode_t int
/* Borland Turbo C/C++ for MS-DOS */
# elif defined(__TURBOC__WIN32__)
/* Borland C/C++ for Win32 */
# define _stdc cdecl
# define _intr
# define _intcast
# define _veccast
# define _fast _fastcall
# define _loadds
# define near
# undef far
# define far
# define farread read
# define farwrite write
# define _XPENTRY
# define strcasecmp stricmp
# define strncasecmp strncmpi
/* End: Borland C/C++ for Win32 */
# elif defined(__TURBOC__OS2__)
/* Borland C/C++ for OS/2 */
# define _stdc cdecl
# define _intr
# define _intcast
# define _veccast
# define _fast _fastcall
# define _loadds
# define near
# undef far
# define far
# define farread read
# define farwrite write
# ifndef _XPENTRY
# define _XPENTRY __syscall
# endif
# define mysleep(x) sleep(x);
# define HAS_sleep 1
# include <io.h>
# include <dos.h>
# define strcasecmp stricmp
# define strncasecmp strncmpi
# endif /* End: Borland C/C++ for OS/2 **************************************/
/* End Turbo C/C++ & borland C/C++********************************************/
#elif defined(__IBMC__OS2__) /* IBM C/Set++ for OS/2**************************/
# define _stdc
# define _intr
# define _intcast
# define _veccast
# define _fast
# define _loadds
# define cdecl
# define pascal
# define near
# undef far
# define far
# define farread read
# define farwrite write
# define mysleep(x) DosSleep(1000L*(x))
# define sleep(x) DosSleep(1000L*(x))
# define HAS_sleep 1
# define _XPENTRY pascal far
# define HAS_MALLOC_H /* use "#include <malloc.h>" for malloc() etc. */
# define HAS_IO_H 1 /* may use "#include <io.h> */
# define HAS_SHARE_H 1 /* may use "#include <share.h> */
# define HAS_DIRECT_H 1 /* may use "#include <direct.h> */
# define HAS_PROCESS_H /* may use "#include <process.h> */
/* End: IBM C/Set++ for OS/2 */
#elif defined(__BEOS__) /* BeOS (Unix clone, GNU C) */
# define _XPENTRY
# define SMAPI_EXT extern
# define _intr
# define _intcast
# define _veccast
# define _fast
# define _loadds
# ifndef _stdc
# define _stdc /*__stdcall*/ /* produce compiler warnings */
# endif
# ifndef cdecl
# define cdecl __cdecl
# endif
# define pascal
# define near
# undef far
# define far
# define farread read
# define farwrite write
# define mymkdir(a) mkdir((a), S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH)
int lock(int handle, long ofs, long length); /* in locking.c */
int unlock(int handle, long ofs, long length);
int sopen(const char *name, int oflag, int ishared, int mode);
# define tell(a) lseek((a),0,SEEK_CUR)
# include <fcntl.h>
# ifndef SH_DENYNONE
# define SH_DENYNONE 0
# endif
# ifndef SH_DENYNO
# define SH_DENYNO 0
# endif
# ifndef SH_DENYALL
# define SH_DENYALL 1
# endif
# define mysleep(x) sleep(x)
/*# define sleep(x) snooze(x*1000000l)*/ /* use sleep() from unistd.h */
# define HAS_sleep 1
# define HAS_mktime 1 /* in <time.h> */
# define HAS_strftime 1 /* in <time.h> */
# define HAS_snprintf 1
# define HAS_vsnprintf 1
# define HAS_popen_close 1 /* popen(); pclose() */
# define HAS_strcasecmp 1
# define HAS_strncasecmp 1
# define HAS_strlwr 1
# define HAS_strupr 1
# define stricmp(s1,s2) strcasecmp(s1,s2)
# define strnicmp(s1,s2,z) strncasecmp(s1,s2,z)
# define HAS_DIRENT_H 1 /* <dirent.h> */
# define HAS_UNISTD_H 1 /* ? unistd.h conflicts with be/kernel/OS.h ? */
# define HAS_PWD_H 1 /* <pwd.h> */
# define HAS_GRP_H 1 /* may be used "#include <grp.h>" */
# define HAS_SIGNAL_H 1 /* <signal.h> */
# define USE_STAT_MACROS 1
# define HAS_SYS_PARAM_H 1
# define HAS_SYS_SYSEXITS_H 1 /* <sys/sysexits.h> */
# define HAS_SYS_WAIT_H 1 /* <sys/wait.h> */
# define HAS_SYS_STATVFS_H 1
/* END: BeOS (Unix clone, GNU C) */
#elif defined(__UNIX__) && !defined(__BEOS__)
/* Unix clones: Linux, FreeBSD, SUNOS (Solaris), MacOS etc. */
# define SMAPI_EXT extern
# define _stdc
# define _intr
# define _intcast
# define _veccast
# define _fast
# define _loadds
# define cdecl
# define pascal
# define near
# undef far
# define far
# define farread read
# define farwrite write
# if (defined(__APPLE__) && defined(__MACH__)) || defined(__NetBSD__) || defined(__FreeBSD__) || defined(_AIX) || defined(__SUN__) || defined(__LINUX__) || defined(__osf__) || defined(__hpux) || defined(__OpenBSD__) || defined(__CYGWIN__)
# define mymkdir(a) mkdir((a), S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH)
# else
# define mymkdir(a) __mkdir((a), S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH)
# endif
int lock(int handle, long ofs, long length); /* in locking.c */
int unlock(int handle, long ofs, long length);
int sopen(const char *name, int oflag, int ishared, int mode);
# ifndef __SUN__
# define tell(a) lseek((a),0,SEEK_CUR)
# endif
# ifndef stricmp
# define stricmp strcasecmp
# endif
# ifndef strnicmp
# define strnicmp strncasecmp
# endif
# if !defined(USG)
# define HAS_SYS_PARAM_H
# endif
# if (defined(BSD) && (BSD >= 199103))
/* now we can be sure we are on BSD 4.4 */
# define HAS_SYS_MOUNT_H
# endif
/* we are not on any BSD-like OS */
/* list other UNIX os'es without getfree mechanism here */
# if defined( __svr4__ ) || defined( __SVR4 ) || defined (__linux__) && defined (__GLIBC__)
# define HAS_SYS_STATVFS_H
# endif
# if defined (__LINUX__) && !defined(__GLIBC__)
# define HAS_SYS_VFS_H
# endif
# include <fcntl.h>
# ifndef O_BINARY
# define O_BINARY 0 /* O_BINARY flag has no effect under UNIX */
# endif
# ifndef O_TEXT
# define O_TEXT 0 /* O_TEXT flag has no effect under UNIX */
# endif
# ifndef SH_DENYNONE
# define SH_DENYNONE 0
# endif
# ifndef SH_DENYNO
# define SH_DENYNO 0
# endif
# ifndef SH_DENYALL
# define SH_DENYALL 1
# endif
# define _XPENTRY
/* Other OS's may sleep with other functions */
# if defined(__SUN__)
# define mysleep(x) usleep(x*1000000l)
# define sleep(x) usleep(x*1000000l)
# define HAS_sleep 1
# elif defined(__BSD__) || defined(__CYGWIN__) || defined(__LINUX__)
# define mysleep(x) sleep(x)
# define HAS_sleep 1
# endif
# ifndef __SUN__ /* SunOs 2.7 not have snprintf() and vsnprintf in libc */
/* If you known test for this - please report to developers */
# define HAS_snprintf 1
# define HAS_vsnprintf 1
# endif
# define HAS_SYSEXITS_H 1 /* <sysexits.h> */
# define HAS_UNISTD_H 1 /* <unistd.h> */
# define HAS_PWD_H 1 /* <pwd.h> */
# define HAS_GRP_H 1 /* may be used "#include <grp.h>" */
# define HAS_SIGNAL_H 1 /* <signal.h> */
# define HAS_SYS_WAIT_H 1 /* <sys/wait.h> */
# define USE_STAT_MACROS
#if defined(__LINUX__) || defined(__BSD__) || defined(__CYGWIN__)
# define HAS_mktime /* <time.h> */
# define HAS_strftime /* <time.h> */
# define HAS_DIRENT_H /* <dirent.h> */
#endif
#if defined(__CYGWIN__)
# define HAS_strupr /* <string.h> from libc (newlib) */
#endif
# define HAS_popen_close /* popen(); pclose() */
/* End: Unix clones **********************************************************/
#elif defined(SASC) /* SAS C for AmigaDOS ************************************/
# define _stdc
# define _intr
# define _intcast
# define _veccast
# define _fast
# define _loadds
# define cdecl
# define pascal
# define near
# undef far
# define far
# define farread read
# define farwrite write
# define mymkdir(a) mkdir((a))
# define unlock(a,b,c) unused(a)
# define lock(a,b,c) 0
# define mysleep(x) unused(x)
#include <fcntlh.>
#ifndef O_BINARY
# define O_BINARY 0 /* O_BINARY flag has no effect under UNIX */
#endif
#error "Don't know how to implement record locking."
/* Using an executable that does no support record locking is
discouraged in a multitasking environment. If you want to
do it anyway, you may uncomment this line. Record locking is used
to obtain a lock on the very first byte of a SQD file which
indicates that no other program should use the message area now.
*/
# define SH_DENYNONE 0
# define sopen(a,b,c,d) open((a),(b),(d))
# define _XPENTRY
/* End: SAS C for AmigaDOS */
#else
# error compiler.h: Unknown compiler! Please compile and run ../test/compiler.c (possible need RTFM of your compiler: section "Predefined macros" and update ../test/compiler.c)
#endif /* End compiler-specific decrarations */
/**** Test defines and/or set default values *********************************/
#if defined(__FLAT__) /* 32 bit or 64 bit = moved from smapi/prog.h */
#define farcalloc calloc
#define farmalloc malloc
#define farrealloc realloc
#define farfree free
#define _fmalloc malloc
#elif defined(__FARDATA__) /* 16 bit (possible obsolete?) - moved from smapi/prog.h */
#define malloc(n) farmalloc(n)
#define calloc(n,u) farcalloc(n,u)
#define free(p) farfree(p)
#define realloc(p,n) farrealloc(p,n)
#endif /* defined(__FARDATA__) */
/* Default separator for path specification */
#ifndef PATH_DELIM /* moved from smapi/prog.h */
#if defined(__UNIX__) || defined(__AMIGA__)
#define PATH_DELIM '/'
#else
#define PATH_DELIM '\\'
#endif
#endif
#ifndef PATHLEN
#ifdef MAXPATHLEN
#define PATHLEN MAXPATHLEN
#else /* moved from smapi/prog.h */ /* OS-depended vallue! */
#define PATHLEN 120 /* Max. length of path */
#endif
#endif
#ifdef HAS_SHARE_H
# include <share.h>
# if !defined(SH_DENYNO) && defined(_SH_DENYNO)
# define SH_DENYNO _SH_DENYNO
# endif
# ifdef SH_DENYNO
# ifndef SH_DENYNONE
# define SH_DENYNONE SH_DENYNO
# endif
# endif
#endif
/* File open and file modes */
#include <fcntl.h>
#if !defined(O_BINARY) && defined(_O_BINARY)
# define O_BINARY _O_BINARY
#endif
#if !defined(O_RDWR) && defined(_O_RDWR)
# define O_RDWR _O_RDWR
#endif
#include <sys/types.h>
#include <sys/stat.h>
#if !defined(S_IFMT) && defined(_S_IFMT)
# define S_IFMT _S_IFMT
#endif
#if !defined(S_IFDIR) && defined(_S_IFDIR)
# define S_IFDIR _S_IFDIR
#endif
#ifndef mymkdir
# ifdef __GNUC__
# warning mymkdir() call set to default value. Please check your compiler documentation for it and write define into compiler.h
# else
# pragma message("mymkdir() call undefined. Please check your compiler documentation for it and write define into compiler.h")
# endif
# define mymkdir mkdir
#endif
#ifndef mysleep
# ifdef __GNUC__
# warning sleep() call undefined. Please check your compiler documentation for it and write "#define mysleep" into compiler.h
# else
# pragma message("sleep() call undefined. Please check your compiler documentation for it and write define into compiler.h")
# endif
# define mysleep(x)
#endif
#ifndef SMAPI_EXT
# ifdef __GNUC__
# warning Please set SMAPI_EXT to extern or proprietary token
# else
# pragma message("Please set SMAPI_EXT to extern or proprietary token")
# endif
# define SMAPI_EXT extern
#endif
#ifndef _XPENTRY
# ifdef __GNUC__
# warning Please check your compiler to system functions call modifyer and define _XPENTRY
# else
# pragma message("Please check your compiler to system functions call modifyer and define _XPENTRY")
# endif
# define _XPENTRY
#endif
#ifndef _stdc
# error Please check your compiler to standard C code modifyer and define _stdc in compiler.h
#endif
#ifndef _intr
# error Please check your compiler to interrupt handler modifyer (usually 'interrupt') and define _intr in compiler.h
#endif
#ifndef _fast
# ifdef __GNUC__
# warning Please check your compiler to fast functions call modifyer and define _fast in compiler.h
# else
# pragma message("Please check your compiler to fast functions call modifyer and define _fast in compiler.h")
# endif
# define _fast
#endif
#ifndef farread
# error Please check your compiler to far calling implementation of read() function and define farread in compiler.h
#endif
#ifndef farwrite
# error Please check your compiler to far calling implementation of write() function and define farwrite in compiler.h
#endif
/* waitlock works like lock, but blocks until the lock can be
* performed.
* waitlock2 works like a timed waitlock.
*/
extern int waitlock(int, long, long);
extern int waitlock2(int, long, long, long);
#if !defined(HAS_mktime)
/* If compiler doesn't include a mktime(), we need our own */
/* But our own mktime not implemented yet...
#include <time.h>
time_t _stdc mktime(struct tm *tm_ptr);
*/
#error Our own mktime() not implemented yet... sorry.
#endif
/* If compiler doesn't include a strftime(), we need our own (see strftim.c) */
#if !defined(HAS_strftime)
#define strftime(str,max,fmt,tm) strftim(str,max,fmt,tm)
size_t _stdc strftim( char *str, size_t maxsize, const char *fmt,
const struct tm *tm_ptr );
#endif
#if !defined(HAS_strupr)
char *strupr(char *str);
#endif
/* Some implementations not include the min() macro or function. Usually C++ */
#ifndef min
# define min(a,b) (((a) < (b)) ? (a) : (b))
#endif
#ifndef max
# define max(a,b) (((a) > (b)) ? (a) : (b))
#endif
#ifdef HAS_PROCESS_H
# include <process.h>
#endif
#if !defined(P_WAIT) && defined(_P_WAIT) /*for spawn* in process.h*/
# define P_WAIT _P_WAIT
#endif
#ifdef NEED_trivial_farread
int trivial_farread( int handle, void far *buffer, unsigned len );
#endif
#ifdef NEED_trivial_farwrite
int trivial_farwrite( int handle, void far *buffer, unsigned len );
#endif
#endif
|