The SDL forums have moved to discourse.libsdl.org.
This is just a read-only archive of the previous forums, to keep old links working.


SDL Forum Index
SDL
Simple Directmedia Layer Forums
which version is needed?
Sam Lantinga
Guest

Quote:
Hello,

Quote:
encouraged by your README I've looked into the header files to find out, what functions are
supported by the libsdl. Now I have a problem. Someone else tried to compile my code and
wasn't able to do it. I thought the interface was stable in the 1.2.-series, but obviously I
was wrong. So I can't tell which version is needed for my program. Sad

Quote:
I've used quite some functions from SDL_stdinc.h. My program is especially dependant on
SDL_iconv_string.
Also SDL_RWFromConstMem from sdl_rwops.h seems to be fairly new.

Quote:
I cannot find these things in the "WhatsNew"-file.
So how can I find out, which version is needed?

You need version 1.2.11 for these things. Make sure you include SDL.h
in the files you use those functions in.

See ya!
-Sam Lantinga, Lead Software Engineer, Blizzard Entertainment
which version is needed?
Andreas K. Foerster
Guest

Am Monday, dem 25. Jun 2007 schrieb Sam Lantinga:

Quote:
Quote:
Hello,

Quote:
encouraged by your README I've looked into the header files to find out, what functions are
supported by the libsdl. Now I have a problem. Someone else tried to compile my code and
wasn't able to do it. I thought the interface was stable in the 1.2.-series, but obviously I
was wrong. So I can't tell which version is needed for my program. Sad

Quote:
I've used quite some functions from SDL_stdinc.h. My program is especially dependant on
SDL_iconv_string.
Also SDL_RWFromConstMem from sdl_rwops.h seems to be fairly new.

Quote:
I cannot find these things in the "WhatsNew"-file.
So how can I find out, which version is needed?

You need version 1.2.11 for these things. Make sure you include SDL.h
in the files you use those functions in.

:-(

Also I find it annoying that SDL_iconv can output several different error codes,
in contrast to the default iconv implementation.

Is there a more elegant way to check for an error?

| /* do the conversion */
| returncode = SDL_iconv (cd, &inbuf, &inbytesleft, &outbuf, &outbytesleft);
|
| /* check for errors */
| if (returncode == SDL_ICONV_ERROR
| || returncode == SDL_ICONV_E2BIG
| || returncode == SDL_ICONV_EILSEQ
| || returncode == SDL_ICONV_EINVAL)
| {
| /* ... */
| }

My first thought was just to check if the result is less than zero.
But size_t is unsigned on my system, so (size_t)(-1) is NOT less than zero.

--
AKFoerster
which version is needed?
Sam Lantinga
Guest

Quote:
Also I find it annoying that SDL_iconv can output several different error codes,
in contrast to the default iconv implementation.

Quote:
Is there a more elegant way to check for an error?

Hmm, that is kind of annoying. Maybe we can have you pass a pointer to an error code? That would be a 1.3 API change though...

-Sam Lantinga, Lead Software Engineer, Blizzard Entertainment
which version is needed?
Andreas K. Foerster
Guest

Am Wednesday, dem 27. Jun 2007 schrieb Sam Lantinga:

Quote:
Quote:
Also I find it annoying that SDL_iconv can output several different error codes,
in contrast to the default iconv implementation.

Quote:
Is there a more elegant way to check for an error?

Hmm, that is kind of annoying. Maybe we can have you pass a pointer to an error code? That would be a 1.3 API change though...

Sorry for the late answer.

Why not stay compatible with other implementations?
That is _one_ dedicated result for errors and a separate variable "SDL_errno" for the error
code.

To define it as (size_t)(-1) is fine even when size_t is unsigned. Then it is the maximum value.
But having just one single value for errors makes checking simpler.

--
AKFoerster