diff options
author | kaleb <empty> | 1995-06-16 14:17:33 +0000 |
---|---|---|
committer | kaleb <empty> | 1995-06-16 14:17:33 +0000 |
commit | b94989d3732f840c74ec3c4cde1f24dd44449c98 (patch) | |
tree | fc70475f1d18b32f6347d0cb9351e9f45b8f3517 /xc | |
parent | d4ff88ed87ce851b34f5c8df994bb3952cfd5caf (diff) |
XBUG 7474, make certain to correctly generate the intervening ',' when
-earlyR6bc is specified. Without it the resulting source file won't
compile.
Diffstat (limited to 'xc')
-rw-r--r-- | xc/config/util/makestrs.c | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/xc/config/util/makestrs.c b/xc/config/util/makestrs.c index ae0b8aa44..7aec92e80 100644 --- a/xc/config/util/makestrs.c +++ b/xc/config/util/makestrs.c @@ -1,4 +1,4 @@ -/* $XConsortium: makestrs.c,v 1.7 95/05/10 15:56:49 kaleb Exp kaleb $ */ +/* $XConsortium: makestrs.c,v 1.8 95/05/22 21:52:49 kaleb Exp kaleb $ */ /* @@ -211,9 +211,10 @@ static void CopyTmplProlog (tmpl, f) { char buf[1024]; static char* magic_string = X_MAGIC_STRING; + int magic_string_len = strlen (magic_string); while (fgets (buf, sizeof buf, tmpl)) { - if (strncmp (buf, magic_string, strlen (magic_string)) == 0) { + if (strncmp (buf, magic_string, magic_string_len) == 0) { return; } (void) fputs (buf, f); @@ -231,7 +232,7 @@ static void CopyTmplEpilog (tmpl, f) } static char* abistring[] = { - "Default", "Array per string", "Intel", "Intel", "SPARC", "Function" }; + "Default", "Array per string", "Intel", "Intel BC", "SPARC", "Function" }; static void WriteHeader (tagline, phile, abi) char* tagline; @@ -253,7 +254,7 @@ static void WriteHeader (tagline, phile, abi) (void) fprintf (f, "%s\n%s\n/* %s ABI version -- Do not edit */\n", - "/* $XConsortium: makestrs.c,v 1.7 95/05/10 15:56:49 kaleb Exp kaleb $ */", + "/* $XConsortium: makestrs.c,v 1.8 95/05/22 21:52:49 kaleb Exp kaleb $ */", "/* This file is automatically generated. */", abistring[abi]); @@ -326,7 +327,7 @@ static void IntelABIBCWriteSource (abi) for (t = phile->table; t; t = t->next) for (te = t->tableent; te; te = te->next) - WriteSourceLine (te, abi, 0); + WriteSourceLine (te, abi, t->next ? 1 : 0); (void) printf ("%s\n\n", "};"); if (phile->table->next) { @@ -415,12 +416,17 @@ static void WriteSource(tagline, abi) tmpl = fopen (ctmplstr, "r"); if (tmpl) CopyTmplProlog (tmpl, stdout); + else { + (void) fprintf (stderr, "Expected template %s, not found\n", + ctmplstr); + exit (1); + } } else tmpl = NULL; (void) printf ("%s\n%s\n/* %s ABI version -- Do not edit */\n", - "/* $XConsortium: makestrs.c,v 1.7 95/05/10 15:56:49 kaleb Exp kaleb $ */", + "/* $XConsortium: makestrs.c,v 1.8 95/05/22 21:52:49 kaleb Exp kaleb $ */", "/* This file is automatically generated. */", abistring[abi]); @@ -539,7 +545,11 @@ static void DoLine(buf) (void) strcpy (ctmplstr, buf + strlen (ctmpl_str) + 1); break; case X_HTMPL_TOKEN: - filecurrent->tmpl = fopen (buf + strlen (htmpl_str) + 1, "r"); + if ((filecurrent->tmpl = fopen (buf + strlen (htmpl_str) + 1, "r")) == NULL) { + (void) fprintf (stderr, + "Expected template %s, not found\n", htmpl_str); + exit (1); + } break; default: { |