2 |
7u83 |
1 |
# Crown Copyright (c) 1997
|
|
|
2 |
#
|
|
|
3 |
# This TenDRA(r) Computer Program is subject to Copyright
|
|
|
4 |
# owned by the United Kingdom Secretary of State for Defence
|
|
|
5 |
# acting through the Defence Evaluation and Research Agency
|
|
|
6 |
# (DERA). It is made available to Recipients with a
|
|
|
7 |
# royalty-free licence for its use, reproduction, transfer
|
|
|
8 |
# to other parties and amendment for any purpose not excluding
|
|
|
9 |
# product development provided that any such use et cetera
|
|
|
10 |
# shall be deemed to be acceptance of the following conditions:-
|
|
|
11 |
#
|
|
|
12 |
# (1) Its Recipients shall ensure that this Notice is
|
|
|
13 |
# reproduced upon any copies or amended versions of it;
|
|
|
14 |
#
|
|
|
15 |
# (2) Any amended version of it shall be clearly marked to
|
|
|
16 |
# show both the nature of and the organisation responsible
|
|
|
17 |
# for the relevant amendment or amendments;
|
|
|
18 |
#
|
|
|
19 |
# (3) Its onward transfer from a recipient to another
|
|
|
20 |
# party shall be deemed to be that party's acceptance of
|
|
|
21 |
# these conditions;
|
|
|
22 |
#
|
|
|
23 |
# (4) DERA gives no warranty or assurance as to its
|
|
|
24 |
# quality or suitability for any purpose and DERA accepts
|
|
|
25 |
# no liability whatsoever in relation to any use to which
|
|
|
26 |
# it may be put.
|
|
|
27 |
#
|
|
|
28 |
+IFNDEF __JUST_POSIX
|
|
|
29 |
|
|
|
30 |
+SUBSET "va_args" := {
|
|
|
31 |
+SUBSET "va_list" := {
|
|
|
32 |
# This is a hack to hide va_list
|
|
|
33 |
+IFNDEF ~building_libs
|
|
|
34 |
+TYPE ~va_list.1 | va_list.1 ;
|
|
|
35 |
+ELSE
|
|
|
36 |
+TYPE va_list.2 | va_list.2 ;
|
|
|
37 |
+TYPEDEF va_list ~va_list.2 ;
|
|
|
38 |
+ENDIF
|
|
|
39 |
} ;
|
|
|
40 |
|
|
|
41 |
%% #pragma TenDRA ident ... allow %%
|
|
|
42 |
|
|
|
43 |
+IFNDEF ~building_libs
|
|
|
44 |
+TYPEDEF ~va_list va_list ;
|
|
|
45 |
+ENDIF
|
|
|
46 |
|
|
|
47 |
+TYPE __va_t | "~__va_t" ;
|
|
|
48 |
+MACRO va_list __va_start ( __va_t ) ;
|
|
|
49 |
|
|
|
50 |
+TOKEN va_arg # This is tricky
|
|
|
51 |
%% PROC ( EXP lvalue : va_list : e , TYPE t ) EXP rvalue : t : %% ;
|
|
|
52 |
|
|
|
53 |
+MACRO void va_end ( lvalue va_list ) ;
|
|
|
54 |
|
|
|
55 |
%%%
|
|
|
56 |
#include <stdarg.h>
|
|
|
57 |
#ifndef __COMPLEX_VA_LIST
|
|
|
58 |
typedef va_list __va_t ;
|
|
|
59 |
#define __va_start( X ) ( ( va_list ) ( X ) )
|
|
|
60 |
#endif
|
|
|
61 |
%%%
|
|
|
62 |
|
|
|
63 |
} ;
|
|
|
64 |
|
|
|
65 |
+DEFINE va_start ( l, i ) %% ( ( void ) ( l = __va_start ( ... ) ) ) %% ;
|
|
|
66 |
|
|
|
67 |
+ENDIF
|