Peter Eisentraut píše v ne 24. 05. 2009 v 00:40 +0300:

> I think this is not the best way to do it, because it will confuse pgindent 
> and editors and such.  The DATA() macros in include/catalog have this solved; 
> see include/catalog/genbki.sh.

Attached variant with faked extern without ; which is what genbki.sh
uses.

        Zdenek

diff -Nrc pgsql.orig.9bee6bd68ed8/src/backend/utils/adt/tsquery_op.c pgsql.orig/src/backend/utils/adt/tsquery_op.c
*** pgsql.orig.9bee6bd68ed8/src/backend/utils/adt/tsquery_op.c	2009-05-25 16:45:34.594747865 +0200
--- pgsql.orig/src/backend/utils/adt/tsquery_op.c	2009-05-25 16:45:34.599072981 +0200
***************
*** 188,194 ****
  	PG_FREE_IF_COPY(b,1);						\
  												\
  	PG_RETURN_BOOL( CONDITION );				\
! }
  
  CMPFUNC(tsquery_lt, res < 0);
  CMPFUNC(tsquery_le, res <= 0);
--- 188,196 ----
  	PG_FREE_IF_COPY(b,1);						\
  												\
  	PG_RETURN_BOOL( CONDITION );				\
! }												\
! /* keep compiler quiet - no extra ; */			\
! extern int no_such_variable
  
  CMPFUNC(tsquery_lt, res < 0);
  CMPFUNC(tsquery_le, res <= 0);
diff -Nrc pgsql.orig.9bee6bd68ed8/src/backend/utils/adt/tsvector_op.c pgsql.orig/src/backend/utils/adt/tsvector_op.c
*** pgsql.orig.9bee6bd68ed8/src/backend/utils/adt/tsvector_op.c	2009-05-25 16:45:34.596082053 +0200
--- pgsql.orig/src/backend/utils/adt/tsvector_op.c	2009-05-25 16:45:34.599263998 +0200
***************
*** 172,178 ****
  	PG_FREE_IF_COPY(a,0);								\
  	PG_FREE_IF_COPY(b,1);								\
  	PG_RETURN_##ret( res action 0 );					\
! }
  
  TSVECTORCMPFUNC(lt, <, BOOL);
  TSVECTORCMPFUNC(le, <=, BOOL);
--- 172,180 ----
  	PG_FREE_IF_COPY(a,0);								\
  	PG_FREE_IF_COPY(b,1);								\
  	PG_RETURN_##ret( res action 0 );					\
! }														\
! /* keep compiler quiet - no extra ; */					\
! extern int no_such_variable
  
  TSVECTORCMPFUNC(lt, <, BOOL);
  TSVECTORCMPFUNC(le, <=, BOOL);
-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to