Including C/C++ header files containing #defines using EXEC SQL INCLUDE

From: <Mitch(dot)Logue(at)tdameritrade(dot)com>
To: <pgsql-general(at)postgresql(dot)org>
Subject: Including C/C++ header files containing #defines using EXEC SQL INCLUDE
Date: 2006-07-11 21:57:49
Message-ID: 6A6C88E023CEAE4186002016A357161D077D6DE7@prdhqwsemlmb01.prod-am.ameritrade.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


Here is the problem I am trying to solve:

I have Header files (C and C++) that check to ensure you don't load them
twice by doing the following:

#ifndef MY_HDR_FILE
#define MY_HDR_FILE
Blah
Blah
Blah
#endif MY_HDR_FILE

I would like to be able to include these using EXEC SQL INCLUDE inside a
EXEC SQL BEGIN/END block, but as I have seen in my readings from the
Postgres groups and Google searches it seems that these types of
#defines are nor parsed by the Postgres pre-processor and only handled
by the C/C++ Pre-Processor (but I'd also like to point out that the only
references to this issue was from a post back in 1999, so since then,
there could have been changes that I'm just not aware of how to use --
he says hopefully). But, because I'm porting from Oracle, all my code
does this legally in Oracle (Pro*C), I'm not saying that makes it right,
but I am asking if there is a way of doing this using Postgres?

I'm building these applications using ecpg (PostgreSQL 8.1.3) 4.1.1 on a
Linux system:
Linux version 2.4.21-37.0.1.ELsmp
(bhcompile(at)hs20-bc1-7(dot)build(dot)redhat(dot)com) (gcc version 3.2.3 20030502 (Red
Hat Linux 3.2.3-54)) #1 SMP Wed Jan 11 18:44:17 EST 2006

Any assistance in this would be greatly appreciated, otherwise I am
going to have to re-write a great many header files, and then also
modify the source code that calls it so it only calls the C/C++ header
portion because I can't keep each separate program from re-loading the
header files without the #define's.

Thank you in advance

Browse pgsql-general by date

  From Date Subject
Next Message Douglas McNaught 2006-07-11 23:27:00 Re: troubleshooting 8.1.2
Previous Message Carl M. Nasal II 2006-07-11 21:43:48 PostgreSQL Server Crash using plPHP or PL/Perl