_falvarargs.h 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. /*
  2. * CDE - Common Desktop Environment
  3. *
  4. * Copyright (c) 1993-2012, The Open Group. All rights reserved.
  5. *
  6. * These libraries and programs are free software; you can
  7. * redistribute them and/or modify them under the terms of the GNU
  8. * Lesser General Public License as published by the Free Software
  9. * Foundation; either version 2 of the License, or (at your option)
  10. * any later version.
  11. *
  12. * These libraries and programs are distributed in the hope that
  13. * they will be useful, but WITHOUT ANY WARRANTY; without even the
  14. * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
  15. * PURPOSE. See the GNU Lesser General Public License for more
  16. * details.
  17. *
  18. * You should have received a copy of the GNU Lesser General Public
  19. * License along with these libraries and programs; if not, write
  20. * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
  21. * Floor, Boston, MA 02110-1301 USA
  22. */
  23. /* Xvarargs.h 1.1 - Fujitsu source for CDEnext 95/11/06 20:32:13 */
  24. /* $XConsortium: _falvarargs.h /main/1 1996/04/08 15:22:42 cde-fuj $ */
  25. /*
  26. Copyright (c) 1985, 1986, 1987, 1988, 1989 X Consortium
  27. Permission is hereby granted, free of charge, to any person obtaining
  28. a copy of this software and associated documentation files (the
  29. "Software"), to deal in the Software without restriction, including
  30. without limitation the rights to use, copy, modify, merge, publish,
  31. distribute, sublicense, and/or sell copies of the Software, and to
  32. permit persons to whom the Software is furnished to do so, subject to
  33. the following conditions:
  34. The above copyright notice and this permission notice shall be included
  35. in all copies or substantial portions of the Software.
  36. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  37. OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  38. MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
  39. IN NO EVENT SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR
  40. OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
  41. ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
  42. OTHER DEALINGS IN THE SOFTWARE.
  43. Except as contained in this notice, the name of the X Consortium shall
  44. not be used in advertising or otherwise to promote the sale, use or
  45. other dealings in this Software without prior written authorization
  46. from the X Consortium.
  47. */
  48. #ifndef _XVARARGS_H_
  49. #define _XVARARGS_H_
  50. #ifdef __HIGHC__
  51. #ifndef _STDARG_H
  52. #define _STDARG_H
  53. typedef char *va_list;
  54. /* Amount of space required in an argument list for an arg of type TYPE.
  55. TYPE may alternatively be an expression whose type is used. */
  56. #define __va_rounded_size(TYPE) \
  57. (((sizeof (TYPE) + sizeof (int) - 1) / sizeof (int)) * sizeof (int))
  58. #define va_start(AP, LASTARG) \
  59. (AP = ((char *) &(LASTARG) + __va_rounded_size (LASTARG)))
  60. #define va_end(AP)
  61. #define va_arg(AP, TYPE) \
  62. (AP += __va_rounded_size (TYPE), \
  63. *((TYPE *) (AP - __va_rounded_size (TYPE))))
  64. #endif /* _STDARG_H */
  65. #define Va_start(a,b) va_start(a,b)
  66. #else /* !__HIGHC__ */
  67. # include <stdarg.h>
  68. # define Va_start(a,b) va_start(a,b)
  69. #endif /* __HIGHC__ */
  70. #endif /* _XVARARGS_H_ */