lin_targ.pas 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  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. verbose,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. if name<>'' then
  43. aktprocsym^.definition^.setmangledname(name)
  44. else
  45. Message(parser_e_empty_import_name);
  46. end;
  47. procedure timportliblinux.importvariable(const varname,module:string;const name:string);
  48. begin
  49. { insert sharedlibrary }
  50. current_module^.linksharedlibs.insert(SplitName(module));
  51. { reset the mangledname and turn off the dll_var option }
  52. aktvarsym^.setmangledname(name);
  53. aktvarsym^.var_options:=aktvarsym^.var_options and (not vo_is_dll_var);
  54. end;
  55. procedure timportliblinux.generatelib;
  56. begin
  57. end;
  58. end.
  59. {
  60. $Log$
  61. Revision 1.3 1999-01-20 14:18:32 pierre
  62. * bugs related to mangledname solved
  63. - linux external without name
  64. -external procs already used
  65. (added count and is_used boolean fiels in tprocvar)
  66. Revision 1.2 1998/11/28 16:20:51 peter
  67. + support for dll variables
  68. Revision 1.1 1998/10/19 18:07:13 peter
  69. + external dll_name name func support for linux
  70. }