GCC/cpplib/cpp define

It basically calls do_define :

{{doxygen|http://fossies.org/dox/gcc-2.95.3/cpplib_8c.html#a441a956ac18698c4bf6a7161fc13b8bd

Source :

/* These are for -D, -U, -A. */

/* Process the string STR as if it appeared as the body of a #define.

If STR is just an identifier, define it with value 1.

If STR has anything after the identifier, then it should

be identifier=definition. */

void

cpp_define (cpp_reader *pfile, const char *str)

{

char *buf;

const char *p;

size_t count;

/* Copy the entire option so we can modify it.

Change the first "=" in the string to a space. If there is none,

tack " 1" on the end. */

count = strlen (str);

buf = (char *) alloca (count + 3);

memcpy (buf, str, count);

p = strchr (str, '=');

if (p)

buf[p - str] = ' ';

else

{

buf[count++] = ' ';

buf[count++] = '1';

}

buf[count] = '\n';

run_directive (pfile, T_DEFINE, buf, count);

}

http://fossies.org/dox/gcc-2.95.3/cpplib_8c_source.html#l00178