Conditional Compilation Straddling Function Definitions
| kravlor | August 10, 2010 - 14:47 | ||
|---|---|---|---|
|
IP Manual:
I would appreciate the ability to have conditional compilation straddle function definitions. Motivation: I am in the process of debugging a large codebase of interdependent ThreadSafe functions. It would be very handy to be able to remove the ThreadSafe declaration from them all with a #define setting, enabling the Igor debugger. Example code using wished-for feature: #define USETHREADSAFE #if USETHREADSAFE ThreadSafe Function myFunc(var, str) #else Function myFunc(var, str) #endif Variable var String str // Function body End I'm sure others could come up with more clever uses, too. |
|||


Joined: 2007-07-19
Location: United States
There's no harm in leaving a function marked Threadsafe; you can still call it from a non-Threadsafe routine.
As far as conditional compilation straddling function definitions, I can see it being useful, but it would come at a cost: development time that could be better spent elsewhere.
--Jim Prouty
Software Engineer, WaveMetrics, Inc.