Previous Topic Next topic Print topic


Expanding Macros and Creating String Literals

The Header-to-copy utility expands macros with parameters, using the string and concatenation operators # and ##. For example, the following #define directive:

#define DECLARE_HANDLE32(name) struct name##__ { int unused; }; \
  typedef const struct name##__ _far* name

produces no level-78 item, but if the C header then invokes the macro later, using:

DECLARE_HANDLE32(HHOOK);

it is expanded according to the rules for C and translated into the equivalent COBOL. COBOL does not provide typed pointers except for distinguishing between data and procedure pointers.

 01 HHOOK--  is typedef.
     02 unused     usage int.
 01 HHOOK   is typedef  usage data-pointer.
Previous Topic Next topic Print topic