From 51bf33beeddfd27d63be93c51a7426382d2ad1c4 Mon Sep 17 00:00:00 2001 From: Michael Meskes Date: Thu, 10 Jan 2002 10:42:54 +0000 Subject: [PATCH] Include sqlca.h automatically. --- src/interfaces/ecpg/ChangeLog | 4 ++++ src/interfaces/ecpg/preproc/ecpg.c | 4 ++-- src/interfaces/ecpg/preproc/pgc.l | 9 +++++++-- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/src/interfaces/ecpg/ChangeLog b/src/interfaces/ecpg/ChangeLog index 9e1125e093..37a2b826c0 100644 --- a/src/interfaces/ecpg/ChangeLog +++ b/src/interfaces/ecpg/ChangeLog @@ -1192,5 +1192,9 @@ Mon Jan 7 12:18:01 CET 2002 Tue Jan 8 15:16:37 CET 2002 - Fixed array pointers, no longer using void *. + +Thu Jan 10 11:12:14 CET 2002 + + - Include sqlca.h automatically. - Set ecpg version to 2.9.0. - Set library version to 3.3.0. diff --git a/src/interfaces/ecpg/preproc/ecpg.c b/src/interfaces/ecpg/preproc/ecpg.c index 2e6f85ece2..38ff21eeac 100644 --- a/src/interfaces/ecpg/preproc/ecpg.c +++ b/src/interfaces/ecpg/preproc/ecpg.c @@ -296,8 +296,8 @@ main(int argc, char *const argv[]) /* initialize lex */ lex_init(); - /* we need two includes */ - fprintf(yyout, "/* Processed by ecpg (%d.%d.%d) */\n/* These three include files are added by the preprocessor */\n#include \n#include \n#include \n#line 1 \"%s\"\n", MAJOR_VERSION, MINOR_VERSION, PATCHLEVEL, input_filename); + /* we need several includes */ + fprintf(yyout, "/* Processed by ecpg (%d.%d.%d) */\n/* These three include files are added by the preprocessor */\n#include \n#include \n#include \n#include \n#line 1 \"%s\"\n", MAJOR_VERSION, MINOR_VERSION, PATCHLEVEL, input_filename); /* and parse the source */ yyparse(); diff --git a/src/interfaces/ecpg/preproc/pgc.l b/src/interfaces/ecpg/preproc/pgc.l index e9799edcf5..d317698738 100644 --- a/src/interfaces/ecpg/preproc/pgc.l +++ b/src/interfaces/ecpg/preproc/pgc.l @@ -824,6 +824,11 @@ cppline {space}*#(.*\\{space})*.* {} yytext[i+1] = '\0'; + /* since version 2.9.0 sqlca.h is included + automatically */ + if (strcmp(yytext, "sqlca") == 0) + mmerror(PARSE_ERROR, ET_NOTICE, "sqlca.h is included automatically."); + yyin = NULL; for (ip = include_paths; yyin == NULL && ip != NULL; ip = ip->next) { @@ -846,8 +851,8 @@ cppline {space}*#(.*\\{space})*.* } if (!yyin) { - fprintf(stderr, "Error: Cannot open include file %s in line %d\n", yytext, yylineno); - exit(NO_INCLUDE_FILE); + sprintf(errortext, "Cannot open include file %s in line %d\n", yytext, yylineno); + mmerror(NO_INCLUDE_FILE, ET_FATAL, errortext); } input_filename = mm_strdup(inc_file); -- 2.39.5