Qt header usage
Move the nine #undef's common to all qt_*.cpp sources into qt_pre.h.
Make "hack.h" usage consistent; always enclose withing 'extern "C {'
and '}' even though only some of the sources care.
This commit is contained in:
@@ -7,15 +7,6 @@
|
||||
extern "C" {
|
||||
#include "hack.h"
|
||||
}
|
||||
#undef Invisible
|
||||
#undef Warning
|
||||
#undef index
|
||||
#undef msleep
|
||||
#undef rindex
|
||||
#undef wizard
|
||||
#undef yn
|
||||
#undef min
|
||||
#undef max
|
||||
|
||||
#include "qt_pre.h"
|
||||
#include <QtGui/QtGui>
|
||||
|
||||
@@ -4,16 +4,9 @@
|
||||
|
||||
// qt_click.cpp -- a mouse click buffer
|
||||
|
||||
extern "C" {
|
||||
#include "hack.h"
|
||||
#undef Invisible
|
||||
#undef Warning
|
||||
#undef index
|
||||
#undef msleep
|
||||
#undef rindex
|
||||
#undef wizard
|
||||
#undef yn
|
||||
#undef min
|
||||
#undef max
|
||||
}
|
||||
|
||||
#include "qt_pre.h"
|
||||
#include <QtGui/QtGui>
|
||||
|
||||
@@ -4,16 +4,9 @@
|
||||
|
||||
// qt_delay.cpp -- implement a delay
|
||||
|
||||
extern "C" {
|
||||
#include "hack.h"
|
||||
#undef Invisible
|
||||
#undef Warning
|
||||
#undef index
|
||||
#undef msleep
|
||||
#undef rindex
|
||||
#undef wizard
|
||||
#undef yn
|
||||
#undef min
|
||||
#undef max
|
||||
}
|
||||
|
||||
#include "qt_pre.h"
|
||||
#include <QtGui/QtGui>
|
||||
|
||||
@@ -6,17 +6,8 @@
|
||||
|
||||
extern "C" {
|
||||
#include "hack.h"
|
||||
}
|
||||
#include "tile2x11.h"
|
||||
#undef Invisible
|
||||
#undef Warning
|
||||
#undef index
|
||||
#undef msleep
|
||||
#undef rindex
|
||||
#undef wizard
|
||||
#undef yn
|
||||
#undef min
|
||||
#undef max
|
||||
}
|
||||
|
||||
#include "qt_pre.h"
|
||||
#include <QtGui/QtGui>
|
||||
|
||||
@@ -4,16 +4,9 @@
|
||||
|
||||
// qt_icon.cpp -- a labelled icon
|
||||
|
||||
extern "C" {
|
||||
#include "hack.h"
|
||||
#undef Invisible
|
||||
#undef Warning
|
||||
#undef index
|
||||
#undef msleep
|
||||
#undef rindex
|
||||
#undef wizard
|
||||
#undef yn
|
||||
#undef min
|
||||
#undef max
|
||||
}
|
||||
|
||||
#include "qt_pre.h"
|
||||
#include <QtGui/QtGui>
|
||||
|
||||
@@ -11,15 +11,6 @@
|
||||
extern "C" {
|
||||
#include "hack.h"
|
||||
}
|
||||
#undef Invisible
|
||||
#undef Warning
|
||||
#undef index
|
||||
#undef msleep
|
||||
#undef rindex
|
||||
#undef wizard
|
||||
#undef yn
|
||||
#undef min
|
||||
#undef max
|
||||
|
||||
#include "qt_pre.h"
|
||||
#include <QtGui/QtGui>
|
||||
|
||||
@@ -4,16 +4,9 @@
|
||||
|
||||
// qt_key.cpp -- a key buffer
|
||||
|
||||
extern "C" {
|
||||
#include "hack.h"
|
||||
#undef Invisible
|
||||
#undef Warning
|
||||
#undef index
|
||||
#undef msleep
|
||||
#undef rindex
|
||||
#undef wizard
|
||||
#undef yn
|
||||
#undef min
|
||||
#undef max
|
||||
}
|
||||
|
||||
#include "qt_pre.h"
|
||||
#include <QtGui/QtGui>
|
||||
|
||||
@@ -4,16 +4,9 @@
|
||||
|
||||
// qt_line.cpp -- a one line input window
|
||||
|
||||
extern "C" {
|
||||
#include "hack.h"
|
||||
#undef Invisible
|
||||
#undef Warning
|
||||
#undef index
|
||||
#undef msleep
|
||||
#undef rindex
|
||||
#undef wizard
|
||||
#undef yn
|
||||
#undef min
|
||||
#undef max
|
||||
}
|
||||
|
||||
#include "qt_pre.h"
|
||||
#include <QtGui/QtGui>
|
||||
|
||||
@@ -7,15 +7,6 @@
|
||||
extern "C" {
|
||||
#include "hack.h"
|
||||
}
|
||||
#undef Invisible
|
||||
#undef Warning
|
||||
#undef index
|
||||
#undef msleep
|
||||
#undef rindex
|
||||
#undef wizard
|
||||
#undef yn
|
||||
#undef min
|
||||
#undef max
|
||||
|
||||
#include "qt_pre.h"
|
||||
#include <QtGui/QtGui>
|
||||
|
||||
@@ -7,15 +7,6 @@
|
||||
extern "C" {
|
||||
#include "hack.h"
|
||||
}
|
||||
#undef Invisible
|
||||
#undef Warning
|
||||
#undef index
|
||||
#undef msleep
|
||||
#undef rindex
|
||||
#undef wizard
|
||||
#undef yn
|
||||
#undef min
|
||||
#undef max
|
||||
|
||||
#include "qt_pre.h"
|
||||
#include <QtGui/QtGui>
|
||||
|
||||
@@ -7,15 +7,6 @@
|
||||
extern "C" {
|
||||
#include "hack.h"
|
||||
}
|
||||
#undef Invisible
|
||||
#undef Warning
|
||||
#undef index
|
||||
#undef msleep
|
||||
#undef rindex
|
||||
#undef wizard
|
||||
#undef yn
|
||||
#undef min
|
||||
#undef max
|
||||
|
||||
#include "qt_pre.h"
|
||||
#include <QtGui/QtGui>
|
||||
|
||||
@@ -7,15 +7,6 @@
|
||||
extern "C" {
|
||||
#include "hack.h"
|
||||
}
|
||||
#undef Invisible
|
||||
#undef Warning
|
||||
#undef index
|
||||
#undef msleep
|
||||
#undef rindex
|
||||
#undef wizard
|
||||
#undef yn
|
||||
#undef min
|
||||
#undef max
|
||||
|
||||
#include "qt_pre.h"
|
||||
#include <QtGui/QtGui>
|
||||
|
||||
@@ -7,15 +7,6 @@
|
||||
extern "C" {
|
||||
#include "hack.h"
|
||||
}
|
||||
#undef Invisible
|
||||
#undef Warning
|
||||
#undef index
|
||||
#undef msleep
|
||||
#undef rindex
|
||||
#undef wizard
|
||||
#undef yn
|
||||
#undef min
|
||||
#undef max
|
||||
|
||||
#include "qt_pre.h"
|
||||
#include <QtGui/QtGui>
|
||||
|
||||
@@ -1,4 +1,13 @@
|
||||
/* NetHack 3.7 qt_post.h $NHDT-Date: 1597276832 2020/08/13 00:00:32 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.0 $ */
|
||||
|
||||
/*
|
||||
* qt_post.h -- reverse part of qt_pre.h.
|
||||
*
|
||||
* #include after <Qt.../Qt...>.
|
||||
*/
|
||||
|
||||
#ifdef __clang__
|
||||
#pragma clang diagnostic pop
|
||||
#endif /* __clang__ */
|
||||
|
||||
/*qt_post.h*/
|
||||
|
||||
@@ -1,5 +1,28 @@
|
||||
/* NetHack 3.7 qt_pre.h $NHDT-Date: 1597276835 2020/08/13 00:00:35 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.0 $ */
|
||||
|
||||
/*
|
||||
* qt_pre.h -- undefine some nethack macros which conflict with Qt headers.
|
||||
*
|
||||
* #include after "hack.h", before <Qt.../Qt...>.
|
||||
*/
|
||||
|
||||
#undef Invisible
|
||||
#undef Warning
|
||||
#undef index
|
||||
#undef msleep
|
||||
#undef rindex
|
||||
#undef wizard
|
||||
#undef yn
|
||||
#undef min
|
||||
#undef max
|
||||
|
||||
/* disable warnings for shadowed names; some of the Qt prototypes use
|
||||
placeholder argument names which conflict with nethack variables
|
||||
('g', 'u', a couple of others) */
|
||||
#ifdef __clang__
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wshadow"
|
||||
#endif
|
||||
|
||||
/*qt_pre.h*/
|
||||
|
||||
|
||||
@@ -4,16 +4,9 @@
|
||||
|
||||
// qt_rip.cpp -- tombstone window
|
||||
|
||||
extern "C" {
|
||||
#include "hack.h"
|
||||
#undef Invisible
|
||||
#undef Warning
|
||||
#undef index
|
||||
#undef msleep
|
||||
#undef rindex
|
||||
#undef wizard
|
||||
#undef yn
|
||||
#undef min
|
||||
#undef max
|
||||
}
|
||||
|
||||
#include "qt_pre.h"
|
||||
#include <QtGui/QtGui>
|
||||
|
||||
@@ -4,16 +4,9 @@
|
||||
|
||||
// qt_set.cpp -- the Qt settings
|
||||
|
||||
extern "C" {
|
||||
#include "hack.h"
|
||||
#undef Invisible
|
||||
#undef Warning
|
||||
#undef index
|
||||
#undef msleep
|
||||
#undef rindex
|
||||
#undef wizard
|
||||
#undef yn
|
||||
#undef min
|
||||
#undef max
|
||||
}
|
||||
|
||||
#include "qt_pre.h"
|
||||
#include <QtGui/QtGui>
|
||||
|
||||
@@ -7,15 +7,6 @@
|
||||
extern "C" {
|
||||
#include "hack.h"
|
||||
}
|
||||
#undef Invisible
|
||||
#undef Warning
|
||||
#undef index
|
||||
#undef msleep
|
||||
#undef rindex
|
||||
#undef wizard
|
||||
#undef yn
|
||||
#undef min
|
||||
#undef max
|
||||
|
||||
#include "qt_pre.h"
|
||||
#include <QtGui/QtGui>
|
||||
|
||||
@@ -4,16 +4,9 @@
|
||||
|
||||
// qt_streq.cpp -- string requestor
|
||||
|
||||
extern "C" {
|
||||
#include "hack.h"
|
||||
#undef Invisible
|
||||
#undef Warning
|
||||
#undef index
|
||||
#undef msleep
|
||||
#undef rindex
|
||||
#undef wizard
|
||||
#undef yn
|
||||
#undef min
|
||||
#undef max
|
||||
}
|
||||
|
||||
#include "qt_pre.h"
|
||||
#include <QtGui/QtGui>
|
||||
|
||||
@@ -4,16 +4,9 @@
|
||||
|
||||
// qt_svsel.cpp -- saved game selector
|
||||
|
||||
extern "C" {
|
||||
#include "hack.h"
|
||||
#undef Invisible
|
||||
#undef Warning
|
||||
#undef index
|
||||
#undef msleep
|
||||
#undef rindex
|
||||
#undef wizard
|
||||
#undef yn
|
||||
#undef min
|
||||
#undef max
|
||||
}
|
||||
|
||||
#include "qt_pre.h"
|
||||
#include <QtGui/QtGui>
|
||||
|
||||
@@ -46,16 +46,9 @@
|
||||
// identifiers.
|
||||
|
||||
#define QT_DEPRECATED_WARNINGS
|
||||
extern "C" {
|
||||
#include "hack.h"
|
||||
#undef Invisible
|
||||
#undef Warning
|
||||
#undef index
|
||||
#undef msleep
|
||||
#undef rindex
|
||||
#undef wizard
|
||||
#undef yn
|
||||
#undef min
|
||||
#undef max
|
||||
}
|
||||
|
||||
#include "qt_pre.h"
|
||||
#include <QtGui/QtGui>
|
||||
|
||||
@@ -4,17 +4,10 @@
|
||||
|
||||
// qt_xcmd.cpp -- extended command widget
|
||||
|
||||
extern "C" {
|
||||
#include "hack.h"
|
||||
#include "func_tab.h"
|
||||
#undef Invisible
|
||||
#undef Warning
|
||||
#undef index
|
||||
#undef msleep
|
||||
#undef rindex
|
||||
#undef wizard
|
||||
#undef yn
|
||||
#undef min
|
||||
#undef max
|
||||
}
|
||||
|
||||
#include "qt_pre.h"
|
||||
#include <QtGui/QtGui>
|
||||
|
||||
@@ -4,16 +4,9 @@
|
||||
|
||||
// qt_yndlg.cpp -- yes/no dialog
|
||||
|
||||
extern "C" {
|
||||
#include "hack.h"
|
||||
#undef Invisible
|
||||
#undef Warning
|
||||
#undef index
|
||||
#undef msleep
|
||||
#undef rindex
|
||||
#undef wizard
|
||||
#undef yn
|
||||
#undef min
|
||||
#undef max
|
||||
}
|
||||
|
||||
#include "qt_pre.h"
|
||||
#include <QtGui/QtGui>
|
||||
|
||||
Reference in New Issue
Block a user