Subversion Repositories tendra.SVN

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
2 7u83 1
/*
2
    		 Crown Copyright (c) 1997
3
 
4
    This TenDRA(r) Computer Program is subject to Copyright
5
    owned by the United Kingdom Secretary of State for Defence
6
    acting through the Defence Evaluation and Research Agency
7
    (DERA).  It is made available to Recipients with a
8
    royalty-free licence for its use, reproduction, transfer
9
    to other parties and amendment for any purpose not excluding
10
    product development provided that any such use et cetera
11
    shall be deemed to be acceptance of the following conditions:-
12
 
13
        (1) Its Recipients shall ensure that this Notice is
14
        reproduced upon any copies or amended versions of it;
15
 
16
        (2) Any amended version of it shall be clearly marked to
17
        show both the nature of and the organisation responsible
18
        for the relevant amendment or amendments;
19
 
20
        (3) Its onward transfer from a recipient to another
21
        party shall be deemed to be that party's acceptance of
22
        these conditions;
23
 
24
        (4) DERA gives no warranty or assurance as to its
25
        quality or suitability for any purpose and DERA accepts
26
        no liability whatsoever in relation to any use to which
27
        it may be put.
28
*/
29
 
30
#ifndef _H_STDARG
31
#define _H_STDARG
32
 
33
 
34
#ifndef _H_STANDARDS
35
#include <standards.h>
36
#endif
37
 
38
#include <va_list.h>
39
 
40
 
41
#ifndef __BUILDING_TDF_ANSI_STDARG_H_VA_ARGS
42
 
43
 
44
/*
45
    DEFINITION OF VA_LIST
46
 
47
    The definition of va_list is copied from the system header.
48
*/
49
 
50
#ifndef _VA_LIST
51
#define _VA_LIST
52
typedef void *va_list ;
53
#endif
54
 
55
 
56
/*
57
    TOKEN DECLARATIONS
58
 
59
    The tokens __va_t, __va_start, va_arg and va_end are as in the
60
    ansi:stdarg header.  The only difference is that va_list is defined
61
    as its implementation type, rather than being a tokenised type.
62
*/
63
 
64
#pragma token TYPE __va_t # ~__va_t
65
#pragma token PROC ( EXP rvalue : __va_t : ) EXP rvalue : va_list : __va_start # ansi.stdarg.__va_start
66
#pragma token PROC ( EXP lvalue : va_list : e , TYPE t ) EXP rvalue : t : va_arg # ansi.stdarg.va_arg
67
#pragma token PROC ( EXP lvalue : va_list : ) EXP rvalue : void : va_end # ansi.stdarg.va_end
68
#pragma interface __va_t __va_start va_arg va_end
69
 
70
 
71
/*
72
    DEFINITION OF VA_START
73
 
74
    How va_start is defined in terms of __va_start depends on whether
75
    this is stdarg.h or varargs.h.
76
*/
77
 
78
#pragma TenDRA ident ... allow
79
 
80
#ifdef __HACKED_VARARGS
81
#define va_alist		...
82
#define va_dcl
83
#define va_start( l )		( ( void ) ( l = __va_start ( ... ) ) )
84
#else
85
#define va_start( l, i )	( ( void ) ( l = __va_start ( ... ) ) )
86
#endif
87
 
88
 
89
#else /* __BUILDING_TDF_ANSI_STDARG_H_VA_ARGS */
90
 
91
 
92
/*
93
    IMPLEMENTATION OF STDARG
94
 
95
    This implementation basically works, and avoids the built-in
96
    operators defined in the system header.
97
*/
98
 
99
#define va_start(__list,__parmN) __list = (char *)((unsigned int)&(__parmN) + (((sizeof(__parmN)+3)/4)*4))
100
#define va_end(__list) (__list)=(char *)0
101
#define va_arg(__list, __mode) ((__mode *)( (((__list)+=(((sizeof(__mode)+3)/4)*4))-sizeof(__mode)) ))[0]
102
 
103
#endif /* __BUILDING_TDF_ANSI_STDARG_H_VA_ARGS */
104
 
105
 
106
#endif /* _STDARG_H */