Annotation of mstools/h/varargs.h, revision 1.1.1.3

1.1       root        1: /***
                      2: *varargs.h - XENIX style macros for variable argument functions
                      3: *
                      4: *      Copyright (c) 1985-1990, Microsoft Corporation. All rights reserved.
                      5: *
                      6: *Purpose:
                      7: *      This file defines XENIX style macros for accessing arguments of a
                      8: *      function which takes a variable number of arguments.
                      9: *      [System V]
                     10: *
                     11: ****/
                     12: 
                     13: #ifndef _INC_VARARGS
                     14: 
                     15: #ifdef __cplusplus
                     16: extern "C" {
                     17: #endif
                     18: 
                     19: #ifdef __STDC__
                     20: #error varargs.h incompatible with ANSI (use stdarg.h)
                     21: #endif
                     22: 
                     23: #ifndef _VA_LIST_DEFINED
                     24: typedef char *va_list;
                     25: #define _VA_LIST_DEFINED
                     26: #endif
                     27: 
1.1.1.2   root       28: 
                     29: 
1.1.1.3 ! root       30: #ifdef _X86_
1.1       root       31: /*
                     32:  * define a macro to compute the size of a type, variable or expression,
                     33:  * rounded up to the nearest multiple of sizeof(int). This number is its
                     34:  * size as function argument (Intel architecture). Note that the macro
                     35:  * depends on sizeof(int) being a power of 2!
                     36:  */
                     37: 
                     38: #define _INTSIZEOF(n)   ( (sizeof(n) + sizeof(int) - 1) & ~(sizeof(int) - 1) )
                     39: 
                     40: #define va_dcl va_list va_alist;
                     41: #define va_start(ap) ap = (va_list)&va_alist
1.1.1.2   root       42: #define va_arg(ap,t)    ( *(t *)((ap += _INTSIZEOF(t)) - _INTSIZEOF(t)) )
1.1       root       43: #define va_end(ap) ap = (va_list)0
1.1.1.2   root       44: #endif
                     45: 
                     46: 
1.1.1.3 ! root       47: #if defined(_M_MRX000)
1.1.1.2   root       48: #define va_dcl int va_alist;
                     49: #define va_start(list) list = (char *) &va_alist
                     50: #define va_end(list)
                     51: #define va_arg(list, mode) ((mode *)(list =\
                     52:  (char *) ((((int)list + (__builtin_alignof(mode)<=4?3:7)) &\
                     53:  (__builtin_alignof(mode)<=4?-4:-8))+sizeof(mode))))[-1]
                     54: /*  +++++++++++++++++++++++++++++++++++++++++++
                     55:     Because of parameter passing conventions in C:
                     56:     use mode=int for char, and short types
                     57:     use mode=double for float types
                     58:     use a pointer for array types
                     59:     +++++++++++++++++++++++++++++++++++++++++++ */
                     60: #endif
                     61: 
1.1       root       62: 
                     63: #ifdef __cplusplus
                     64: }
                     65: #endif
                     66: 
                     67: #define _INC_VARARGS
                     68: #endif /* _INC_VARARGS */

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.