build the same source twice with different macros

2010-11-15 Thread Nicolas Bock
Hello list, I have some functions written in C that take a floating point argument, e.g. void foos (float x); void food (double x); The function bodies are basically identical except of course for the different floating point types. In order to avoid having to write redundant code, I see 2

Re: build the same source twice with different macros

2010-11-15 Thread Nick Bowler
On 2010-11-15 09:11 -0700, Nicolas Bock wrote: Hello list, I have some functions written in C that take a floating point argument, e.g. void foos (float x); void food (double x); The function bodies are basically identical except of course for the different floating point types. In

Re: build the same source twice with different macros

2010-11-15 Thread Steffen Dettmer
On Mon, Nov 15, 2010 at 5:11 PM, Nicolas Bock nicolasb...@gmail.com wrote: I have some functions written in C that take a floating point argument, e.g. void foos (float x); void food (double x); The function bodies are basically identical except of course for the different floating point

Re: build the same source twice with different macros

2010-11-15 Thread Ralf Wildenhues
Hi Nicolas, * Nicolas Bock wrote on Mon, Nov 15, 2010 at 05:11:26PM CET: (1) I can use C++ and rewrite the function header as a template. (2) I can define a macro for the preprocessor that is either defined as float or double and then compile the function source twice, the first time with $CC

Re: build the same source twice with different macros

2010-11-15 Thread Nicolas Bock
Thanks all for the suggestions. I will give it a try... nick On Mon, Nov 15, 2010 at 14:08, Ralf Wildenhues ralf.wildenh...@gmx.de wrote: Hi Nicolas, * Nicolas Bock wrote on Mon, Nov 15, 2010 at 05:11:26PM CET: (1) I can use C++ and rewrite the function header as a template. (2) I can