CS 326 Operating Systems

preprocessor.c

DownloadView Raw

/* Example Include Guard: */
/* ---------------------- */
#ifndef _MYHEADER_H_
#define _MYHEADER_H_

... file contents ...

#endif /* _MYHEADER_H_ */


/* Example Conditional: */
/* -------------------- */
#ifdef __LINUX___
    printf("Linux\n");
#else
    printf("Unknown\n");
#endif /* __LINUX__ */