Search Postgresql Archives

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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

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@xxxxxxxxxxxxxxxxxxxxxxxxxxx) (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


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux