machine.h 5.2 KB

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