瀏覽代碼

* fixes windows linking/preprocessor (doesn't seem to understand "") and makes the code a bit cleaner

git-svn-id: trunk@4797 -
Almindor 19 年之前
父節點
當前提交
85bb8872be
共有 1 個文件被更改,包括 10 次插入5 次删除
  1. 10 5
      compiler/cutils.pas

+ 10 - 5
compiler/cutils.pas

@@ -787,6 +787,14 @@ uses
     end;
 
     function maybequoted(const s:string):string;
+      const
+        {$IFDEF MSWINDOWS}
+          FORBIDDEN_CHARS = ['!', '@', '#', '$', '%', '^', '&', '*', '(', ')',
+                             '{', '}', '''', '`', '~'];
+        {$ELSE}
+          FORBIDDEN_CHARS = ['!', '@', '#', '$', '%', '^', '&', '*', '(', ')',
+                             '{', '}', '''', ':', '\', '`', '~'];
+        {$ENDIF}
       var
         s1 : string;
         i  : integer;
@@ -809,12 +817,9 @@ uses
                  s1:=s1+s[i];
                end;
              else begin
-               if s[i] in ['!', '@', '#', '$', '%', '^', '&', '*', '(', ')',
-                           '{', '}', '''', ';', ':', '\', '`', '~'] then begin
+               if s[i] in FORBIDDEN_CHARS then
                  quoted:=True;
-                 s1:=s1 + s[i];
-               end else
-                 s1:=s1+s[i];
+               s1:=s1+s[i];
              end;
            end;
          end;