Hello,
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.
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.
I cannot find these things in the “WhatsNew”-file.
So how can I find out, which version is needed?–
AKFoerster
Hello,
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.
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.
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
Hello,
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.
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.
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.Am Monday, dem 25. Jun 2007 schrieb Sam Lantinga:
–
AKFoerster
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?
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
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?
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.Am Wednesday, dem 27. Jun 2007 schrieb Sam Lantinga:
–
AKFoerster