home *** CD-ROM | disk | FTP | other *** search
/ RISCWORLD 7 / RISCWORLD_VOL7.iso / Software / Issue6 / SDL.ZIP / !gcc / include / unixlib / h / stdarg < prev    next >
Encoding:
Text File  |  2006-09-17  |  1.3 KB  |  50 lines

  1. /****************************************************************************
  2.  *
  3.  * $Source: /usr/local/cvsroot/gccsdk/unixlib/source/clib/stdarg.h,v $
  4.  * $Date: 2002/09/24 21:02:36 $
  5.  * $Revision: 1.4 $
  6.  * $State: Exp $
  7.  * $Author: admin $
  8.  *
  9.  ***************************************************************************/
  10.  
  11. #ifdef __GNUC__
  12. /* If we're GCC, then we really don't want to be using this file.
  13.    Luckily this only occurs when building the SDK.  */
  14. #include_next <stdarg.h>
  15.  
  16. #else /* ! __GNUC__ */
  17.  
  18. #ifndef __STDARG_H
  19. #ifndef __need___va_list
  20. #define __STDARG_H
  21. #endif
  22. #undef __need___va_list
  23.  
  24. #ifndef __GNUC_VA_LIST
  25. #define __GNUC_VA_LIST
  26. typedef char * __gnuc_va_list;
  27. #endif
  28.  
  29. #ifdef __STDARG_H
  30.  
  31. #define va_align(x)    (((x) + (sizeof(int) - 1)) & (~(sizeof(int) - 1)))
  32.  
  33. #define va_start(a,p)    ((void)((a) = ((char *)(&(p)) + va_align(sizeof(p)))))
  34. #define va_arg(a,t)    ((sizeof(t) > sizeof(int)) ? \
  35.     *(t *)(void *)(((a) += va_align(sizeof(t))) - va_align(sizeof(t))) : \
  36.     (t)(*(int *)(void *)(((a) += sizeof(int)) - sizeof(int))))
  37. #define va_end(a)    ((void)((a) = (char *)-1))
  38. #define va_copy(dest, src) (dest) = (src)
  39.  
  40. #endif /* __STDARG_H */
  41.  
  42. #ifndef _VA_LIST_
  43. typedef __gnuc_va_list va_list;
  44. #define _VA_LIST_
  45. #endif /* __va_list__ */
  46.  
  47. #endif /* _VA_LIST_ */
  48.  
  49. #endif /* __GNUC__ */
  50.