Csound Csound-dev Csound-tekno Search About

[CSOUND-DEV:3757] New --with feature request

Date2003-12-15 10:35
Fromjpff@codemist.co.uk
Subject[CSOUND-DEV:3757] New --with feature request
Could an option --with-64bit (or similar name) be added to the
configuration stuff?  I would like to have cleaner code for
float/double representation internally, but I no longer have any
understanding on the configuration generation, not even what commands
to call.
==John ffitch

Date2003-12-15 12:55
Fromramsdell@mitre.org (John D. Ramsdell)
Subject[CSOUND-DEV:3760] Re: New --with feature request
jpff@codemist.co.uk writes:

> Could an option --with-64bit (or similar name) be added to the
> configuration stuff? 

One way to do this is to rename csound.h to csound.h.in, and modify it
as follows:

$ diff -u csound.h.orig csound.h
--- csound.h.orig	2003-12-15 07:36:06.000000000 -0500
+++ csound.h	2003-12-15 07:42:40.000000000 -0500
@@ -44,17 +44,20 @@
 #ifdef SWIG
 %module csound
 %{
-#include "sysdep.h"
-#include "cwindow.h"
 #include "opcode.h"
 #include 
 %}
 #else
-#include "sysdep.h"
-#include "cwindow.h"
 #include "opcode.h"
 #include 
 #endif
+
+	/**
+	* Basic floating point type
+	*/
+
+	typedef @MYFLT@ MYFLT;
+
 	/**
 	* ERROR DEFINITIONS
 	*/
$ 

With this approach, csound/cs.h would include csound.h, not the other
way around.  This has the nice feature that clients of the Csound API
need only have access to csound.h and opcodes.h.  There would no
longer be a need to install sysdep.h, cwindow.h, config.h, and
autoheader.h.  The problem with this approach is that it would break
the non-GNU build system makefiles.

John

Date2004-01-05 19:40
FromAnthony Kozar
Subject[CSOUND-DEV:3904] Re: New --with feature request
On 12/15/03 7:55 AM, John D. Ramsdell etched in stone:

> jpff@codemist.co.uk writes:
> 
>> Could an option --with-64bit (or similar name) be added to the
>> configuration stuff?
> 
> One way to do this is to rename csound.h to csound.h.in, and modify it
> as follows:
[...]
> +    /**
> +    * Basic floating point type
> +    */
> +
> +    typedef @MYFLT@ MYFLT;
> +
[...]
> The problem with this approach is that it would break
> the non-GNU build system makefiles.


This looks to be very useful.  I am not sure if you are still planning to do
this or if you already have, but if/when you do make changes which you know
will break the non-GNU systems, could you please be sure to do something
more like this:

#ifdef  __THIS_IS_A_GNU_SYSTEM__
    typedef @MYFLT@ MYFLT;
#else
    typedef float MYFLT;    // or whatever this was originally
#endif

Thanks :)

Anthony Kozar
anthony.kozar@utoledo.edu