Next: , Up: C   [Index]


Preprocessor

ctpp, the ctalk Preprocessor

Information about ctpp, the Ctalk preprocessor, is contained in its Texinfo manual, ctpp.info.

The preprocessor is compatible with GNU cpp and supports ISO C99 preprocessing features. This allows you to include C header files in Ctalk programs and class libraries. Ctalk caches macros from include files, so it can use, in the GNU compiler’s terminology, include once header files.

If you have a header file called, for example, myheader.h, you would wrap the definitions with the following preprocessor directives.


#ifndef _MYHEADER_H
#define _MYHEADER_H
.
. <Your definitions appear here.>
.
#endif /* _MYHEADER_H */

This makes certain that the preprocessor defines macros, data types, and other library definitions only once, no matter how many times the input includes the header file.