home *** CD-ROM | disk | FTP | other *** search
/ PC Extra Super CD 1998 January / PCPLUS131.iso / DJGPP / V2 / DJDEV201.ZIP / include / stdarg.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-07-25  |  1.1 KB  |  49 lines

  1. /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
  2. #ifndef __dj_include_stdarg_h_
  3. #define __dj_include_stdarg_h_
  4.  
  5. #ifdef __cplusplus
  6. extern "C" {
  7. #endif
  8.  
  9. #ifndef __dj_ENFORCE_ANSI_FREESTANDING
  10.  
  11. #ifdef __dj_include_varargs_h_
  12. #error stdarg.h and varargs.h are mutually exclusive
  13. #endif
  14.  
  15. #include <sys/djtypes.h>
  16.  
  17. __DJ_va_list
  18. #undef __DJ_va_list
  19. #define __DJ_va_list
  20.   
  21. #define __dj_va_rounded_size(T)  \
  22.   (((sizeof (T) + sizeof (int) - 1) / sizeof (int)) * sizeof (int))
  23.  
  24. #define va_arg(ap, T) \
  25.     (ap = (va_list) ((char *) (ap) + __dj_va_rounded_size (T)),    \
  26.      *((T *) (void *) ((char *) (ap) - __dj_va_rounded_size (T))))
  27.  
  28. #define va_end(ap)
  29.  
  30. #define va_start(ap, last_arg) \
  31.  (ap = ((va_list) __builtin_next_arg (last_arg)))
  32.   
  33. #ifndef __STRICT_ANSI__
  34.  
  35. #ifndef _POSIX_SOURCE
  36.  
  37. #endif /* !_POSIX_SOURCE */
  38. #endif /* !__STRICT_ANSI__ */
  39. #endif /* !__dj_ENFORCE_ANSI_FREESTANDING */
  40.  
  41. #ifndef __dj_ENFORCE_FUNCTION_CALLS
  42. #endif /* !__dj_ENFORCE_FUNCTION_CALLS */
  43.  
  44. #ifdef __cplusplus
  45. }
  46. #endif
  47.  
  48. #endif /* !__dj_include_stdarg_h_ */
  49.