home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 1997 January
/
Chip_1997-01_cd.bin
/
ms95
/
disk22
/
dir08
/
f012820.re_
/
f012820.re
Wrap
Text File
|
1996-04-02
|
3KB
|
85 lines
/*----------------------------------------------------------------------+
| |
| Copyright (1992) Bentley Systems, Inc., All rights reserved. |
| |
| "MicroStation", "MDL", and "MicroCSL" are trademarks of Bentley |
| Systems, Inc. |
| |
| Limited permission is hereby granted to reproduce and modify this |
| copyrighted material provided that the resulting code is used only |
| in conjunction with Bentley Systems products under the terms of the |
| license agreement provided therein, and that this notice is retained |
| in its entirety in any such reproduction or modification. |
| |
+----------------------------------------------------------------------*/
/*----------------------------------------------------------------------+
| |
| Current Revision: |
| $Workfile: stdarg.h $
| $Revision: 6.5 $ $Date: 11 May 1995 12:46:12 $
| |
+----------------------------------------------------------------------*/
/*----------------------------------------------------------------------+
| |
| stdarg.h -- MDL variable argument macros |
| |
+----------------------------------------------------------------------*/
#if !defined (mdl)
#error This file is intended only for MDL.
#endif
#if !defined (__stdargH__)
#define __stdargH__
#if !defined (__VA_LIST_T)
# define __VA_LIST_T
typedef char *__va_list;
#endif
#if !defined (__MAIN_VA_LIST_T)
# define __MAIN_VA_LIST_T
typedef __va_list va_list;
#endif
#if !defined (_max)
#define _max(a,b) ((a)>(b)?(a):(b))
#endif /* !defined (_max) */
#define __PROMOTE(basesize) \
_max(sizeof(int), ((basesize)+sizeof(int)-1)/sizeof(int)*sizeof(int) )
#define va_start(ap,arg) (ap=(char *)&arg+sizeof(arg))
#if defined (hp700) || defined (clipper) || defined (_ALPHA_) || defined (sgimips) || \
defined (_PPC_) || defined (_MIPS_)
#define va_arg(pvar,type) \
(\
*(type *) \
(\
(\
pvar += \
(\
__PROMOTE(sizeof(type)) + \
(\
((sizeof (type) == sizeof (double)) && \
((long)pvar & 4)) ? sizeof (int) : 0\
)\
)\
) \
- __PROMOTE(sizeof(type))\
) \
)
#elif defined (pm386) || defined (sparc) || defined (macintosh) || \
defined (_X86_) || defined (rs6000) || defined(SolarisX86) || \
defined (os2x86)
#define va_arg(pvar,type) ( \
*(type *) ((pvar += __PROMOTE(sizeof(type)) ) - __PROMOTE(sizeof(type))) )
#else
#error the va_arg macro is not defined for this platform
#endif
#define va_end(pvar)
#endif