views:

24

answers:

1

The pycups-1.9.48 library doesn't build on Mac OS 10.6 unless I remove this ifdef:

#ifdef __SVR4
/*
 * A rudimentary emulation of getline() for systems that dont support it
 * natively.  Since this is used for PPD file reading, it assumes (possibly
 * falsely) that BUFSIZ is big enough.
 */
ssize_t
getline(char **line, size_t *linelen, FILE *fp)
{
...

I'm guessing __SVR4 gets defined somewhere in the SVR4 compilation environment so that the preprocessor knows it should include this homebrew getline implementation. What is this mechanism called? Googling for __SVR4 actually gets a lot of hits into source code and people discussing source code.

And, more generally, is there an equivalent symbol for Snow Leopard so I can make this code compile without either learning autoconf or editing it by hand?

A: 

See http://predef.sourceforge.net/index.php

AProgrammer