/[bison]/bison/data/c.m4
ViewVC logotype

Diff of /bison/data/c.m4

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.3 by akim, Thu Jul 25 17:32:34 2002 UTC revision 1.4 by akim, Thu Jul 25 19:34:54 2002 UTC
# Line 128  m4_map_sep([     b4_token_enum], [, Line 128  m4_map_sep([     b4_token_enum], [,
128  m4_map([b4_token_define], [$@])  m4_map([b4_token_define], [$@])
129  ])  ])
130  ])  ])
131    
132    
133    ## ---------------------------------------------- ##
134    ## Declaring C functions in both K&R and ANSI-C.  ##
135    ## ---------------------------------------------- ##
136    
137    
138    # b4_c_function(NAME, RETURN-VALUE, [TYPE1, NAME1], ...)
139    # ------------------------------------------------
140    # Declare the function NAME.
141    m4_define([b4_c_function],
142    [$2
143    #if defined (__STDC__) || defined (__cplusplus)
144    $1 (b4_c_ansi_args(m4_shiftn(2, $@)))
145    #else
146    $1 (b4_c_knr_arg_names(m4_shiftn(2, $@)))
147    b4_c_knr_arg_decls(m4_shiftn(2, $@))
148    #endif[]dnl
149    ])
150    
151    
152    # b4_c_ansi_args([TYPE1, NAME1], ...)
153    # -----------------------------------
154    # Output the arguments ANSI-C definition.
155    m4_define([b4_c_ansi_args],
156    [m4_map_sep([b4_c_ansi_arg], [, ], [$@])])
157    
158    m4_define([b4_c_ansi_arg],
159    [$1 $2])
160    
161    
162    # b4_c_knr_args([TYPE1, NAME1], ...)
163    # ----------------------------------
164    # Output the argument names.
165    m4_define([b4_c_knr_arg_names],
166    [m4_map_sep([b4_c_knr_arg_name], [, ], [$@])])
167    
168    m4_define([b4_c_knr_arg_name],
169    [$2])
170    
171    
172    # b4_c_knr_args([TYPE1, NAME1], ...)
173    # ----------------------------------
174    # Output the K&R argument declarations.
175    m4_define([b4_c_knr_arg_decls],
176    [m4_map_sep([b4_c_knr_arg_decl],
177                [
178    ],
179                [$@])])
180    
181    m4_define([b4_c_knr_arg_decl],
182    [    $1 $2;])

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.4

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26