summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPavan Deolasee2016-02-12 05:23:21 +0000
committerPavan Deolasee2016-10-18 09:58:30 +0000
commit3beff8169d05a2b7f8a7f1db98641dad5812e6d0 (patch)
tree690386f06c4f5f88054edd34b788bb0337ba17fd
parentaebcc1297b9dfde2b6039e67aa6cb954ba205522 (diff)
Grep for all elog messages correctly post preprocessing
-rw-r--r--src/Makefile.global.in4
-rw-r--r--src/include/utils/elog.h8
2 files changed, 8 insertions, 4 deletions
diff --git a/src/Makefile.global.in b/src/Makefile.global.in
index 65e313a7e4..29bac9aee2 100644
--- a/src/Makefile.global.in
+++ b/src/Makefile.global.in
@@ -853,7 +853,7 @@ ifeq ($(GCC), yes)
%.o : %.c
@if test ! -d $(DEPDIR); then mkdir -p $(DEPDIR); fi
$(PREPROCESS.c) -DPGXL_MSG_MODULE=$(PGXL_MSG_MODULE) -DPGXL_MSG_FILEID=$(PGXL_MSG_FILEID) -o [email protected] $< -MMD -MP -MF $(DEPDIR)/$(*F).Po
- -cat [email protected] | grep -E "do \{ if \(errstart|do \{ if \(elog_start" >> $(top_srcdir)/MSGIDS
+ -cat [email protected] | grep -E "do .*errstart|do .*elog_start" >> $(top_srcdir)/MSGIDS
$(COMPILE.c) -DPGXL_MSG_MODULE=$(PGXL_MSG_MODULE) -DPGXL_MSG_FILEID=$(PGXL_MSG_FILEID) -o $@ $< -MMD -MP -MF $(DEPDIR)/$(*F).Po
$(eval PGXL_MSG_FILEID := $(shell echo $(PGXL_MSG_FILEID) + 1 | bc))
@@ -862,7 +862,7 @@ else
ifeq ($(GCC), yes)
%.o : %.c
$(PREPROCESS.c) -DPGXL_MSG_MODULE=$(PGXL_MSG_MODULE) -DPGXL_MSG_FILEID=$(PGXL_MSG_FILEID) -o [email protected] $<
- -cat [email protected] | grep -E "do \{ if \(errstart|do \{ if \(elog_start" >> $(top_srcdir)/MSGIDS
+ -cat [email protected] | grep -E "do .*errstart|do .*elog_start" >> $(top_srcdir)/MSGIDS
$(COMPILE.c) -DPGXL_MSG_MODULE=$(PGXL_MSG_MODULE) -DPGXL_MSG_FILEID=$(PGXL_MSG_FILEID) -o $@ $<
$(eval PGXL_MSG_FILEID := $(shell echo $(PGXL_MSG_FILEID) + 1 | bc))
diff --git a/src/include/utils/elog.h b/src/include/utils/elog.h
index 4d36427ed1..a7cd8cb892 100644
--- a/src/include/utils/elog.h
+++ b/src/include/utils/elog.h
@@ -252,7 +252,9 @@ extern int getinternalerrposition(void);
#endif /* HAVE__BUILTIN_CONSTANT_P */
#else /* !HAVE__VA_ARGS */
#define elog \
- elog_start(__FILE__, __LINE__, PGXL_MSG_MODULE, PGXL_MSG_FILEID, __COUNTER__, PG_FUNCNAME_MACRO); \
+ do { \
+ elog_start(__FILE__, __LINE__, PGXL_MSG_MODULE, PGXL_MSG_FILEID, __COUNTER__, PG_FUNCNAME_MACRO); \
+ } while (0); \
elog_finish
#endif /* HAVE__VA_ARGS */
#else
@@ -278,7 +280,9 @@ extern int getinternalerrposition(void);
#endif /* HAVE__BUILTIN_CONSTANT_P */
#else /* !HAVE__VA_ARGS */
#define elog \
- elog_start(__FILE__, __LINE__, PG_FUNCNAME_MACRO); \
+ do { \
+ elog_start(__FILE__, __LINE__, PG_FUNCNAME_MACRO); \
+ } while (0); \
elog_finish
#endif /* HAVE__VA_ARGS */
#endif