On Saturday 01. June 2002 12:43, Sven Panne wrote:
Alastair Reid wrote:
Any time you take two large C programs/libraries and try to merge them, you're likely to run into preprocessor (or compiler) related errors like those you describe. [...]
Sad, but very true! And GHC's headers are not very nice in this respect:
panne@jeanluc:~> grep '#define [^ \t][^ \t] ' /usr/lib/ghc-5.03/include/* /usr/lib/ghc-5.03/include/PrimOps.h:#define C 0 /usr/lib/ghc-5.03/include/PrimOps.h:#define R 1 /usr/lib/ghc-5.03/include/PrimOps.h:#define C 1 /usr/lib/ghc-5.03/include/PrimOps.h:#define R 0
*gulp*
SimonM: What about a "poor man's" namespace, i.e. prefixing every macro, type, etc. with "GHC"/"ghc"? OpenGL, GLUT, GTK, etc. do a similar thing, and although it's a primitive measure, it's very effective.
Are these macros of interest outside the GHC headers themselves? If not, they should be #undef'ed as early as possible. Regards, Sven Moritz