home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / gnu / gcc / help / 2465 < prev    next >
Encoding:
Text File  |  1992-11-07  |  4.1 KB  |  172 lines

  1. Newsgroups: gnu.gcc.help
  2. Path: sparky!uunet!stanford.edu!agate!spool.mu.edu!uwm.edu!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!gnu.ai.mit.edu!rms
  3. From: rms@gnu.ai.mit.edu (Richard Stallman)
  4. Subject: GCC 2.3.1 and NET 2 systems
  5. Message-ID: <9211060900.AA09255@mole.gnu.ai.mit.edu>
  6. Sender: daemon@cis.ohio-state.edu
  7. Organization: GNUs Not Usenet
  8. Distribution: gnu
  9. Date: Thu, 5 Nov 1992 23:00:39 GMT
  10. Lines: 160
  11.  
  12. Is anyone using GCC 2.3.1 and getting *correct* behavior
  13. on a 386BSD system or other NET 2 system?
  14.  
  15. I was sent a description of how those systems try to work,
  16. and thought I had fixed 2.3 to work with them.
  17. Now I'm told that NET 2 does not use _VA_LIST_ the way the
  18. comments in ansi.h say it should be used, and that this
  19. version of gvarargs.h should be used instead.
  20.  
  21. IF you get this message before noon on Friday Nov 7,
  22. or if you are a real expert on NET 2 systems,
  23. please tell me whether 2.3.1 works for you, and whether
  24. this modified gvarargs.h works for you.
  25.  
  26.  
  27. #ifndef __GNUC__
  28. /* Use the system's macros with the system's compiler.  */
  29. #include <varargs.h>
  30. #else
  31. /* Record that this is varargs.h; this turns off stdarg.h.  */
  32.  
  33. #ifndef _VARARGS_H
  34. #define _VARARGS_H
  35.  
  36. #ifdef __sparc__
  37. #include <va-sparc.h>
  38. #else
  39. #ifdef __spur__
  40. #include <va-spur.h>
  41. #else
  42. #ifdef __mips__
  43. #include <va-mips.h>
  44. #else
  45. #ifdef __i860__
  46. #include <va-i860.h>
  47. #else
  48. #ifdef __pyr__
  49. #include <va-pyr.h>
  50. #else
  51. #ifdef __m88k__
  52. #include <va-m88k.h>
  53. #else
  54. #if defined(__hppa__) || defined(hp800)
  55. #include <va-pa.h>
  56. #else
  57. #ifdef __i960__
  58. #include <va-i960.h>
  59. #else
  60. #ifdef __alpha__
  61. #include <va-alpha.h>
  62. #else
  63.  
  64. #ifdef __NeXT__
  65.  
  66. /* On Next, erase any vestiges of stdarg.h.  */
  67.  
  68. #ifdef _ANSI_STDARG_H_
  69. #define _VA_LIST_
  70. #endif
  71. #define _ANSI_STDARG_H_ 
  72.  
  73. #undef va_alist
  74. #undef va_dcl
  75. #undef va_list
  76. #undef va_start
  77. #undef va_end
  78. #undef __va_rounded_size
  79. #undef va_arg
  80. #endif  /* __NeXT__ */
  81.  
  82. /* In GCC version 2, we want an ellipsis at the end of the declaration
  83.    of the argument list.  GCC version 1 can't parse it.  */
  84.  
  85. #if __GNUC__ > 1
  86. #define __va_ellipsis ...
  87. #else
  88. #define __va_ellipsis
  89. #endif
  90.  
  91. /* These macros implement traditional (non-ANSI) varargs
  92.    for GNU C.  */
  93.  
  94. #define va_alist  __builtin_va_alist
  95. /* The ... causes current_function_varargs to be set in cc1.  */
  96. #define va_dcl    int __builtin_va_alist; __va_ellipsis
  97.  
  98. /* Define __gnuc_va_list, just as in gstdarg.h.  */
  99.  
  100. #ifndef __GNUC_VA_LIST
  101. #define __GNUC_VA_LIST
  102. #if defined(__svr4__) || defined(_AIX) || defined(_M_UNIX)
  103. typedef char *__gnuc_va_list;
  104. #else
  105. typedef void *__gnuc_va_list;
  106. #endif
  107. #endif
  108.  
  109. #define va_start(AP)  AP=(char *) &__builtin_va_alist
  110.  
  111. #define va_end(AP)
  112.  
  113. #define __va_rounded_size(TYPE)  \
  114.   (((sizeof (TYPE) + sizeof (int) - 1) / sizeof (int)) * sizeof (int))
  115.  
  116. #define va_arg(AP, TYPE)                        \
  117.  (AP += __va_rounded_size (TYPE),                    \
  118.   *((TYPE *) (AP - __va_rounded_size (TYPE))))
  119.  
  120. #endif /* not alpha */
  121. #endif /* not i960 */
  122. #endif /* not hppa */
  123. #endif /* not m88k */
  124. #endif /* not pyr */
  125. #endif /* not i860 */
  126. #endif /* not mips */
  127. #endif /* not spur */
  128. #endif /* not sparc */
  129. #endif /* not _VARARGS_H */
  130.  
  131. /* Define va_list from __gnuc_va_list.  */
  132.  
  133. #ifdef _HIDDEN_VA_LIST  /* On OSF1, this means varargs.h is "half-loaded".  */
  134. #undef _VA_LIST
  135. #endif
  136.  
  137. #ifdef __SVR4_2__
  138.  
  139. /* SVR4.2 uses _VA_LIST for an internal alias for va_list,
  140.    so we must avoid testing it and setting it here.  */
  141. #ifndef _VA_LIST_
  142. #define _VA_LIST_
  143. typedef __gnuc_va_list va_list;
  144. #endif /* _VA_LIST_ */
  145.  
  146. #else /* not __SVR4_2__ */
  147.  
  148. /* The macro _VA_LIST_ is the same thing used by this file in Ultrix.
  149.    But on BSD NET2 we must not test or define or undef it.
  150.    (Note that the comments in NET 2's ansi.h
  151.    are incorrect for _VA_LIST_--see stdio.h!)  */
  152. #if !defined (_VA_LIST_) || defined (__BSD_NET2__) || defined (____386BSD____)
  153. /* The macro _VA_LIST is used in SCO Unix 3.2.  */
  154. #ifndef _VA_LIST
  155. #if !(defined (__BSD_NET2__) || defined (____386BSD____))
  156. #define _VA_LIST_
  157. #endif
  158. #define _VA_LIST
  159. typedef __gnuc_va_list va_list;
  160. #endif /* not _VA_LIST */
  161. #endif /* not _VA_LIST_ */
  162.  
  163. #endif /* not __SVR4_2__ */
  164.  
  165. /* The next BSD release (if there is one) wants this symbol to be
  166.    undefined instead of _VA_LIST_.  */
  167. #ifdef _BSD_VA_LIST
  168. #undef _BSD_VA_LIST
  169. #endif
  170.  
  171. #endif /* __GNUC__ */
  172.