Index: doc/help/ref-ppdcfile.html =================================================================== --- doc/help/ref-ppdcfile.html (revision 8676) +++ doc/help/ref-ppdcfile.html (working copy) @@ -98,6 +98,34 @@ case-insensitive and can be any sequence of letters, numbers, and the underscore. The value can be any valid expression.

+

Predefined Names

+ +

The following #define names are set by the PPD compiler:

+ + +

See Also

#include

Index: ppdc/ppdc-source.cxx =================================================================== --- ppdc/ppdc-source.cxx (revision 8676) +++ ppdc/ppdc-source.cxx (working copy) @@ -71,6 +71,9 @@ #include "data/hp.h" #include "data/label.h" #include "data/pcl.h" +#ifndef WIN32 +# include +#endif // !WIN32 // @@ -110,6 +113,25 @@ cond_current = cond_stack; cond_stack[0] = PPDC_COND_NORMAL; + // Add standard #define variables... +#define MAKE_STRING(x) #x + + vars->add(new ppdcVariable("CUPS_VERSION", MAKE_STRING(CUPS_VERSION))); + vars->add(new ppdcVariable("CUPS_VERSION_MAJOR", MAKE_STRING(CUPS_VERSION_MAJOR))); + vars->add(new ppdcVariable("CUPS_VERSION_MINOR", MAKE_STRING(CUPS_VERSION_MINOR))); + vars->add(new ppdcVariable("CUPS_VERSION_PATCH", MAKE_STRING(CUPS_VERSION_PATCH))); + +#ifdef WIN32 + vars->add(new ppdcVariable("PLATFORM_NAME", "Windows")); + vars->add(new ppdcVariable("PLATFORM_ARCH", "X86")); + +#else + struct utsname name; // uname information + + vars->add(new ppdcVariable("PLATFORM_NAME", name.sysname)); + vars->add(new ppdcVariable("PLATFORM_ARCH", name.machine)); +#endif // WIN32 + if (f) read_file(f, ffp); }