Browse Source

* corrected mangling sheme :
cvar add Cprefix to the mixed case name whereas
export or public use direct name

pierre 27 years ago
parent
commit
27c439c940
2 changed files with 17 additions and 4 deletions
  1. 8 2
      compiler/pdecl.pas
  2. 9 2
      compiler/symsym.inc

+ 8 - 2
compiler/pdecl.pas

@@ -246,7 +246,7 @@ unit pdecl;
                   if not sc^.empty then
                   if not sc^.empty then
                    Message(parser_e_absolute_only_one_var);
                    Message(parser_e_absolute_only_one_var);
                   dispose(sc,done);
                   dispose(sc,done);
-                  Csym:=new(pvarsym,init_C(s,C_name,p));
+                  Csym:=new(pvarsym,init_C(s,target_os.Cprefix+C_name,p));
                   Csym^.fileinfo:=filepos;
                   Csym^.fileinfo:=filepos;
                   Csym^.var_options:=Csym^.var_options or vo_is_external;
                   Csym^.var_options:=Csym^.var_options or vo_is_external;
                   externals^.concat(new(pai_external,init(Csym^.mangledname,EXT_NEAR)));
                   externals^.concat(new(pai_external,init(Csym^.mangledname,EXT_NEAR)));
@@ -361,6 +361,7 @@ unit pdecl;
                       consume(ID);
                       consume(ID);
                       consume(SEMICOLON);
                       consume(SEMICOLON);
                       is_cdecl:=true;
                       is_cdecl:=true;
+                      C_name:=target_os.Cprefix+C_name;
                     end;
                     end;
                    { external }
                    { external }
                    if pattern='EXTERNAL' then
                    if pattern='EXTERNAL' then
@@ -1969,7 +1970,12 @@ unit pdecl;
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.42  1998-08-25 12:42:41  pierre
+  Revision 1.43  1998-08-25 13:09:25  pierre
+    * corrected mangling sheme :
+      cvar add Cprefix to the mixed case name whereas
+      export or public use direct name
+
+  Revision 1.42  1998/08/25 12:42:41  pierre
     * CDECL changed to CVAR for variables
     * CDECL changed to CVAR for variables
       specifications are read in structures also
       specifications are read in structures also
     + started adding GPC compatibility mode ( option  -Sp)
     + started adding GPC compatibility mode ( option  -Sp)

+ 9 - 2
compiler/symsym.inc

@@ -763,7 +763,9 @@
       { The tvarsym is necessary for 0.99.5 (PFV) }
       { The tvarsym is necessary for 0.99.5 (PFV) }
          tvarsym.init(n,p);
          tvarsym.init(n,p);
          var_options:=var_options or vo_is_C_var;
          var_options:=var_options or vo_is_C_var;
-         _mangledname:=strpnew(target_os.Cprefix+mangled);
+         { C prefix not allways added moved to
+           pdecl PM }
+         _mangledname:=strpnew(mangled);
       end;
       end;
 
 
     constructor tvarsym.load_C;
     constructor tvarsym.load_C;
@@ -1556,7 +1558,12 @@
 
 
 {
 {
   $Log$
   $Log$
-  Revision 1.35  1998-08-25 12:42:46  pierre
+  Revision 1.36  1998-08-25 13:09:26  pierre
+    * corrected mangling sheme :
+      cvar add Cprefix to the mixed case name whereas
+      export or public use direct name
+
+  Revision 1.35  1998/08/25 12:42:46  pierre
     * CDECL changed to CVAR for variables
     * CDECL changed to CVAR for variables
       specifications are read in structures also
       specifications are read in structures also
     + started adding GPC compatibility mode ( option  -Sp)
     + started adding GPC compatibility mode ( option  -Sp)