Including C/C++ header files containing #defines using EXEC SQL INCLUDE - Mailing list pgsql-general

From
Subject Including C/C++ header files containing #defines using EXEC SQL INCLUDE
Date
Msg-id 6A6C88E023CEAE4186002016A357161D077D6DE7@prdhqwsemlmb01.prod-am.ameritrade.com
Whole thread Raw
List 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@hs20-bc1-7.build.redhat.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

pgsql-general by date:

Previous
From: "lynnsettle@yahoo.com"
Date:
Subject: Re: customizing pg_dump together with copy.c's DoCopy function
Next
From: "Carl M. Nasal II"
Date:
Subject: PostgreSQL Server Crash using plPHP or PL/Perl