home *** CD-ROM | disk | FTP | other *** search
/ linuxmafia.com 2016 / linuxmafia.com.tar / linuxmafia.com / pub / linux / backup / star-1.3.1.tar.gz / star-1.3.1.tar / star-1.3.1 / include / mconfig.h < prev    next >
C/C++ Source or Header  |  2000-12-04  |  7KB  |  363 lines

  1. /* @(#)mconfig.h    1.38 00/12/04 Copyright 1995 J. Schilling */
  2. /*
  3.  *    definitions for machine configuration
  4.  *
  5.  *    Copyright (c) 1995 J. Schilling
  6.  *
  7.  *    This file must be included before any other file.
  8.  *    If this file is not included before stdio.h you will not be
  9.  *    able to get LARGEFILE support
  10.  *
  11.  *    Use only cpp instructions.
  12.  *
  13.  *    NOTE: SING: (Schily Is Not Gnu)
  14.  */
  15. /*
  16.  * This program is free software; you can redistribute it and/or modify
  17.  * it under the terms of the GNU General Public License as published by
  18.  * the Free Software Foundation; either version 2, or (at your option)
  19.  * any later version.
  20.  *
  21.  * This program is distributed in the hope that it will be useful,
  22.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  23.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  24.  * GNU General Public License for more details.
  25.  *
  26.  * You should have received a copy of the GNU General Public License
  27.  * along with this program; see the file COPYING.  If not, write to
  28.  * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
  29.  */
  30.  
  31. #ifndef _MCONFIG_H
  32. #define _MCONFIG_H
  33.  
  34. /*
  35.  * This hack that is needed as long as VMS has no POSIX shell.
  36.  */
  37. #ifdef    VMS
  38. #    define    USE_STATIC_CONF
  39. #endif
  40.  
  41. #ifdef    USE_STATIC_CONF
  42. #include <xmconfig.h>    /* This is the current static autoconf stuff */
  43. #else
  44. #include <xconfig.h>    /* This is the current dynamic autoconf stuff */
  45. #endif
  46.  
  47. #ifdef __cplusplus
  48. extern "C" {
  49. #endif
  50.  
  51. /*
  52.  * The NetBSD people want to bother us.
  53.  * They removed the definition for 'unix' and are bleating for every test
  54.  * for #if defined(unix). So we need to check for NetBSD early.
  55.  */
  56. #ifndef    IS_UNIX
  57. #    if defined(__NetBSD__)
  58. #        define    IS_UNIX
  59. #    endif
  60. #endif
  61.  
  62. #ifndef    IS_UNIX
  63. #    if defined(unix) || defined(__unix) || defined(__unix__)
  64. #        define    IS_UNIX
  65. #    endif
  66. #endif
  67.  
  68. #ifdef    __MSDOS__
  69. #    define    IS_MSDOS
  70. #endif
  71.  
  72. #if defined(tos) || defined(__tos)
  73. #    define    IS_TOS
  74. #endif
  75.  
  76. #ifdef    THINK_C
  77. #    define    IS_MAC
  78. #endif
  79.  
  80. #if defined(sun) || defined(__sun) || defined(__sun__)
  81. #    define    IS_SUN
  82. #endif
  83.  
  84. #if defined(__CYGWIN32__) || defined(__CYGWIN__)
  85. #       define IS_GCC_WIN32
  86. #       define IS_CYGWIN
  87.  
  88. #if    defined(unix) || defined(_X86)
  89. #       define IS_CYGWIN_1
  90. #endif
  91. #endif
  92.  
  93. /*--------------------------------------------------------------------------*/
  94. /*
  95.  * Some magic that cannot (yet) be figured out with autoconf.
  96.  */
  97.  
  98. #if defined(sun3) || defined(mc68000) || defined(mc68020)
  99. #    ifndef    HAVE_SCANSTACK
  100. #    define    HAVE_SCANSTACK
  101. #    endif
  102. #endif
  103. #ifdef sparc
  104. #    ifndef    HAVE_LDSTUB
  105. #    define    HAVE_LDSTUB
  106. #    endif
  107. #    ifndef    HAVE_SCANSTACK
  108. #    define    HAVE_SCANSTACK
  109. #    endif
  110. #endif
  111. #if    defined(__i386_) || defined(i386)
  112. #    ifndef    HAVE_XCHG
  113. #    define    HAVE_XCHG
  114. #    endif
  115. #    ifndef    HAVE_SCANSTACK
  116. #    define    HAVE_SCANSTACK
  117. #    endif
  118. #endif
  119.  
  120. /*
  121.  * Use of SCANSTACK is disabled by default
  122.  */
  123. #ifndef    USE_SCANSTACK
  124. #    undef    HAVE_SCANSTACK
  125. #endif
  126.  
  127. #if    defined(SOL2) || defined(SOL2) || defined(S5R4) || defined(__S5R4) \
  128.                             || defined(SVR4)
  129. #    ifndef    __SVR4
  130. #        define    __SVR4
  131. #    endif
  132. #endif
  133.  
  134. #ifdef    __SVR4
  135. #    ifndef    SVR4
  136. #        define    SVR4
  137. #    endif
  138. #endif
  139.  
  140. /*
  141.  * SunOS 4.x / SunOS 5.x
  142.  */
  143. #if defined(IS_SUN)
  144. #    define    HAVE_GETAV0
  145. #endif
  146.  
  147. /*
  148.  * AIX
  149.  */
  150. #if    defined(_IBMR2) || defined(_AIX)
  151. #    ifndef    IS_UNIX
  152. #    define    IS_UNIX        /* ??? really ??? */
  153. #    endif
  154. #endif
  155.  
  156. /*
  157.  * QNX
  158.  */
  159. #if defined(__QNX__)
  160. #    ifndef    IS_UNIX
  161. #    define    IS_UNIX
  162. #    endif
  163. #endif
  164.  
  165. /*
  166.  * Silicon Graphics    (must be before SVR4)
  167.  */
  168. #if defined(sgi) || defined(__sgi)
  169. #    define    __NOT_SVR4__    /* Not a real SVR4 implementation */
  170. #endif
  171.  
  172. /*
  173.  * Data General
  174.  */
  175. #if defined(__DGUX__)
  176. #ifdef    XXXXXXX
  177. #    undef    HAVE_MTGET_DSREG
  178. #    undef    HAVE_MTGET_RESID
  179. #    undef    HAVE_MTGET_FILENO
  180. #    undef    HAVE_MTGET_BLKNO
  181. #endif
  182. #    define    mt_type        mt_model
  183. #    define    mt_dsreg    mt_status1
  184. #    define    mt_erreg    mt_status2
  185.     /*
  186.      * DGUX hides its flock as dg_flock.
  187.      */
  188. #    define    HAVE_FLOCK
  189. #    define    flock    dg_flock
  190.     /*
  191.      * Use the BSD style wait on DGUX to get the resource usages of child
  192.      * processes.
  193.      */
  194. #    define    _BSD_WAIT_FLAVOR
  195. #endif
  196.  
  197. /*
  198.  * Apple Rhapsody (This is the name for Mac OS X beta)
  199.  */
  200. #if defined(__NeXT__) && defined(__TARGET_OSNAME) && __TARGET_OSNAME == rhapsody
  201. #    define HAVE_OSDEF /* prevent later definitions to overwrite current */
  202. #    ifndef    IS_UNIX
  203. #    define    IS_UNIX
  204. #    endif
  205. #endif
  206.  
  207. /*
  208.  * NextStep
  209.  */
  210. #if defined(__NeXT__) && !defined(HAVE_OSDEF)
  211. #define    NO_PRINT_OVR
  212. #undef    HAVE_USG_STDIO        /*
  213.                  *  NeXT Step 3.x uses __flsbuf(unsigned char , FILE *)
  214.                  * instead of __flsbuf(int, FILE *)
  215.                  */
  216. #    ifndef    IS_UNIX
  217. #    define    IS_UNIX
  218. #    endif
  219. #endif
  220.  
  221. /*
  222.  * Mac OS X
  223.  */
  224. #if defined(__APPLE__) && defined(__MACH__)
  225. #    ifndef    IS_UNIX
  226. #    define    IS_UNIX
  227. #    endif
  228. #    define    IS_MACOS_X
  229. #endif
  230.  
  231. /*
  232.  * NextStep 3.x has a broken linker that does not allow us to override
  233.  * these functions.
  234.  */
  235. #ifndef    __OPRINTF__
  236.  
  237. #ifdef    NO_PRINT_OVR
  238. #    define    printf    Xprintf
  239. #    define    fprintf    Xfprintf
  240. #    define    sprintf    Xsprintf
  241. #endif
  242.  
  243. #endif    /* __OPRINTF__ */
  244.  
  245. /*--------------------------------------------------------------------------*/
  246. /*
  247.  * If there is no flock defined by the system, use emulation
  248.  * through fcntl record locking.
  249.  */
  250. #ifndef HAVE_FLOCK
  251. #define LOCK_SH         1       /* shared lock */
  252. #define LOCK_EX         2       /* exclusive lock */
  253. #define LOCK_NB         4       /* don't block when locking */
  254. #define LOCK_UN         8       /* unlock */
  255. #endif
  256.  
  257. #include <prototyp.h>
  258.  
  259. /*
  260.  * gcc 2.x generally implements the long long type.
  261.  */
  262. #ifdef    __GNUC__
  263. #    if    __GNUC__ > 1
  264. #        ifndef    HAVE_LONGLONG
  265. #            define    HAVE_LONGLONG
  266. #        endif
  267. #    endif
  268. #endif
  269.  
  270. #ifdef    __CHAR_UNSIGNED__    /* GNU GCC define     (dynamic)    */
  271. #ifndef CHAR_IS_UNSIGNED
  272. #define    CHAR_IS_UNSIGNED    /* Sing Schily define (static)    */
  273. #endif
  274. #endif
  275.  
  276. /*
  277.  * Convert to GNU name
  278.  */
  279. #ifdef    HAVE_STDC_HEADERS
  280. #    ifndef    STDC_HEADERS
  281. #        define    STDC_HEADERS
  282. #    endif
  283. #endif
  284. /*
  285.  * Convert to SCHILY name
  286.  */
  287. #ifdef    STDC_HEADERS
  288. #    ifndef    HAVE_STDC_HEADERS
  289. #        define    HAVE_STDC_HEADERS
  290. #    endif
  291. #endif
  292.  
  293. #ifdef    IS_UNIX
  294. #    define    HAVE_PATH_DELIM
  295. #    define    PATH_DELIM    '/'
  296. #    define    PATH_DELIM_STR    "/"
  297. #    define    far
  298. #    define    near
  299. #endif
  300.  
  301. #ifdef    IS_GCC_WIN32
  302. #    define    HAVE_PATH_DELIM
  303. #    define    PATH_DELIM    '/'
  304. #    define    PATH_DELIM_STR    "/"
  305. #    define    far
  306. #    define    near
  307. #endif
  308.  
  309. #ifdef    __EMX__                /* We don't want to call it UNIX */
  310. #    define    HAVE_PATH_DELIM
  311. #    define    PATH_DELIM    '/'
  312. #    define    PATH_DELIM_STR    "/"
  313. #    define    far
  314. #    define    near
  315. #endif
  316.  
  317. #ifdef    __BEOS__            /* We don't want to call it UNIX */
  318. #    define    HAVE_PATH_DELIM
  319. #    define    PATH_DELIM    '/'
  320. #    define    PATH_DELIM_STR    "/"
  321. #    define    far
  322. #    define    near
  323. #endif
  324.  
  325. #ifdef    IS_MSDOS
  326. #    define    HAVE_PATH_DELIM
  327. #    define    PATH_DELIM    '\\'
  328. #    define    PATH_DELIM_STR    "\\"
  329. #endif
  330.  
  331. #ifdef    IS_TOS
  332. #    define    HAVE_PATH_DELIM
  333. #    define    PATH_DELIM    '\\'
  334. #    define    PATH_DELIM_STR    "\\"
  335. #    define    far
  336. #    define    near
  337. #endif
  338.  
  339. #ifdef    IS_MAC
  340. #    define    HAVE_PATH_DELIM
  341. #    define    PATH_DELIM    ':'
  342. #    define    PATH_DELIM_STR    ":"
  343. #    define    far
  344. #    define    near
  345. #endif
  346.  
  347. /*
  348.  * I hope this will make compilation on unknown OS easier.
  349.  */
  350. #ifndef    HAVE_PATH_DELIM            /* Default to POSIX rules */
  351. #    define    HAVE_PATH_DELIM
  352. #    define    PATH_DELIM    '/'
  353. #    define    PATH_DELIM_STR    "/"
  354. #    define    far
  355. #    define    near
  356. #endif
  357.  
  358. #ifdef __cplusplus
  359. }
  360. #endif
  361.  
  362. #endif /* _MCONFIG_H */
  363.