This is p-stdarg.h in view mode; [Download] [Up]
/*+++* * RCS $Id: p-stdarg.h,v 1.2 1993/02/02 21:00:42 gerben Exp $ * title: p-stdarg.h * abstract: portable ANSI C <stdarg.h>. * author: T.R.Hageman, Groningen, The Netherlands * created: October 1992 * modified: (see RCS Log at end) * copyleft: * * Copyright (C) 1992 Tom R. Hageman. * * This is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this software; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * * description: * * Notes: * - some very old systems do not even have <varargs.h>. Tough luck. * Try to hack it together yourself. It usually looks something like: * * #ifndef va_start * typedef char * va_list; * #define va_dcl int va_alist; * #define va_start(ap) (ap = (va_list *) &va_alist) * #define va_end(ap) * #define _va_sizeof(type) (((sizeof(type) + sizeof(int) - 1) / \ * sizeof(type)) * sizeof(type)) * #define va_arg(ap,type) (*(type *)((ap += _va_sizeof(type)) - \ * _va_sizeof(type))) * #endif // va_start * * This example is for systems with a downward-growing stack, and * function parameters pushed right-to-left on the stack. For systems * with upward-growing stack, it would be something like: * * #define va_arg(ap,type) (*(type *)((ap -= _va_sizeof(type)) + \ * _va_sizeof(type))) * *---*/ #ifndef _P_STDARG_H_ #define _P_STDARG_H_ 0x100 #ifndef _PORTDEFS_H_ # include "portdefs.h" #endif #if _STDARG_ # include <stdarg.h> #else # include <varargs.h> #endif /* (other <stdarg.h> vs. <varargs.h> issues are resolved in "portansi.h") */ #endif /* _P_STDARG_H_ */ /*======================================================================* * $Log: p-stdarg.h,v $ * Revision 1.2 1993/02/02 21:00:42 gerben * *** empty log message *** * * Revision 1.1 1992/10/14 13:53:24 tom * Initial revision * *======================================================================*/
These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.