| Hi,
I've been trying to compile CSound5 on my AMD64 based Linux distro
lately, but
never had it work due to an error message, and CSound claiming it tried
to allocate
a negative amount of memory.
After some debugging, I found the problem is in the value returned in
opcode_size()
in the FLINKAGE macro in H/csdl.h. The value 0x80000000 is used to
represent a negative
value. Unfortunately this assumes a 32 bit long, while most 64 bit
systems have 64 bit longs,
so csoundLoadExternal doesn't detect the value as being negative.
This can be solved by including limits.h and using LONG_MIN instead of
0x80000000.
After this fix CSound seems to work nicely. A patch for this trivial fix
is included.
Thom
--- csdl.h 2005-02-22 00:57:12.566061960 +0100
+++ csdl_new.h 2005-02-22 00:46:35.133966368 +0100
@@ -22,6 +22,7 @@
*/
#include "cs.h"
+#include
#undef ksmps
#undef esr
@@ -449,8 +450,8 @@
#define FLINKAGE long opcode_size(void) \
{ \
- if (localops==NULL) return 0x80000000; \
- else return ((sizeof(localops))|0x80000000); \
+ if (localops==NULL) return LONG_MIN; \
+ else return ((sizeof(localops))|LONG_MIN); \
} \
\
OENTRY *opcode_init(ENVIRON *xx) \
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net |