Grep for all elog messages correctly post preprocessing
authorPavan Deolasee <[email protected]>
Fri, 12 Feb 2016 05:23:21 +0000 (10:53 +0530)
committerPavan Deolasee <[email protected]>
Mon, 15 Feb 2016 18:30:08 +0000 (00:00 +0530)
src/Makefile.global.in
src/include/utils/elog.h

index 4f2f509e4d64f6f1e28706523f732abe34c4f288..d70f2007fe1db38938771d7a65ae7e7f301b05fc 100644 (file)
@@ -874,7 +874,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
        -rm -f [email protected]
        $(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))
@@ -883,7 +883,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
        -rm -f [email protected]
        $(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))
index 4d36427ed1efa4b751ae4cd87b4f27abfc507291..a7cd8cb8925993049b258de7e6a6c1106536c11d 100644 (file)
@@ -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