Closed GWRon closed 3 years ago
I assume this has to do with the ".cpp" file.
blitz_app.c:
void bbWriteStdout( BBString *t ){
char *p=bbStringToUTF8String( t );
fprintf( stdout,"%s",p );
fflush( stdout );
bbMemFree(p);
}
-> compiles fine
blitz_string.c defines it as this:
unsigned char *bbStringToUTF8String( BBString *str ){
int len=str->length;
size_t buflen = len * 4 + 1;
unsigned char *buf=(unsigned char*)bbMemAlloc( buflen );
return bbStringToUTF8StringBuffer(str, buf, &buflen);
}
So maybe it is something which became more "strict" (aka an error now) with newer GCCs ?
in brl.mod/volumes.mod/haikuglue.cpp this is done so too - so maybe in newer GCCs + Haiku, this might be an issue too:
BVolume * bmx_volumes_bvolume_new(BBString * name) {
char * n = bbStringToUTF8String(name);
Possibly a simple cast:
char *p=(char *)bbStringToUTF8String( bbAppTitle );
is all what is needed but ... maybe it should be written in a "c++" manner as suggested by some on stackoverflow. Am not sure about potential side effects (overflow).
char *p=reinterpret_cast<char*>( bbStringToUTF8String( bbAppTitle ) );
Maybe a GCC-version thing?