[Plplot-devel] pre-processor directives question
Hello, I've moved xwinttf.c to cairo.c and now I want to add some of the other cairo devices (ps, pdf, etc..) to this file. Since some users may have Cairo but not xwindows I'm trying to use preprocessor directives in cairo.c so that they won't get error messages when xwindows does not exist, i.e.: #if defined(PLD_xwinttf) #include #include #include #include #endif However, this fails because apparently PLD_xwinttf is not defined in the context of the compilation of cairo.c. This is puzzling to me since a very similar approach seems to work fine for the gd drivers: #if defined(PLD_png) || defined(PLD_jpeg) || defined(PLD_gif) #include "plplotP.h" #include "drivers.h" ... Any idea what I might be missing? thanks, -Hazen - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ Plplot-devel mailing list Plplot-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/plplot-devel
Re: [Plplot-devel] pre-processor directives question
On 2007-06-02 21:06-0400 Hazen Babcock wrote: > > Hello, > > I've moved xwinttf.c to cairo.c and now I want to add some of the > other cairo devices (ps, pdf, etc..) to this file. Since some users > may have Cairo but not xwindows I'm trying to use preprocessor > directives in cairo.c so that they won't get error messages when > xwindows does not exist, i.e.: > > #if defined(PLD_xwinttf) > #include > #include > #include > #include > #endif > > However, this fails because apparently PLD_xwinttf is not defined in > the context of the compilation of cairo.c. This is puzzling to me > since a very similar approach seems to work fine for the gd drivers: > > #if defined(PLD_png) || defined(PLD_jpeg) || defined(PLD_gif) > > #include "plplotP.h" > #include "drivers.h" > > ... > > Any idea what I might be missing? Have you remembered to follow the gd style in cmake/modules/drivers-init.cmake? That means "xwinttf:xwinttf:OFF" must be replaced by "xcairo:cairo:OFF" "pscairo:cairo:OFF" "pdfcairo:cairo:OFF" I am guessing at the names you want for the X, ps and pdf cairo devices so that xcairo would replace your current xwinttf, etc. If you prefer a different naming convention, that is fine, but I do suggest you use the same convention for all cairo-related devices so that xwinttf should be due for a name change regardless, and PLD_xwinttf would be replaced by PLD_xcairo (or whatever) in your code, and you will have to make corresponding changes in config.h.cmake BTW, to confirm the cmake results on the PLD_* variables, you should check config.h in the top of the build tree. Alan __ Alan W. Irwin Astronomical research affiliation with Department of Physics and Astronomy, University of Victoria (astrowww.phys.uvic.ca). Programming affiliations with the FreeEOS equation-of-state implementation for stellar interiors (freeeos.sf.net); PLplot scientific plotting software package (plplot.org); the libLASi project (unifont.org/lasi); the Loads of Linux Links project (loll.sf.net); and the Linux Brochure Project (lbproject.sf.net). __ Linux-powered Science __ - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ Plplot-devel mailing list Plplot-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/plplot-devel
Re: [Plplot-devel] pre-processor directives question
On 2007-06-02 21:32-0700 Alan W. Irwin wrote: > Have you remembered to follow the gd style in > cmake/modules/drivers-init.cmake? > > That means > > "xwinttf:xwinttf:OFF" > > must be replaced by > > "xcairo:cairo:OFF" "pscairo:cairo:OFF" "pdfcairo:cairo:OFF" I now noticed that you did use this style (without the name change I was recommending). > BTW, to confirm the cmake results on the PLD_* variables, you should check > config.h in the top of the build tree. That file showed a mispelled xwinttf which I just fixed so I think everything should work for you now the way you expect. Alan __ Alan W. Irwin Astronomical research affiliation with Department of Physics and Astronomy, University of Victoria (astrowww.phys.uvic.ca). Programming affiliations with the FreeEOS equation-of-state implementation for stellar interiors (freeeos.sf.net); PLplot scientific plotting software package (plplot.org); the libLASi project (unifont.org/lasi); the Loads of Linux Links project (loll.sf.net); and the Linux Brochure Project (lbproject.sf.net). __ Linux-powered Science __ - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ Plplot-devel mailing list Plplot-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/plplot-devel