2008-10-27 Pedro Alves <pedro@codesourcery.com>
+ * cp-name-parser.y: Include defs.h instead of config.h.
+ (parse_escape): Rename to ...
+ (cp_parse_escape): ... this.
+ (yylex): Update.
+ (xfree) [TEST_CPNAMES]: New.
+
+2008-10-27 Pedro Alves <pedro@codesourcery.com>
+
* CONTRIBUTE: Mention autoconf 2.59 and configure.ac instead of
2.13 and configure.in.
%{
-#include "config.h"
+#include "defs.h"
#include <stdio.h>
#include <stdlib.h>
after the zeros. A value of 0 does not mean end of string. */
static int
-parse_escape (const char **string_ptr)
+cp_parse_escape (const char **string_ptr)
{
int target_char;
int c = *(*string_ptr)++;
if (c == '?')
return 0177;
else if (c == '\\')
- target_char = parse_escape (string_ptr);
+ target_char = cp_parse_escape (string_ptr);
else
target_char = c;
lexptr++;
c = *lexptr++;
if (c == '\\')
- c = parse_escape (&lexptr);
+ c = cp_parse_escape (&lexptr);
else if (c == '\'')
{
yyerror ("empty character constant");
return c;
}
+/* When this file is built as a standalone program, xmalloc comes from
+ libiberty --- in which case we have to provide xfree ourselves. */
+
+void
+xfree (void *ptr)
+{
+ if (ptr != NULL)
+ free (ptr);
+}
+
int
main (int argc, char **argv)
{