-/* NetHack 3.6 sp_lev.h $NHDT-Date: 1501723399 2017/08/03 01:23:19 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.20 $ */
+/* NetHack 3.6 sp_lev.h $NHDT-Date: 1501803105 2017/08/03 23:31:45 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.21 $ */
/* Copyright (c) 1989 by Jean-Christophe Collet */
/* NetHack may be freely redistributed. See license for details. */
#endif
#undef VA_ARGS /* redefine with the maximum number actually used */
#undef VA_SHIFT /* ditto */
+#undef VA_PASS1
#define VA_ARGS \
arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, \
arg12, arg13, arg14
-/* NetHack 3.6 tradstdc.h $NHDT-Date: 1501723401 2017/08/03 01:23:21 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.28 $ */
+/* NetHack 3.6 tradstdc.h $NHDT-Date: 1501803107 2017/08/03 23:31:47 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.29 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
#define VA_END() \
va_end(the_args); \
}
+#define VA_PASS1(a1) a1
#if defined(ULTRIX_PROTO) && !defined(_VA_LIST_)
#define _VA_LIST_ /* prevents multiple def in stdio.h */
#endif
#define VA_END() \
va_end(the_args); \
}
+#define VA_PASS1(a1) a1
#else
/*USE_OLDARGS*/
arg6 = arg7, arg7 = arg8, arg8 = arg9, arg9 = 0)
#define VA_NEXT(var1, typ1) ((var1 = (typ1) arg1), VA_SHIFT(), var1)
#define VA_END() }
+/* needed in pline.c, where full number of arguments is known and expected */
+#define VA_PASS1(a1) \
+ (vA) a1, (vA) 0, (vA) 0, (vA) 0, (vA) 0, (vA) 0, (vA) 0, (vA) 0, (vA) 0
#endif
#endif
-/* NetHack 3.6 pline.c $NHDT-Date: 1501725406 2017/08/03 01:56:46 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.60 $ */
+/* NetHack 3.6 pline.c $NHDT-Date: 1501803108 2017/08/03 23:31:48 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.61 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
Vsprintf(pbuf, s, VA_ARGS);
pbuf[BUFSZ - 1] = '\0'; /* sanity */
paniclog("impossible", pbuf);
-#ifndef USE_OLDARGS
-#define DUMMY_PLINE_ARGS /*empty*/
-#else /* needed because we follow the definition of pline() itself;
- * passing 1 arg, pline takes 9 (for USE_OLDARGS) so add 8 dummies */
-#define DUMMY_PLINE_ARGS , (vA) 0, (vA) 0, (vA) 0, (vA) 0, \
- (vA) 0, (vA) 0, (vA) 0, (vA) 0
-#endif
- pline("%s", pbuf /* no comma here; when needed, it's in DUMMY_ARGS */
- DUMMY_PLINE_ARGS);
- pline("%s", "Program in disorder - perhaps you'd better #quit."
- DUMMY_PLINE_ARGS);
-#undef DUMMY_PLINE_ARGS
+ pline("%s", VA_PASS1(pbuf));
+ pline("%s", VA_PASS1("Program in disorder - perhaps you'd better #quit."));
program_state.in_impossible = 0;
VA_END();
}
(void) setuid(getuid());
(void) execv(args[0], (char *const *) args);
perror((char *) 0);
- (void) fprintf(stderr, "Exec to message handler %s failed.\n",
- env);
+ (void) fprintf(stderr, "Exec to message handler %s failed.\n", env);
terminate(EXIT_FAILURE);
} else if (f > 0) {
int status;
+
waitpid(f, &status, 0);
} else if (f == -1) {
perror((char *) 0);
use_pline_handler = FALSE;
- pline("Fork to message handler failed.");
+ pline("%s", VA_PASS1("Fork to message handler failed."));
}
}
#endif /* defined(POSIX_TYPES) || defined(__GNUC__) */