Description: Change Q_OS_LINUX ifdefs to __GLIBC__
 There are a number of #ifdef clauses in the sources that are checking
 for Linux.  This means arches such as kFreeBSD fail.  The correct check
 is for __GLIBC__
Bug-Debian: http://bugs.debian.org/644592
Author: Craig Small <csmall@debian.org>
Last-Update: 2017-07-09
--- a/src/TTextEdit.cpp
+++ b/src/TTextEdit.cpp
@@ -75,7 +75,7 @@
         }
 
         mpHost->mDisplayFont.setFixedPitch(true);
-#if defined(Q_OS_MAC) || defined(Q_OS_LINUX)
+#if defined(Q_OS_MAC) || defined(__GLIBC__)
         QPixmap pixmap = QPixmap(mScreenWidth * mFontWidth * 2, mFontHeight * 2);
         QPainter p(&pixmap);
         p.setFont(mpHost->mDisplayFont);
@@ -93,7 +93,7 @@
         mFontWidth = QFontMetrics(mDisplayFont).width(QChar('W'));
         mScreenWidth = 100;
         mDisplayFont.setFixedPitch(true);
-#if defined(Q_OS_MAC) || defined(Q_OS_LINUX)
+#if defined(Q_OS_MAC) || defined(__GLIBC__)
         QPixmap pixmap = QPixmap(mScreenWidth * mFontWidth * 2, mFontHeight * 2);
         QPainter p(&pixmap);
         p.setFont(mDisplayFont);
@@ -190,7 +190,7 @@
     mFgColor = QColor(192, 192, 192);
     mBgColor = QColor(Qt::black);
     mDisplayFont = QFont("Bitstream Vera Sans Mono", 10, QFont::Normal);
-#if defined(Q_OS_MAC) || defined(Q_OS_LINUX)
+#if defined(Q_OS_MAC) || defined(__GLIBC__)
     int width = mScreenWidth * mFontWidth * 2;
     int height = mFontHeight * 2;
     // sometimes mScreenWidth is 0, and QPainter doesn't like dimensions of 0x#. Need to work out why is
@@ -221,7 +221,7 @@
         mFontDescent = QFontMetrics(mDisplayFont).descent();
         mFontAscent = QFontMetrics(mDisplayFont).ascent();
         mFontHeight = mFontAscent + mFontDescent;
-#if defined(Q_OS_MAC) || defined(Q_OS_LINUX)
+#if defined(Q_OS_MAC) || defined(__GLIBC__)
         QPixmap pixmap = QPixmap(2000, 600);
         QPainter p(&pixmap);
         mDisplayFont.setLetterSpacing(QFont::AbsoluteSpacing, 0);
@@ -245,7 +245,7 @@
         mFontHeight = mFontAscent + mFontDescent;
         mBgColor = mpHost->mBgColor;
         mFgColor = mpHost->mFgColor;
-#if defined(Q_OS_MAC) || defined(Q_OS_LINUX)
+#if defined(Q_OS_MAC) || defined(__GLIBC__)
         QPixmap pixmap = QPixmap(mScreenWidth * mFontWidth * 2, mFontHeight * 2);
         QPainter p(&pixmap);
         mpHost->mDisplayFont.setLetterSpacing(QFont::AbsoluteSpacing, 0);
@@ -264,7 +264,7 @@
         mFontDescent = QFontMetrics(mDisplayFont).descent();
         mFontAscent = QFontMetrics(mDisplayFont).ascent();
         mFontHeight = mFontAscent + mFontDescent;
-#if defined(Q_OS_MAC) || defined(Q_OS_LINUX)
+#if defined(Q_OS_MAC) || defined(__GLIBC__)
         int width = mScreenWidth * mFontWidth * 2;
         int height = mFontHeight * 2;
         // sometimes mScreenWidth is 0, and QPainter doesn't like dimensions of 0x#. Need to work out why is
@@ -399,7 +399,7 @@
         font.setUnderline(isUnderline);
         font.setItalic(isItalics);
         font.setStrikeOut(isStrikeOut);
-#if defined(Q_OS_MAC) || defined(Q_OS_LINUX)
+#if defined(Q_OS_MAC) || defined(__GLIBC__)
         font.setLetterSpacing(QFont::AbsoluteSpacing, mLetterSpacing);
 #endif
         painter.setFont(font);
@@ -407,7 +407,7 @@
     if (painter.pen().color() != fgColor) {
         painter.setPen(fgColor);
     }
