Subversion Repositories tendra.SVN

Rev

Rev 2 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
7 7u83 1
#
2
# Copyright (c) 2002-2005 The TenDRA Project <http://www.tendra.org/>
3
# All rights reserved.
4
#
5
# Redistribution and use in source and binary forms, with or without
6
# modification, are permitted provided that the following conditions
7
# are met:
8
#
9
# 1. Redistributions of source code must retain the above copyright
10
#    notice, this list of conditions and the following disclaimer.
11
# 2. Redistributions in binary form must reproduce the above copyright
12
#    notice, this list of conditions and the following disclaimer in the
13
#    documentation and/or other materials provided with the distribution.
14
#
15
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
16
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18
# ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
19
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21
# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22
# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25
# SUCH DAMAGE.
26
#
2 7u83 27
#   		 Crown Copyright (c) 1997
28
#   
29
#   This TenDRA(r) Computer Program is subject to Copyright
30
#   owned by the United Kingdom Secretary of State for Defence
31
#   acting through the Defence Evaluation and Research Agency
32
#   (DERA).  It is made available to Recipients with a
33
#   royalty-free licence for its use, reproduction, transfer
34
#   to other parties and amendment for any purpose not excluding
35
#   product development provided that any such use et cetera
36
#   shall be deemed to be acceptance of the following conditions:-
37
#   
38
#       (1) Its Recipients shall ensure that this Notice is
39
#       reproduced upon any copies or amended versions of it;
40
#   
41
#       (2) Any amended version of it shall be clearly marked to
42
#       show both the nature of and the organisation responsible
43
#       for the relevant amendment or amendments;
44
#   
45
#       (3) Its onward transfer from a recipient to another
46
#       party shall be deemed to be that party's acceptance of
47
#       these conditions;
48
#   
49
#       (4) DERA gives no warranty or assurance as to its
50
#       quality or suitability for any purpose and DERA accepts
51
#       no liability whatsoever in relation to any use to which
52
#       it may be put.
53
#
7 7u83 54
# $Id$
55
#
56
 
2 7u83 57
+IFNDEF __JUST_POSIX
58
 
59
+SUBSET "va_args" := {
60
    +SUBSET "va_list" := {
61
	# This is a hack to hide va_list
62
	+IFNDEF ~building_libs
63
	+TYPE ~va_list.1 | va_list.1 ;
64
	+ELSE
65
	+TYPE va_list.2 | va_list.2 ;
66
	+TYPEDEF va_list ~va_list.2 ;
67
	+ENDIF
68
    } ;
69
 
70
    %% #pragma TenDRA ident ... allow %%
71
 
72
    +IFNDEF ~building_libs
73
    +TYPEDEF ~va_list va_list ;
74
    +ENDIF
75
 
76
    +TYPE __va_t | "~__va_t"  ;
77
    +MACRO va_list __va_start ( __va_t ) ;
78
 
79
    +TOKEN va_arg # This is tricky
80
    %% PROC ( EXP lvalue : va_list : e , TYPE t ) EXP rvalue : t : %% ;
81
 
82
    +MACRO void va_end ( lvalue va_list ) ;
83
 
84
%%%
85
#include <stdarg.h>
86
#ifndef __COMPLEX_VA_LIST
87
typedef va_list __va_t ;
88
#define __va_start( X ) ( ( va_list ) ( X ) )
89
#endif
90
%%%
91
 
92
} ;
93
 
94
+DEFINE va_start ( l, i )  %% ( ( void ) ( l = __va_start ( ... ) ) ) %% ;
95
 
96
+ENDIF
7 7u83 97
 
98
# vim:set filetype=tspec: