machine.h 4.7 KB

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