-#if defined(Q_OS_MAC) || defined(Q_OS_LINUX)
+#if defined(Q_OS_MAC) || defined(__GLIBC__)
     QPointF _p(rect.x(), rect.bottom() - mFontDescent);
     painter.drawText(_p, text);
 #else
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -78,14 +78,14 @@
 
 // A crude and simplistic commandline options processor - note that Qt deals
 // with its options automagically!
-#if !(defined(Q_OS_LINUX) || defined(Q_OS_WIN32) || defined(Q_OS_MAC))
+#if !(defined(__GLIBC__) || defined(Q_OS_WIN32) || defined(Q_OS_MAC))
     // Handle other currently unconsidered OSs - what are they - by returning the
     // normal GUI type application handle.
     return new QApplication(argc, argv);
 #endif
 
     for (int i = 1; i < argc; ++i) {
-#if defined(Q_OS_LINUX) || defined(Q_OS_MAC)
+#if defined(__GLIBC__) || defined(Q_OS_MAC)
         if (qstrcmp(argv[i], "--") == 0) {
             break; // Bail out on end of option type arguments
         }
@@ -93,7 +93,7 @@
 
         char argument = 0;
         bool isOption = false;
-#if defined(Q_OS_LINUX) || defined(Q_OS_MAC)
+#if defined(__GLIBC__) || defined(Q_OS_MAC)
         if (strlen(argv[i]) > 2 && strncmp(argv[i], "--", 2) == 0) {
             argument = argv[i][2];
             isOption = true;
@@ -226,7 +226,7 @@
             std::cout << "                       " << OPT_PREFIX << "dograb wins over " << OPT_PREFIX << "nograb even when" << std::endl;
             std::cout << "                       " << OPT_PREFIX << "nograb is last on the command line." << std::endl;
             std::cout << "       " << OPT_PREFIX << "nograb         the application should never grab the mouse or the" << std::endl;
-#if defined(Q_OS_LINUX)
+#if defined(__GLIBC__)
             std::cout << "                       keyboard. This option is set by default when Mudlet is" << std::endl;
             std::cout << "                       running in the gdb debugger under Linux." << std::endl;
 #else
--- a/src/TCommandLine.cpp
+++ b/src/TCommandLine.cpp
@@ -50,7 +50,7 @@
 , mpHunspellSuggestionList()
 {
     QString path;
-#ifdef Q_OS_LINUX
+#ifdef __GLIBC__
     if (QFile::exists("/usr/share/hunspell/" + pHost->mSpellDic + ".aff")) {
         path = "/usr/share/hunspell/";
     } else {
--- a/src/TConsole.cpp
+++ b/src/TConsole.cpp
@@ -969,7 +969,7 @@
         console->setPalette(palette);
         console2->setPalette(palette);
     } else if (mIsSubConsole) {
-#if defined(Q_OS_MAC) || defined(Q_OS_LINUX)
+#if defined(Q_OS_MAC) || defined(__GLIBC__)
         mDisplayFont.setStyleStrategy((QFont::StyleStrategy)(QFont::NoAntialias | QFont::PreferQuality));
         QPixmap pixmap = QPixmap(2000, 600);
         QPainter p(&pixmap);
@@ -1013,7 +1013,7 @@
         }
         mpHost->mDisplayFont.setFixedPitch(true);
         mDisplayFont.setFixedPitch(true);
-#if defined(Q_OS_MAC) || defined(Q_OS_LINUX)
+#if defined(Q_OS_MAC) || defined(__GLIBC__)
         QPixmap pixmap = QPixmap(2000, 600);
         QPainter p(&pixmap);
         QFont _font = mpHost->mDisplayFont;
--- a/src/dlgProfilePreferences.cpp
+++ b/src/dlgProfilePreferences.cpp
@@ -260,7 +260,7 @@
     checkBox_echoLuaErrors->setChecked(pHost->mEchoLuaErrors);
 
     QString path;
-#ifdef Q_OS_LINUX
+#ifdef __GLIBC__
     if (QFile::exists("/usr/share/hunspell/" + pHost->mSpellDic + ".aff")) {
         path = "/usr/share/hunspell/";
     } else {
--- a/src/TLuaInterpreter.cpp
+++ b/src/TLuaInterpreter.cpp
@@ -12316,7 +12316,7 @@
     QString n;
     int error;
 
-#ifdef Q_OS_LINUX
+#ifdef __GLIBC__
     // if using LuaJIT, adjust the cpath to look in /usr/lib as well - it doesn't by default
     luaL_dostring(pGlobalLua, "if jit then package.cpath = package.cpath .. ';/usr/lib/lua/5.1/?.so;/usr/lib/x86_64-linux-gnu/lua/5.1/?.so' end");
 
