pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: 德哥 <digoal@126.com>
To: Michael Meskes <meskes@postgresql.org>
Cc: pgsql-bugs@postgresql.org
Subject: Re: BUG #14167: ecpg parser cann't ignore code in #ifdef ?
Date: Thu, 2 Jun 2016 09:04:21 +0800 (CST)
Message-ID: <36b4b4cd.1914.1550ea3c586.Coremail.digoal@126.com> (raw)
In-Reply-To: <1464788580.21529.25.camel@postgresql.org>
References: <20160601033334.30388.39448@wrigleys.postgresql.org>
	<1464788580.21529.25.camel@postgresql.org>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>



HI,
Thanks very much, 
Because I see EDB's document ECPGplus can parser #ifdef.  
so why postgresql community not do that? 
I think many PG user need it to adpate some enviroment (like Oracle , pg, db2, ...) in .pgc code. 


best regards , 
digoal 



--
公益是一辈子的事,I'm Digoal,Just Do It.




At 2016-06-01 21:43:00, "Michael Meskes" <meskes@postgresql.org> wrote:
>>   this is my pgc code.  
>> ...
>> #ifdef ABC
>>     err *abc;
>> #endif
>> ...
>> this is ERROR
>> ecpg -t -c -I/home/digoal/pgsql9.6/include -o t.c t.pgc
>> t.pgc:15: ERROR: unrecognized data type name "err"
>> 
>> And use #ifndef and -DABC also error. 
>> ECPG parser cann't skip code in #ifdef or #ifndef ?
>
>'#ifdef' is a C precompiler command and thus is only parsed by cpp et
>al. If you want ecpg to parse it you have to use 'exec sql ifdef'
>instead.
>
>Michael
>-- 
>Michael Meskes
>Michael at Fam-Meskes dot De, Michael at Meskes dot (De|Com|Net|Org)
>Meskes at (Debian|Postgresql) dot Org
>Jabber: michael at xmpp dot meskes dot org
>VfL Borussia! Força Barça! SF 49ers! Use Debian GNU/Linux, PostgreSQL


view thread (4+ messages)  latest in thread

Message-ID: <36b4b4cd.1914.1550ea3c586.Coremail.digoal@126.com>
Permalink:  ../36b4b4cd.1914.1550ea3c586.Coremail.digoal@126.com/
Also on:    postgresql.org/message-id/36b4b4cd.1914.1550ea3c586.Coremail.digoal@126.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: digoal@126.com, meskes@postgresql.org
  Subject: Re: BUG #14167: ecpg parser cann't ignore code in #ifdef ?
  In-Reply-To: <36b4b4cd.1914.1550ea3c586.Coremail.digoal@126.com>
  References: <20160601033334.30388.39448@wrigleys.postgresql.org> <1464788580.21529.25.camel@postgresql.org> <36b4b4cd.1914.1550ea3c586.Coremail.digoal@126.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox