/[bison]/bison/src/files.c
ViewVC logotype

Diff of /bison/src/files.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.51.2.10 by akim, Tue Oct 2 16:17:41 2001 UTC revision 1.51.2.11 by akim, Thu Nov 1 18:29:36 2001 UTC
# Line 86  stringappend (const char *string1, const Line 86  stringappend (const char *string1, const
86  }  }
87    
88    
89  /*---------------------------------------------------------------.  /*-----------------------------------------------------------------.
90  |  Computes the macro name used to avoid double inclusion in the |  | Computes the macro name used to avoid double inclusion in the    |
91  |  header of the parser and store it in header_macro_name.       |  | header of the parser and store it in header_macro_name.  Be sure |
92  `---------------------------------------------------------------*/  | to produce valid CPP names (don't start with digit, remain       |
93    | alphanumerical + underscore).                                    |
94    `-----------------------------------------------------------------*/
95    
96  static char *  static char *
97  compute_header_macro (void)  compute_header_macro (void)
98  {  {
99      const char *prefix = "BISON_";
100    char *macro_name, *cp;    char *macro_name, *cp;
101    
102    if (spec_defines_file)    if (spec_defines_file)
103      macro_name = xstrdup (spec_defines_file);      {
104          macro_name = XMALLOC (char,
105                                strlen (prefix) +
106                                strlen (spec_defines_file) + 1);
107          cp = stpcpy (macro_name, prefix);
108          cp = stpcpy (cp, spec_defines_file);
109        }
110    else    else
111      {      {
112        macro_name = XMALLOC (char,        macro_name = XMALLOC (char,
113                                strlen (prefix) +
114                              strlen (base_name) +                              strlen (base_name) +
115                              strlen (header_extension) + 1);                              strlen (header_extension) + 1);
116          cp = stpcpy (macro_name, prefix);
117        stpcpy (macro_name, base_name);        cp = stpcpy (cp, base_name);
118        strcat (macro_name, header_extension);        cp = stpcpy (cp, header_extension);
119      }      }
120    
121    for (cp = macro_name; *cp; ++cp)    for (cp = macro_name; *cp; ++cp)

Legend:
Removed from v.1.51.2.10  
changed lines
  Added in v.1.51.2.11

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26