aboutsummaryrefslogtreecommitdiff
path: root/src/interfaces/ecpg/test/preproc
diff options
context:
space:
mode:
authorMichael Meskes <meskes@postgresql.org>2010-03-21 10:49:52 +0000
committerMichael Meskes <meskes@postgresql.org>2010-03-21 10:49:52 +0000
commit1d66a1cca1e0ad649beba720466461b4af7fddd4 (patch)
tree5afbde57617f667d1209d39056aea760ad4e900f /src/interfaces/ecpg/test/preproc
parent6ad4249b5cde27e914acfa64a9bad268ece61fe2 (diff)
downloadpostgresql-1d66a1cca1e0ad649beba720466461b4af7fddd4.tar.gz
postgresql-1d66a1cca1e0ad649beba720466461b4af7fddd4.zip
ECPG only copied #include statements instead of processing them according to
commandline option "-i". This change fixes this and adds a test case. It also honors #include_next, although this is probably never used for embedded SQL.
Diffstat (limited to 'src/interfaces/ecpg/test/preproc')
-rw-r--r--src/interfaces/ecpg/test/preproc/Makefile2
-rw-r--r--src/interfaces/ecpg/test/preproc/strings.h1
-rw-r--r--src/interfaces/ecpg/test/preproc/strings.pgc8
3 files changed, 6 insertions, 5 deletions
diff --git a/src/interfaces/ecpg/test/preproc/Makefile b/src/interfaces/ecpg/test/preproc/Makefile
index 6d1d6294f54..3bcb63a0bab 100644
--- a/src/interfaces/ecpg/test/preproc/Makefile
+++ b/src/interfaces/ecpg/test/preproc/Makefile
@@ -24,3 +24,5 @@ array_of_struct.c: array_of_struct.pgc ../regression.h
autoprep.c: autoprep.pgc ../regression.h
$(ECPG) -r prepare -o $@ -I$(srcdir) $<
+strings.c: strings.pgc strings.h ../regression.h
+ $(ECPG) -i -o $@ -I$(srcdir) $<
diff --git a/src/interfaces/ecpg/test/preproc/strings.h b/src/interfaces/ecpg/test/preproc/strings.h
new file mode 100644
index 00000000000..4779af9881d
--- /dev/null
+++ b/src/interfaces/ecpg/test/preproc/strings.h
@@ -0,0 +1 @@
+char *s1, *s2, *s3, *s4, *s5, *s6;
diff --git a/src/interfaces/ecpg/test/preproc/strings.pgc b/src/interfaces/ecpg/test/preproc/strings.pgc
index cfea7aa034e..7d853626079 100644
--- a/src/interfaces/ecpg/test/preproc/strings.pgc
+++ b/src/interfaces/ecpg/test/preproc/strings.pgc
@@ -1,9 +1,7 @@
-#include <stdlib.h>
-
-exec sql include ../regression;
+#include "../regression.h"
exec sql begin declare section;
-char *s1, *s2, *s3, *s4, *s5, *s6;
+#include "strings.h"
exec sql end declare section;
int main(void)
@@ -25,5 +23,5 @@ int main(void)
printf("%s %s %s %s %s %s\n", s1, s2, s3, s4, s5, s6);
exec sql disconnect;
- exit (0);
+ return (0);
}