欢迎光临
我们一直在努力

如何将c/c++程序转译成delphi(三)_delphi教程

建站超值云服务器,限时71元/月

2.2. Unit dependencies


C and C++ use #include to include header files in another header file or a source file. Delphi refers to units (in the USES clause) instead of header files.


For example


  • D3D.H includes D3DTYPES.H, D3DCAPS.H
  • D3DTYPES.H includes DDRAW.H
  • One unit contains one translation of a header file, so incorporation of D3DTYPES.H and D3DCAPS.H is required when translating D3D.H.

Thus the translation of D3D.H (D3D.PAS) needs D3DTYPES.PAS and D3DCAPS.PAS in uses.


In Windows.pas Borland has already done a lot of work for us. Borlands windows unit contains most of the basic Windows datatypes, so any translated unit needing Windows datatypes needs the Windows unit in its uses clause.


Note: In Delphi 1.0, substitute WinProcs.pas and WinTypes.pas for Windows.pas, since these two units include for Delphi 16-bit what Delphi 32-bit defines in Windows.pas. In Delphi 2 these two files are also aliased to Windows.pas in Delphi 32-bit versions for backward compatibility. Some header files contain source which is not directly translatable into Pascal, but the header files impact on compilation must be incorporated into the translated code. For example, PSHPACK?.H contains compiler directives that are not directly translatable to Delphi; PSHPACK4.H directs the compiler to use 4-byte packing. More about this later.




Back to contents

赞(0)
版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com 特别注意:本站所有转载文章言论不代表本站观点! 本站所提供的图片等素材,版权归原作者所有,如需使用,请与原作者联系。未经允许不得转载:IDC资讯中心 » 如何将c/c++程序转译成delphi(三)_delphi教程
分享到: 更多 (0)

相关推荐

  • 暂无文章