home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 22 gnu / 22-gnu.zip / mesch12a.zip / machine.h.in < prev    next >
Text File  |  1994-01-14  |  4KB  |  193 lines

  1. /* Any machine specific stuff goes here */
  2. /* Add details necessary for your own installation here! */
  3.  
  4. /* This is for use with "configure" -- if you are not using configure
  5.     then use machine.van for the "vanilla" version of machine.h */
  6.  
  7. /* Note special macros: ANSI_C (ANSI C syntax)
  8.             SEGMENTED (segmented memory machine e.g. MS-DOS)
  9.             MALLOCDECL (declared if malloc() etc have
  10.                     been declared) */
  11.  
  12. #undef const
  13.  
  14. #undef MALLOCDECL
  15. #undef NOT_SEGMENTED
  16. #undef HAVE_COMPLEX_H
  17. #undef HAVE_MALLOC_H
  18. #undef STDC_HEADERS
  19. #undef HAVE_BCOPY
  20. #undef HAVE_BZERO
  21. #undef CHAR0ISDBL0
  22. #undef WORDS_BIGENDIAN
  23. #undef U_INT_DEF
  24. #undef VARARGS
  25.  
  26.  
  27. /* for basic or larger versions */
  28. #undef COMPLEX
  29. #undef SPARSE
  30.  
  31. /* for loop unrolling */
  32. #undef VUNROLL
  33. #undef MUNROLL
  34.  
  35. /* for segmented memory */
  36. #ifndef NOT_SEGMENTED
  37. #define    SEGMENTED
  38. #endif
  39.  
  40. /* if the system has malloc.h */
  41. #ifdef HAVE_MALLOC_H
  42. #define    MALLOCDECL    1
  43. #include    <malloc.h>
  44. #endif
  45.  
  46. /* any compiler should have this header */
  47. /* if not, change it */
  48. #include        <stdio.h>
  49.  
  50.  
  51. /* Check for ANSI C memmove and memset */
  52. #ifdef STDC_HEADERS
  53.  
  54. /* standard copy & zero functions */
  55. #define    MEM_COPY(from,to,size)    memmove((to),(from),(size))
  56. #define    MEM_ZERO(where,size)    memset((where),'\0',(size))
  57.  
  58. #ifndef ANSI_C
  59. #define ANSI_C 1
  60. #endif
  61.  
  62. #endif
  63.  
  64. /* standard headers */
  65. #ifdef ANSI_C
  66. #include    <stdlib.h>
  67. #include    <stddef.h>
  68. #include    <string.h>
  69. #include    <float.h>
  70. #endif
  71.  
  72.  
  73. /* if have bcopy & bzero and no alternatives yet known, use them */
  74. #ifdef HAVE_BCOPY
  75. #ifndef MEM_COPY
  76. /* nonstandard copy function */
  77. #define    MEM_COPY(from,to,size)    bcopy((char *)(from),(char *)(to),(int)(size))
  78. #endif
  79. #endif
  80.  
  81. #ifdef HAVE_BZERO
  82. #ifndef MEM_ZERO
  83. /* nonstandard zero function */
  84. #define    MEM_ZERO(where,size)    bzero((char *)(where),(int)(size))
  85. #endif
  86. #endif
  87.  
  88. /* if the system has complex.h */
  89. #ifdef HAVE_COMPLEX_H
  90. #include    <complex.h>
  91. #endif
  92.  
  93. /* If prototypes are available & ANSI_C not yet defined, then define it,
  94.     but don't include any header files as the proper ANSI C headers
  95.         aren't here */
  96. #undef HAVE_PROTOTYPES
  97. #ifdef HAVE_PROTOTYPES
  98. #ifndef ANSI_C
  99. #define ANSI_C  1
  100. #endif
  101. #endif
  102.  
  103. /* floating point precision */
  104.  
  105. /* you can choose single, double or long double (if available) precision */
  106.  
  107. #define FLOAT         1
  108. #define DOUBLE         2
  109. #define LONG_DOUBLE     3
  110.  
  111. #undef REAL_FLT
  112. #undef REAL_DBL
  113.  
  114. /* if nothing is defined, choose double precision */
  115. #ifndef REAL_DBL
  116. #ifndef REAL_FLT
  117. #define REAL_DBL 1
  118. #endif
  119. #endif
  120.  
  121. /* single precision */
  122. #ifdef REAL_FLT
  123. #define  Real float
  124. #define  LongReal float
  125. #define REAL FLOAT
  126. #define LONGREAL FLOAT
  127. #endif
  128.  
  129. /* double precision */
  130. #ifdef REAL_DBL
  131. #define Real double
  132. #define LongReal double
  133. #define REAL DOUBLE
  134. #define LONGREAL DOUBLE
  135. #endif
  136.  
  137.  
  138. /* machine epsilon or unit roundoff error */
  139. /* This is correct on most IEEE Real precision systems */
  140. #ifdef DBL_EPSILON
  141. #if REAL == DOUBLE
  142. #define    MACHEPS    DBL_EPSILON
  143. #elif REAL == FLOAT
  144. #define    MACHEPS    FLT_EPSILON
  145. #elif REAL == LONGDOUBLE
  146. #define MACHEPS LDBL_EPSILON
  147. #endif
  148. #endif
  149.  
  150. #undef F_MACHEPS
  151. #undef D_MACHEPS
  152.  
  153. #ifndef MACHEPS
  154. #if REAL == DOUBLE
  155. #define    MACHEPS    D_MACHEPS
  156. #elif REAL == FLOAT  
  157. #define MACHEPS F_MACHEPS
  158. #elif REAL == LONGDOUBLE
  159. #define MACHEPS D_MACHEPS
  160. #endif
  161. #endif
  162.  
  163. #undef M_MACHEPS
  164.  
  165. /********************
  166. #ifdef DBL_EPSILON
  167. #define    MACHEPS    DBL_EPSILON
  168. #endif
  169. #ifdef M_MACHEPS
  170. #ifndef MACHEPS
  171. #define MACHEPS    M_MACHEPS
  172. #endif
  173. #endif
  174. ********************/
  175.  
  176. #undef    M_MAX_INT
  177. #ifdef    M_MAX_INT
  178. #ifndef MAX_RAND
  179. #define    MAX_RAND ((double)(M_MAX_INT))
  180. #endif
  181. #endif
  182.  
  183. /* for non-ANSI systems */
  184. #ifndef HUGE_VAL
  185. #define HUGE_VAL HUGE
  186. #endif
  187.  
  188.  
  189. #ifdef ANSI_C
  190. extern    int    isatty(int);
  191. #endif
  192.  
  193.