فهرست منبع

Merge pull request #7551 from shamser/issue13445

HPCC-13445 Commented out #option libraries not ignored

Reviewed-By: Jake Smith <jake.smith@lexisnexis.com>
Reviewed-By: Richard Chapman <rchapman@hpccsystems.com>
Richard Chapman 10 سال پیش
والد
کامیت
d66095dfbc
1فایلهای تغییر یافته به همراه19 افزوده شده و 4 حذف شده
  1. 19 4
      ecl/hql/hqlutil.cpp

+ 19 - 4
ecl/hql/hqlutil.cpp

@@ -5559,6 +5559,24 @@ IHqlExpression * extractCppBodyAttrs(unsigned lenBuffer, const char * buffer)
         char next = buffer[i];
         switch (next)
         {
+        case '*':
+            if ('/' == prev) // Ignore directives in multi-line comments
+            {
+                i+=2;
+                while (i < lenBuffer && ('*' != buffer[i-1] || '/' != buffer[i])) 
+                    ++i;
+                next = 0;    // subsequent processing ignore the current '/' character
+            }
+            break;
+        case '/':
+            if ('/' == prev) // Ignore directives in single line comments
+            {
+                ++i;
+                while (i < lenBuffer && !iseol(buffer[i]))
+                    ++i;
+                next = 0;    // subsequent processing ignore the current '/' character
+            }
+            break;
         case ' ': case '\t':
             // allow whitespace in front of #option
             break;
@@ -5600,11 +5618,8 @@ IHqlExpression * extractCppBodyAttrs(unsigned lenBuffer, const char * buffer)
                     }
                 }
             }
-            //fallthrough
-        default:
-            prev = next;
-            break;
         }
+        prev = next;
     }
     return attrs.getClear();
 }