[tremor] Initial Embedded Visual Studio attempt.

Segher Boessenkool segher at koffie.nl
Fri Sep 27 16:51:19 PDT 2002



Firelight Technologies wrote:
> 
> As there is no .vcp (evc project) I made one and just slapped all the
> source files in.  It didn't work straight away due to the following
> things.
> 
> 1. endian.h doesn't exist in evc.  I don't know what to say about that
> except I commented it out and hacked in my own #defines to set the
> endian etc.

I'd be amazed if evc doesn't have any comparable header; better use
that.  But then again, maybe it doesn't have one.

> 
> 2. It fails to compile on calls to qsort because of the calling
> convention evc requires on these libraries is cdecl and the library
> seems to default to stdcall.
> I had to add _cdecl in front of 2 functions, ie
> static int _cdecl sort32a(const void *a,const void *b){
> and
> static int _cdecl icomp(const void *a,const void *b){
> Maybe this could be a #define

Erm, I don't fully understand...  Wouldn't it be much easier to just
compile everything with the calling conventions you need, instead
of just two functions?

> 
> 3. errno.h doesn't exist in evc.  I had to this to get it to compile.
> Also if I didn't take this line out the ogg wouldn't open.
> //    if(bytes==0 && errno) return(-1);
> Isnt this for stdio error checks?  for file access (im using ov
> callbacks anyway), the better solution would be to just check the return
> value of read or open or whatever and fail regardless if it returns an
> error?  (knowing exactly what it isn't going to do much)
> 
> #3 probably aint good, but it does work now. (and sounds good so far!).

errno is part of the C standard.  But it is not required for freestanding
implementations (like evc); only for hosted implementations.

So vorbisfile should probably be changed.

Note that dependence on errno is bad for a lot of other reasons as well.

> Oh and I'm getting a lot of type size mismatch warnings due to longs..
> why are these used instead of int?

An int is any convenient size; a long is required to be at least 32 bits.
We need 32 bits for a lot of stuff, so a lot of longs are used.

> I fear them especially when I come to port this onto the ps2 because
> longs are all emulated 64bit ints (function calls) and bring projects to
> their knees because they are so slow.

I consider that a bug in evc, then.  There is no reason for a compiler
to use a size > 32 bits for long ints if a 32 bit type would be (at least
as) fast.

<p>Cheers,

Segher
--- >8 ----
List archives:  http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'tremor-request at xiph.org'
containing only the word 'unsubscribe' in the body.  No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.



More information about the Tremor mailing list