# Copyright © 2020 Nick Bowler # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . AT_BANNER([C declarations]) m4_define([CHECK_DECLS], [AT_CHECK([cdecl99 m4_map_args_sep([-e 'explain ], ['], [ ], m4_shift($@))], [0], [[$1]m4_ifval([$1], [ ])])]) m4_define([SIMPLE_DECLS], [AT_SETUP([Accept m4_car($1)]) CHECK_DECLS(m4_join([ ], $2), $1) AT_CLEANUP]) m4_define([SIMPLE_DECL], [SIMPLE_DECLS([[$1]], [[$2]])]) SIMPLE_DECLS([[int **], [int **x]], [[type pointer to pointer to int], [declare x as pointer to pointer to int]]) SIMPLE_DECLS([[int (*x)], [int (*)]], [[declare x as pointer to int], [type pointer to int]]) SIMPLE_DECL([int (x*)], [type function (pointer to x) returning int])