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 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 translaging 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. Borland's 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 file's 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