varargs.h 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. /* $OpenBSD: varargs.h,v 1.7 2011/03/23 16:54:37 pirofti Exp $ */
  2. /* $NetBSD: varargs.h,v 1.10 1995/12/29 18:53:02 mycroft Exp $ */
  3. /*
  4. * Copyright (c) 1992, 1993
  5. * The Regents of the University of California. All rights reserved.
  6. * (c) UNIX System Laboratories, Inc.
  7. * All or some portions of this file are derived from material licensed
  8. * to the University of California by American Telephone and Telegraph
  9. * Co. or Unix System Laboratories, Inc. and are reproduced herein with
  10. * the permission of UNIX System Laboratories, Inc.
  11. *
  12. * This software was developed by the Computer Systems Engineering group
  13. * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and
  14. * contributed to Berkeley.
  15. *
  16. * All advertising materials mentioning features or use of this software
  17. * must display the following acknowledgement:
  18. * This product includes software developed by the University of
  19. * California, Lawrence Berkeley Laboratory.
  20. *
  21. * Redistribution and use in source and binary forms, with or without
  22. * modification, are permitted provided that the following conditions
  23. * are met:
  24. * 1. Redistributions of source code must retain the above copyright
  25. * notice, this list of conditions and the following disclaimer.
  26. * 2. Redistributions in binary form must reproduce the above copyright
  27. * notice, this list of conditions and the following disclaimer in the
  28. * documentation and/or other materials provided with the distribution.
  29. * 3. Neither the name of the University nor the names of its contributors
  30. * may be used to endorse or promote products derived from this software
  31. * without specific prior written permission.
  32. *
  33. * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  34. * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  35. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  36. * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  37. * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  38. * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  39. * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  40. * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  41. * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  42. * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  43. * SUCH DAMAGE.
  44. *
  45. * from: @(#)varargs.h 8.3 (Berkeley) 3/22/94
  46. */
  47. #ifndef _MACHINE_VARARGS_H_
  48. #define _MACHINE_VARARGS_H_
  49. #include <machine/stdarg.h>
  50. #if __GNUC__ == 1
  51. #define __va_ellipsis
  52. #else
  53. #define __va_ellipsis ...
  54. #endif
  55. #define va_alist __builtin_va_alist
  56. #define va_dcl long __builtin_va_alist; __va_ellipsis
  57. #undef va_start
  58. #define va_start(ap) \
  59. ((ap) = (va_list)__builtin_saveregs())
  60. #endif /* !_MACHINE_VARARGS_H_ */