Kaynağa Gözat

Only enable compiler includes if specified at compile time.

mingodad 9 yıl önce
ebeveyn
işleme
da51838da0
1 değiştirilmiş dosya ile 4 ekleme ve 0 silme
  1. 4 0
      SquiLu/squirrel/sqcompiler.cpp

+ 4 - 0
SquiLu/squirrel/sqcompiler.cpp

@@ -446,6 +446,7 @@ public:
         SQObject id = Expect(TK_IDENTIFIER);
         SQObject id = Expect(TK_IDENTIFIER);
         if(scstrcmp(_stringval(id), _SC("include")) == 0)
         if(scstrcmp(_stringval(id), _SC("include")) == 0)
         {
         {
+#if SQ_ENABLE_INCLUDES
             SQInteger nested_count = _nested_includes_count + 1;
             SQInteger nested_count = _nested_includes_count + 1;
             if((_max_nested_includes <= 0) || (nested_count > _max_nested_includes))
             if((_max_nested_includes <= 0) || (nested_count > _max_nested_includes))
             {
             {
@@ -504,6 +505,9 @@ public:
             {
             {
                 Error(_SC("Error: opening include file %s\n"), _stringval(id));
                 Error(_SC("Error: opening include file %s\n"), _stringval(id));
             }
             }
+#else
+                Error(_SC("Error: includes are not enabled\n"));
+#endif
         }
         }
         else
         else
         {
         {