Title: | ** Hackers ** |
Moderator: | XDELTA::HOFFMAN |
Created: | Sun Jan 31 1988 |
Last Modified: | Tue May 27 1997 |
Last Successful Update: | Fri Jun 06 1997 |
Number of topics: | 1838 |
Total number of notes: | 13578 |
Has anyone come across a version of the following macro that would work on the alpha - a vax application with C code that we are porting uses this macro all over the place. Is there a "va_count" macro for Alpha ... thanks for any help, John. /* V A R I A B L E A R G U M E N T L I S T M A C R O S */ /* NOTE: THE FOLLOWING MACROS ALL ASSUME THAT AN ARG LIST IS COMPOSED SOLELY * OF LONGWORD ARG ADDRESSES. */ /* ARG_COUNT is an alternative to the va_count macro; given the address of the * first arg in an arg list, it yields the arg count. */ #define ARG_COUNT(alist) (*(((long *) &(alist))-1))
T.R | Title | User | Personal Name | Date | Lines |
---|---|---|---|---|---|
1833.1 | va_count | CSC64::BLAYLOCK | If at first you doubt,doubt again. | Fri Mar 28 1997 19:06 | 11 |
It is in <varargs.h> for DEC C on both VAX and Alpha OpenVMS platforms as well as for the VAXC Compiler. So just '#include <varargs.h>' in your code (and get rid of your definition). btw, the .0 definition is incorrect because the argument count is just a byte, not a longword. The other 24bits are/were 'reserved to Digital software'. | |||||
1833.2 | TURRIS::DECC For C Questions... | XDELTA::HOFFMAN | Steve, OpenVMS Engineering | Mon Mar 31 1997 13:32 | 7 |
: Is there a "va_count" macro for Alpha ... TURRIS::DECC is a better spot for standard C questions -- the variable argument list information is definitely documented in the DEC C manuals. (Standard variable-length argument list processing uses the stdarg.h module, not <varargs.h>. The "va_count" extension is not portable.) |