Преглед на файлове

* external name 'C_var';
export name 'intern_C_var';
cdecl;
cdecl;external;
are now supported only with -Sv switch

pierre преди 27 години
родител
ревизия
c248434392
променени са 2 файла, в които са добавени 22 реда и са изтрити 7 реда
  1. 11 4
      compiler/pdecl.pas
  2. 11 3
      compiler/symsym.inc

+ 11 - 4
compiler/pdecl.pas

@@ -1668,7 +1668,7 @@ unit pdecl;
                 begin
                    if not(is_record) then
                      consume(token);
-                   if do_absolute and (token=ID) and
+                   if support_c_var and do_absolute and (token=ID) and
                       ((pattern='EXPORT') or (pattern='EXTERNAL')
                       or (pattern='CDECL')) then
                      begin
@@ -1695,6 +1695,10 @@ unit pdecl;
                         { external and export need a name after }
                         if not is_cdecl then
                           begin
+                             if (token=ID) and (pattern='NAME') then
+                               consume(ID)
+                             else
+                               Comment(V_error,' name keyword expected here ');
                              if (token<>CCHAR) and (token<>CSTRING) then
                                consume(CSTRING);
                              C_name:=pattern;
@@ -1877,9 +1881,12 @@ unit pdecl;
 end.
 {
   $Log$
-  Revision 1.26  1998-06-12 10:32:30  pierre
-    * column problem hopefully solved
-    + C vars declaration changed
+  Revision 1.27  1998-06-12 16:15:34  pierre
+    * external name 'C_var';
+      export name 'intern_C_var';
+      cdecl;
+      cdecl;external;
+      are now supported only with -Sv switch
 
   Revision 1.25  1998/06/09 16:01:45  pierre
     + added procedure directive parsing for procvars

+ 11 - 3
compiler/symsym.inc

@@ -1027,7 +1027,7 @@
             { the data filed is generated in parser.pas
               with a tobject_FIELDNAME variable }
             { this symbol can't be loaded to a register }
-            var_options:=var_options or vo_regable;
+            var_options:=var_options and not vo_regable;
          end
        else if not(read_member) then
          begin
@@ -1070,7 +1070,8 @@
                 if cs_debuginfo in aktswitches then
                    concatstabto(bsssegment);
 {$endif GDB}
-                if (cs_smartlink in aktswitches) then
+                if (cs_smartlink in aktswitches) or
+                   ((var_options and vo_is_c_var)<>0) then
                   bsssegment^.concat(new(pai_datablock,init_global(mangledname,l)))
                 else
                   bsssegment^.concat(new(pai_datablock,init(mangledname,l)));
@@ -1741,7 +1742,14 @@
 
 {
   $Log$
-  Revision 1.8  1998-06-11 10:11:59  peter
+  Revision 1.9  1998-06-12 16:15:35  pierre
+    * external name 'C_var';
+      export name 'intern_C_var';
+      cdecl;
+      cdecl;external;
+      are now supported only with -Sv switch
+
+  Revision 1.8  1998/06/11 10:11:59  peter
     * -gb works again
 
   Revision 1.7  1998/06/09 16:01:51  pierre