Skip to content

Conversation

kavika13
Copy link
Contributor

Description

The values returned from SDL_GetCameraPermissionState are a small set (-1, 0, 1).

Those integer values are defined and set directly within SDL code, and not pulled from system APIs, so I don't think there's a chance values could fall outside that enumerated range. So this introduces an enumeration for those values.

This does modify an existing API's return type, but I think it should mostly be compatible. The integer values are not changed.

I'm not sure if this type of change is welcome or not. It's not a bug fix and it technically affects the signature of an existing API, though I think it is changed in a compatible way.

Existing Issue(s)

n/a

@sezero sezero requested review from slouken and icculus and removed request for slouken August 16, 2025 10:12
@slouken slouken added this to the 3.4.0 milestone Aug 25, 2025
@slouken
Copy link
Collaborator

slouken commented Aug 25, 2025

This actually looks like a really good change to me. @icculus, thoughts?

@icculus
Copy link
Collaborator

icculus commented Aug 25, 2025

Yeah, I'm merging it. I think we're probably okay on ABI compatibility here.

@icculus icculus merged commit 385715c into libsdl-org:main Aug 25, 2025
41 checks passed
@sezero
Copy link
Contributor

sezero commented Aug 25, 2025

One issue, at least, would be that if someone makes a function pointer for SDL_GetCameraPermissionState, he'll encounter errors changing SDL versions.

@slouken
Copy link
Collaborator

slouken commented Aug 25, 2025

One issue, at least, would be that if someone makes a function pointer for SDL_GetCameraPermissionState, he'll encounter errors changing SDL versions.

Compile time errors are fine here, it's just ABI compatibility that would be an issue.

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

Successfully merging this pull request may close these issues.

4 participants