Files
nethack/win/Qt/qt_msg.h
nhmall ba5356603a 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.
2023-01-12 16:04:40 -05:00

53 lines
1.1 KiB
C++

// Copyright (c) Warwick Allison, 1999.
// Qt4 conversion copyright (c) Ray Chason, 2012-2014.
// NetHack may be freely redistributed. See license for details.
// qt_msg.h -- a message window
#ifndef QT4MSG_H
#define QT4MSG_H
#include "qt_win.h"
namespace nethack_qt_ {
class NetHackQtMapWindow2;
class NetHackQtMessageWindow : QScrollArea, public NetHackQtWindow {
Q_OBJECT
public:
NetHackQtMessageWindow();
~NetHackQtMessageWindow();
virtual QWidget* Widget();
virtual void Clear();
virtual void Display(bool block);
virtual const char *GetStr(bool init);
virtual void PutStr(int attr, const QString& text);
void Scroll(int dx, int dy);
void ClearMessages();
void setMap(NetHackQtMapWindow2*);
void RehighlightPrompt();
bool hilit_mesgs();
void unhighlight_mesgs();
// for adding the answer for y_n() to its prompt string
void AddToStr(const char *answerbuf);
private:
QListWidget *list;
QScrollArea *scrollarea;
bool changed;
int currgetmsg;
NetHackQtMapWindow2* map;
private slots:
void updateFont();
};
} // namespace nethack_qt_
#endif