# Simple calculator. -*- Autotest -*-
-# Copyright (C) 2000-2012 Free Software Foundation, Inc.
+# Copyright (C) 2000-2013 Free Software Foundation, Inc.
# 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
m4_pushdef([AT_CALC_MAIN],
[#include <assert.h>
-#if HAVE_UNISTD_H
-# include <unistd.h>
-#else
-# undef alarm
-# define alarm(seconds) /* empty */
-#endif
+#include <unistd.h>
AT_SKEL_CC_IF([[
/* A C++ ]AT_NAME_PREFIX[parse that simulates the C signature. */
])
-# AT_CHECK_SPACES([FILE])
-# -----------------------
+# AT_CHECK_SPACES([FILES])
+# ------------------------
# Make sure we did not introduce bad spaces. Checked here because all
# the skeletons are (or should be) exercized here.
m4_define([AT_CHECK_SPACES],
[AT_CHECK([$PERL -ne '
chomp;
- print "$.: {$_}\n"
+ print "$ARGV:$.: {$_}\n"
if (# No starting/ending empty lines.
(eof || $. == 1) && /^\s*$/
# No trailing space.
AT_DATA_CALC_Y([$1])
AT_FULL_COMPILE([calc], AT_DEFINES_IF([[lex], [main]]))
-AT_CHECK_SPACES([calc.AT_SKEL_CC_IF([cc], [c])])
-AT_DEFINES_IF([AT_CHECK_SPACES([calc.AT_SKEL_CC_IF([hh], [h])])])
+AT_CHECK_SPACES(m4_join([ ],
+ [calc.AT_SKEL_CC_IF([cc], [c])],
+ [AT_DEFINES_IF([calc.AT_SKEL_CC_IF([hh], [h])])]))
# Test the priorities.
_AT_CHECK_CALC([$1],