On Sep 24, 2013, at 9:37 AM, Tom Browder wrote:

> For example, the C key word "inline" is supported in C99 but not C89.
> tcl code uses  "inline" (as will as other C99 capabilities).  The way
> I would handle that one is use a C-only macro that DEFINEs "inline" as
> an empty string, but what is the approved solution?

Great example where we leverage the least invasive method possible that 
preserves the features.  This includes leveraging extensions.  Basically, we 
try to turn on and force an inline extension if it's actually available, but 
letting all the callers just use a vanilla 'inline' declaration.  Note, 
however, that we already do inline preprocessor trickery.

See misc/CMake/CheckCInline.cmake where we test whether inline or __inline__ or 
__inline work, and set a preprocessor definition.  This check may need to 
change to support C89 or (more likely) the check might need to be moved to a 
different place in our top-level CMakeLists.txt file or changed so that it 
tests inline availability witch whatever actual c flags we'll be using (i.e., 
with -std=c89 -- we were just talking about that issue yesterday).

I suspect you're encountering an issue because of CMake having already 
performed the test declaring one form available (inline) and then it later not 
being available due to the -std flag.  It should still be able to use 
__inline__ even with -std so it's a build system issue that should be fairly 
easy to accommodate. 

Cheers!
Sean


------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60133471&iu=/4140/ostg.clktrk
_______________________________________________
BRL-CAD Developer mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-devel

Reply via email to