yn()
A number of C compiler suites have a math.h library that includes a yn() function name that conflicts with NetHack's yn() macro: "The y0(), y1(), and yn() functions are Bessel functions of the second kind, for orders 0, 1, and n, respectively. The argument x must be positive. The argument n should be greater than or equal to zero. If n is less than zero, there will be a negative exponent in the result." At one point, isaac64.h included math.h, although that has since been removed. Some libraries used in NetHack (Qt for one) do include math.h and that required build work-arounds to avoid the conflict. Rename the NetHack macro from yn() to y_n() and avoid the math.h conflict altogether, eliminating the need for that particular work-around.
This commit is contained in:
@@ -1370,7 +1370,7 @@ use_candle(struct obj **optr)
|
||||
if ((q = strstri(qbuf, " to\033")) != 0)
|
||||
Strcpy(q, " to ");
|
||||
/* last, format final "attach candles to candelabrum?" query */
|
||||
if (yn(safe_qbuf(qbuf, qbuf, "?", otmp, yname, thesimpleoname, "it"))
|
||||
if (y_n(safe_qbuf(qbuf, qbuf, "?", otmp, yname, thesimpleoname, "it"))
|
||||
== 'n') {
|
||||
use_lamp(obj);
|
||||
return;
|
||||
@@ -2776,7 +2776,7 @@ use_trap(struct obj *otmp)
|
||||
You("aren't very skilled at reaching from %s.", mon_nam(u.usteed));
|
||||
Sprintf(buf, "Continue your attempt to set %s?",
|
||||
the(trapname(ttyp, FALSE)));
|
||||
if (yn(buf) == 'y') {
|
||||
if (y_n(buf) == 'y') {
|
||||
if (chance) {
|
||||
switch (ttyp) {
|
||||
case LANDMINE: /* set it off */
|
||||
|
||||
Reference in New Issue
Block a user