home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Professional Developers Kit 1992 November / Disc01 / Disc01.mdf / cppbeta / incla / stdarg.h__ / STDARG.H
Encoding:
C/C++ Source or Header  |  1992-09-27  |  1.8 KB  |  53 lines

  1. #ifndef __stdarg_h
  2.    #define __stdarg_h
  3.  
  4.    #pragma info( none )
  5.    #ifndef __CHKHDR__
  6.       #pragma info( none )
  7.    #endif
  8.    #pragma info( restore )
  9.  
  10.    #ifdef __cplusplus
  11.       extern "C" {
  12.    #endif
  13.  
  14.    /********************************************************************/
  15.    /*  <stdarg.h> header file                                          */
  16.    /*                                                                  */
  17.    /*  Licensed Materials - Property of IBM                            */
  18.    /*                                                                  */
  19.    /*  IBM C Set/2 Beta Version                                        */
  20.    /*  Copyright (C) International Business Machines Corp., 1991,1992  */
  21.    /*  All rights reserved                                             */
  22.    /*                                                                  */
  23.    /*  US Government Users Restricted Rights -                         */
  24.    /*  Use, duplication, or disclosure restricted                      */
  25.    /*  by GSA ADP Schedule Contract with IBM Corp.                     */
  26.    /*                                                                  */
  27.    /********************************************************************/
  28.  
  29.    typedef char *va_list;
  30.  
  31.    #define __nextword(base)   (((unsigned)(sizeof(base))+3U)&~(3U))
  32.  
  33.    #define va_start(ap, last) ap = ((va_list)&last) + __nextword(last)
  34.    #define va_arg(ap, type)   ((type *) ((ap += (int) __nextword(type)) - __nextword(type)))[0]
  35.    #ifdef __cplusplus
  36.      #define va_end(ap)         ap = 0
  37.    #else
  38.      #define va_end(ap)         ap = (void *) 0
  39.    #endif
  40.  
  41.  
  42.    #ifdef __cplusplus
  43.       }
  44.    #endif
  45.  
  46.    #pragma info( none )
  47.    #ifndef __CHKHDR__
  48.       #pragma info( restore )
  49.    #endif
  50.    #pragma info( restore )
  51.  
  52. #endif
  53.