Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature request] replace SDL_RW* macros with functions for using in bindings #3181

Closed
SDLBugzilla opened this issue Feb 11, 2021 · 0 comments

Comments

@SDLBugzilla
Copy link
Collaborator

This bug report was migrated from our old Bugzilla tracker.

Reported in version: don't know
Reported for operating system, platform: All, All

Comments on the original bug report:

On 2019-03-01 06:45:11 +0000, ace wrote:

I got this bug in SDL_ttf:
https://bugzilla.libsdl.org/show_bug.cgi?id=4524
Sylvain proposed solution:
SDL_RWseek(RWops, 0, RW_SEEK_SET);

And it works, but i can use it my project, because it written in C# with SDL2-CS wrapper and there not export for macroses:
#define SDL_RWsize(ctx) (ctx)->size(ctx)
#define SDL_RWseek(ctx, offset, whence) (ctx)->seek(ctx, offset, whence)
#define SDL_RWtell(ctx) (ctx)->seek(ctx, 0, RW_SEEK_CUR)
#define SDL_RWread(ctx, ptr, size, n) (ctx)->read(ctx, ptr, size, n)
#define SDL_RWwrite(ctx, ptr, size, n) (ctx)->write(ctx, ptr, size, n)
#define SDL_RWclose(ctx) (ctx)->close(ctx)

Therefore, I suggest replacing this macros with functions so that they can be exported and used in bindings

On 2019-03-01 09:02:07 +0000, ace wrote:

Seems i'm not able to edit description:

There misprint in description:
"And it works, but i can use it my project, because it written in C# with SDL2-CS wrapper and there"
Must be
"And it works, but i CANNOT use it my project, because it written in C# with SDL2-CS wrapper and there"

On 2019-03-01 20:47:57 +0000, Sylvain wrote:

This could be added ...
but maybe:

1/ you can report that to one who does the wrapper so that it provides also the macros

2/ There is not SDL_RWseek but maybe it exposes things to call: (ctx)->seek(ctx, offset, whence)

On 2019-03-02 15:19:31 +0000, ace wrote:

I asked author of the wrapper about this, could you please read his answer here:
https://github.com/flibitijibibo/SDL2-CS/issues/156

On 2019-05-18 18:48:55 +0000, Ryan C. Gordon wrote:

Tagging a bunch of bugs with "target-2.0.10" so we have a clear list of things to address before a 2.0.10 release.

Please note that "addressing" one of these bugs might mean deciding to defer on it until after 2.0.10, or resolving it as WONTFIX, etc. This is just here to tell us we should look at it carefully, and soon.

If you have new information or feedback on this issue, this is a good time to add it to the conversation, as we're likely to be paying attention to this specific report in the next few days/weeks.

Thanks!

--ryan.

On 2019-06-09 00:43:45 +0000, Sam Lantinga wrote:

Done!
https://hg.libsdl.org/SDL/rev/302904fa669a

On 2019-06-26 12:20:35 +0000, Ozkan Sezer wrote:

(In reply to Sam Lantinga from comment # 5)

Done!
https://hg.libsdl.org/SDL/rev/302904fa669a

This makes programs using these calls and built against 2.0.10
not to work with SDL2 <= 2.0.9. (Examples include SDL libsaries.)
Is this really OK?

On 2019-06-26 13:09:05 +0000, Ryan C. Gordon wrote:

Fwiw, we did this with all the stdlib functions (SDL_strcmp and such) and no one reported problems.

On 2019-06-26 13:32:57 +0000, Ozkan Sezer wrote:

(In reply to Ryan C. Gordon from comment # 7)

Fwiw, we did this with all the stdlib functions (SDL_strcmp and such) and no
one reported problems.

Did such a thing happen after 2.0.0 release? When?

On 2019-06-26 14:35:42 +0000, Ryan C. Gordon wrote:

(In reply to Ozkan Sezer from comment # 8)

Did such a thing happen after 2.0.0 release? When?

Whoops, this happened before 2.0.0 shipped, my mistake.

Sam, it's your call. I'm reopening the bug just so we can see it in the TODO list, but if you think it's okay, I'm fine with it just being closed again.

--ryan.

On 2019-07-01 05:50:47 +0000, Sam Lantinga wrote:

Yes, SDL guarantees that binaries built with an older library will work with newer binaries, but not the reverse. If you build with newer headers you need to ship the newer library.

On 2019-07-01 09:12:19 +0000, Ozkan Sezer wrote:

(In reply to Sam Lantinga from comment # 10)

Yes, SDL guarantees that binaries built with an older library will work with
newer binaries, but not the reverse. If you build with newer headers you
need to ship the newer library.

Even if when using old apis which (silently) changed in new versions?

If you will keep this change, please document it.

On 2019-07-01 16:02:28 +0000, Sam Lantinga wrote:

Done!
https://hg.libsdl.org/SDL/rev/7b0d6ddaec9d

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant