lin_targ.pas 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. {
  2. $Id$
  3. Copyright (c) 1998 by Florian Klaempfl
  4. This unit implements some support routines for the linux target like
  5. import/export handling
  6. This program is free software; you can redistribute it and/or modify
  7. it under the terms of the GNU General Public License as published by
  8. the Free Software Foundation; either version 2 of the License, or
  9. (at your option) any later version.
  10. This program is distributed in the hope that it will be useful,
  11. but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. GNU General Public License for more details.
  14. You should have received a copy of the GNU General Public License
  15. along with this program; if not, write to the Free Software
  16. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  17. ****************************************************************************
  18. }
  19. unit lin_targ;
  20. interface
  21. uses import;
  22. type
  23. pimportliblinux=^timportliblinux;
  24. timportliblinux=object(timportlib)
  25. procedure preparelib(const s:string);virtual;
  26. procedure importprocedure(const func,module:string;index:longint;const name:string);virtual;
  27. procedure importvariable(const varname,module:string;const name:string);virtual;
  28. procedure generatelib;virtual;
  29. end;
  30. implementation
  31. uses
  32. strings,cobjects,systems,globals,
  33. files,aasm,symtable;
  34. procedure timportliblinux.preparelib(const s : string);
  35. begin
  36. end;
  37. procedure timportliblinux.importprocedure(const func,module : string;index : longint;const name : string);
  38. begin
  39. { insert sharedlibrary }
  40. current_module^.linksharedlibs.insert(SplitName(module));
  41. { do nothing with the procedure, only set the mangledname }
  42. aktprocsym^.definition^.setmangledname(name);
  43. end;
  44. procedure timportliblinux.importvariable(const varname,module:string;const name:string);
  45. begin
  46. { insert sharedlibrary }
  47. current_module^.linksharedlibs.insert(SplitName(module));
  48. { reset the mangledname and turn off the dll_var option }
  49. aktvarsym^.setmangledname(name);
  50. aktvarsym^.var_options:=aktvarsym^.var_options and (not vo_is_dll_var);
  51. end;
  52. procedure timportliblinux.generatelib;
  53. begin
  54. end;
  55. end.
  56. {
  57. $Log$
  58. Revision 1.2 1998-11-28 16:20:51 peter
  59. + support for dll variables
  60. Revision 1.1 1998/10/19 18:07:13 peter
  61. + external dll_name name func support for linux
  62. }