[Kde-bindings] KDE/kdebindings/generator

Arno Rehn kde at arnorehn.de
Thu May 6 15:57:36 UTC 2010


SVN commit 1123675 by arnorehn:

try to fix endless loops in the proper way

CCMAIL: kde-bindings at kde.org
CCMAIL: petr at scribus.info



 M  +5 -3      generatorpreprocessor.cpp  


--- trunk/KDE/kdebindings/generator/generatorpreprocessor.cpp #1123674:1123675
@@ -159,10 +159,12 @@
 
 rpp::Stream* Preprocessor::sourceNeeded(QString& fileName, rpp::Preprocessor::IncludeType type, int sourceLine, bool skipCurrentPath)
 {
-    // skip limits.h - rpp::pp gets stuck in a endless loop, probably because of
-    // #include_next <limits.h> in the file and no proper header guard.
-    if (fileName == "limits.h" && type == rpp::Preprocessor::IncludeGlobal)
+    if (m_fileStack.top().fileName() == fileName && type == rpp::Preprocessor::IncludeGlobal) {
+#ifdef DEBUG
+        qDebug("prevented possible endless loop because of #include<%s>", qPrintable(fileName));
+#endif
         return 0;
+    }
     
     // are the contents already cached?
     if (type == rpp::Preprocessor::IncludeGlobal && m_cache.contains(fileName)) { 



More information about the Kde-bindings mailing list