Annotation of Gnu-Mach/i386/include/mach/sa/stdarg.h, revision 1.1.1.3

1.1       root        1: /*
                      2:  * Mach Operating System
                      3:  * Copyright (c) 1993 Carnegie Mellon University.
                      4:  * Copyright (c) 1994 The University of Utah and
                      5:  * the Center for Software Science (CSS).
                      6:  * All rights reserved.
                      7:  *
                      8:  * Permission to use, copy, modify and distribute this software and its
                      9:  * documentation is hereby granted, provided that both the copyright
                     10:  * notice and this permission notice appear in all copies of the
                     11:  * software, derivative works or modified versions, and any portions
                     12:  * thereof, and that both notices appear in supporting documentation.
                     13:  *
                     14:  * CARNEGIE MELLON, THE UNIVERSITY OF UTAH AND CSS ALLOW FREE USE OF
                     15:  * THIS SOFTWARE IN ITS "AS IS" CONDITION, AND DISCLAIM ANY LIABILITY
                     16:  * OF ANY KIND FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF
                     17:  * THIS SOFTWARE.
                     18:  *
                     19:  * Carnegie Mellon requests users of this software to return to
                     20:  *
                     21:  *  Software Distribution Coordinator  or  [email protected]
                     22:  *  School of Computer Science
                     23:  *  Carnegie Mellon University
                     24:  *  Pittsburgh PA 15213-3890
                     25:  *
                     26:  * any improvements or extensions that they make and grant Carnegie Mellon
                     27:  * the rights to redistribute these changes.
                     28:  */
                     29: #ifndef _MACH_SA_STDARG_H_
                     30: #define _MACH_SA_STDARG_H_
                     31: 
1.1.1.3 ! root       32: #if __GNUC__ >= 3
        !            33: 
        !            34: typedef __builtin_va_list va_list;
        !            35: 
        !            36: #define va_start(v,l)  __builtin_va_start(v,l)
        !            37: #define va_end(v)      __builtin_va_end(v)
        !            38: #define va_arg(v,l)    __builtin_va_arg(v,l)
        !            39: 
        !            40: #else
        !            41: 
        !            42: #define __va_size(type) ((sizeof(type)+sizeof(unsigned long)-1) & ~(sizeof(unsigned long)-1))
1.1       root       43: 
                     44: #ifndef _VA_LIST_
                     45: #define _VA_LIST_
                     46: typedef        char *va_list;
                     47: #endif
                     48: 
                     49: #define        va_start(pvar, lastarg)                 \
                     50:        ((pvar) = (char*)(void*)&(lastarg) + __va_size(lastarg))
                     51: #define        va_end(pvar)
                     52: #define        va_arg(pvar,type)                       \
                     53:        ((pvar) += __va_size(type),             \
                     54:         *((type *)((pvar) - __va_size(type))))
                     55: 
1.1.1.3 ! root       56: #endif
        !            57: 
1.1.1.2   root       58: #endif /* _MACH_SA_STDARG_H_ */

unix.superglobalmegacorp.com

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