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:
6
src/do.c
6
src/do.c
@@ -1125,7 +1125,7 @@ dodown(void)
|
||||
if (on_level(&valley_level, &u.uz) && !u.uevent.gehennom_entered) {
|
||||
You("are standing at the gate to Gehennom.");
|
||||
pline("Unspeakable cruelty and harm lurk down there.");
|
||||
if (yn("Are you sure you want to enter?") != 'y')
|
||||
if (y_n("Are you sure you want to enter?") != 'y')
|
||||
return ECMD_OK;
|
||||
pline("So be it.");
|
||||
u.uevent.gehennom_entered = 1; /* don't ask again */
|
||||
@@ -1145,7 +1145,7 @@ dodown(void)
|
||||
|
||||
You("don't fit %s easily.", down_or_thru);
|
||||
Sprintf(qbuf, "Try to squeeze %s?", down_or_thru);
|
||||
if (yn(qbuf) == 'y') {
|
||||
if (y_n(qbuf) == 'y') {
|
||||
if (!rn2(3)) {
|
||||
actn = "manage to squeeze";
|
||||
losehp(Maybe_Half_Phys(rnd(4)),
|
||||
@@ -1223,7 +1223,7 @@ doup(void)
|
||||
if (ledger_no(&u.uz) == 1) {
|
||||
if (iflags.debug_fuzzer)
|
||||
return ECMD_OK;
|
||||
if (yn("Beware, there will be no return! Still climb?") != 'y')
|
||||
if (y_n("Beware, there will be no return! Still climb?") != 'y')
|
||||
return ECMD_OK;
|
||||
}
|
||||
if (!next_to_u()) {
|
||||
|
||||
Reference in New Issue
Block a user