home *** CD-ROM | disk | FTP | other *** search
/ ARM Club 1 / ARM_CLUB_CD.iso / contents / apps / clib / progs / meschach / !Meschach / h / sparse2 < prev    next >
Encoding:
Text File  |  1994-01-13  |  3.1 KB  |  167 lines

  1. red if malloc() etc have
  2.                     been declared) */
  3.  
  4.  
  5. #define ANSI_C 1
  6. #define NOT_SEGMENTED 1
  7. #define STDC_HEADERS 
  8. #define CHAR0ISDBL0 1
  9. /*#define VUNROLL*/
  10.  
  11. /* We don't have fileno() and isatty() in Acorn's compiler -
  12.  * we must make do with nasty hacks - Paul Field
  13.  */
  14.  
  15. #define fileno(f) ((int)(f))
  16.  
  17.  
  18. /* for basic or larger versions */
  19. #define COMPLEX 1
  20. #define SPARSE 1
  21.  
  22. /* for loop unrolling */
  23. /* #undef VUNROLL */
  24. /* #undef MUNROLL */
  25.  
  26. /* for segmented memory */
  27. #ifndef NOT_SEGMENTED
  28. #define    SEGMENTED
  29. #endif
  30.  
  31. /* if the system has malloc.h */
  32. #ifdef HAVE_MALLOC_H
  33. #define    MALLOCDECL    1
  34. #include    <malloc.h>
  35. #endif
  36.  
  37. /* any compiler should have this header */
  38. /* if not, change it */
  39. #include        <stdio.h>
  40.  
  41.  
  42. /* Check for ANSI C memmove and memset */
  43. #ifdef STDC_HEADERS
  44.  
  45. /* standard copy & zero functions */
  46. #define    MEM_COPY(from,to,size)    memmove((to),(from),(size))
  47. #define    MEM_ZERO(where,size)    memset((where),'\0',(size))
  48.  
  49. #ifndef ANSI_C
  50. #define ANSI_C 1
  51. #endif
  52.  
  53. #endif
  54.  
  55. /* standard headers */
  56. #ifdef ANSI_C
  57. #include    <stdlib.h>
  58. #include    <stddef.h>
  59. #include    <string.h>
  60. #include    <float.h>
  61. #endif
  62.  
  63.  
  64. /* if have bcopy & bzero and no alternatives yet known, use them */
  65. #ifdef HAVE_BCOPY
  66. #ifndef MEM_COPY
  67. /* nonstandard copy function */
  68. #define    MEM_COPY(from,to,size)    bcopy((char *)(from),(char *)(to),(int)(size))
  69. #endif
  70. #endif
  71.  
  72. #ifdef HAVE_BZERO
  73. #ifndef MEM_ZERO
  74. /* nonstandard zero function */
  75. #define    MEM_ZERO(where,size)    bzero((char *)(where),(int)(size))
  76. #endif
  77. #endif
  78.  
  79. /* if the system has complex.h */
  80. #ifdef HAVE_COMPLEX_H
  81. #include    <complex.h>
  82. #endif
  83.  
  84. /* If prototypes are available & ANSI_C not yet defined, then define it,
  85.     but don't include any header files as the proper ANSI C headers
  86.         aren't here */
  87. /* #undef HAVE_PROTOTYPES */
  88. #ifdef HAVE_PROTOTYPES
  89. #ifndef ANSI_C
  90. #define ANSI_C  1
  91. #endif
  92. #endif
  93.  
  94. /* floating point precision */
  95.  
  96. /* you can choose single, double or long double (if available) precision */
  97.  
  98. #define FLOAT         1
  99. #define DOUBLE         2
  100. #define LONG_DOUBLE     3
  101.  
  102. /* #undef REAL_FLT */
  103. #define REAL_DBL 1
  104.  
  105. /* if nothing is defined, choose double precision */
  106. #ifndef REAL_DBL
  107. #ifndef REAL_FLT
  108. #define REAL_DBL 1
  109. #endif
  110. #endif
  111.  
  112. /* single precision */
  113. #ifdef REAL_FLT
  114. #define  Real float
  115. #define  LongReal float
  116. #define REAL FLOAT
  117. #define LONGREAL FLOAT
  118. #endif
  119.  
  120. /* double precision */
  121. #ifdef REAL_DBL
  122. #define Real double
  123. #define LongReal double
  124. #define REAL DOUBLE
  125. #define LONGREAL DOUBLE
  126. #endif
  127.  
  128.  
  129. /* machine epsilon or unit roundoff error */
  130. /* This is correct on most IEEE Real precision systems */
  131. #ifdef DBL_EPSILON
  132. #if REAL == DOUBLE
  133. #define    MACHEPS    DBL_EPSILON
  134. #elif REAL == FLOAT
  135. #define    MACHEPS    FLT_EPSILON
  136. #elif REAL == LONGDOUBLE
  137. #define MACHEPS LDBL_EPSILON
  138. #endif
  139. #endif
  140.  
  141. #define F_MACHEPS 1.19209e-07
  142. #define D_MACHEPS 2.22045e-16
  143.  
  144. #ifndef MACHEPS
  145. #if REAL == DOUBLE
  146. #define    MACHEPS    D_MACHEPS
  147. #elif REAL == FLOAT  
  148. #define MACHEPS F_MACHEPS
  149. #elif REAL == LONGDOUBLE
  150. #define MACHEPS D_MACHEPS
  151. #endif
  152. #endif
  153.  
  154. /* #undef M_MACHEPS */
  155.  
  156. /********************
  157. #ifdef DBL_EPSILON
  158. #define    MACHEPS    DBL_EPSILON
  159. #endif
  160. #ifdef M_MACHEPS
  161. #ifndef MACHEPS
  162. #define MACHEPS    M_MACHEPS
  163. #endif
  164. #endif
  165. ********************/
  166.  
  167. #define    M_MAX_IN