mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-05-27 15:09:11 +00:00
Renamed atomic functions to match SDL 3.0 naming convention
This will also allow us to cleanly add atomic operations for other types in the future.
This commit is contained in:
parent
f3e419596b
commit
8d223b3037
64 changed files with 496 additions and 472 deletions
|
@ -558,7 +558,7 @@ JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM *vm, void *reserved)
|
|||
register_methods(env, "org/libsdl/app/SDLAudioManager", SDLAudioManager_tab, SDL_arraysize(SDLAudioManager_tab));
|
||||
register_methods(env, "org/libsdl/app/SDLControllerManager", SDLControllerManager_tab, SDL_arraysize(SDLControllerManager_tab));
|
||||
register_methods(env, "org/libsdl/app/HIDDeviceManager", HIDDeviceManager_tab, SDL_arraysize(HIDDeviceManager_tab));
|
||||
SDL_AtomicSet(&bAllowRecreateActivity, false);
|
||||
SDL_SetAtomicInt(&bAllowRecreateActivity, false);
|
||||
|
||||
return JNI_VERSION_1_4;
|
||||
}
|
||||
|
@ -761,16 +761,16 @@ JNIEXPORT int JNICALL SDL_JAVA_INTERFACE(nativeCheckSDLThreadCounter)(
|
|||
static void SDLCALL SDL_AllowRecreateActivityChanged(void *userdata, const char *name, const char *oldValue, const char *hint)
|
||||
{
|
||||
if (SDL_GetStringBoolean(hint, false)) {
|
||||
SDL_AtomicSet(&bAllowRecreateActivity, true);
|
||||
SDL_SetAtomicInt(&bAllowRecreateActivity, true);
|
||||
} else {
|
||||
SDL_AtomicSet(&bAllowRecreateActivity, false);
|
||||
SDL_SetAtomicInt(&bAllowRecreateActivity, false);
|
||||
}
|
||||
}
|
||||
|
||||
JNIEXPORT jboolean JNICALL SDL_JAVA_INTERFACE(nativeAllowRecreateActivity)(
|
||||
JNIEnv *env, jclass jcls)
|
||||
{
|
||||
return SDL_AtomicGet(&bAllowRecreateActivity);
|
||||
return SDL_GetAtomicInt(&bAllowRecreateActivity);
|
||||
}
|
||||
|
||||
JNIEXPORT void JNICALL SDL_JAVA_INTERFACE(nativeInitMainThread)(
|
||||
|
@ -1690,7 +1690,7 @@ static bool Android_JNI_ExceptionOccurred(bool silent)
|
|||
jthrowable exception;
|
||||
|
||||
// Detect mismatch LocalReferenceHolder_Init/Cleanup
|
||||
SDL_assert(SDL_AtomicGet(&s_active) > 0);
|
||||
SDL_assert(SDL_GetAtomicInt(&s_active) > 0);
|
||||
|
||||
exception = (*env)->ExceptionOccurred(env);
|
||||
if (exception != NULL) {
|
||||
|
@ -2539,7 +2539,7 @@ SDL_bool SDL_RequestAndroidPermission(const char *permission, SDL_RequestAndroid
|
|||
}
|
||||
|
||||
static SDL_AtomicInt next_request_code;
|
||||
info->request_code = SDL_AtomicAdd(&next_request_code, 1);
|
||||
info->request_code = SDL_AddAtomicInt(&next_request_code, 1);
|
||||
|
||||
info->callback = cb;
|
||||
info->userdata = userdata;
|
||||
|
@ -2798,7 +2798,7 @@ bool Android_JNI_OpenFileDialog(
|
|||
|
||||
// Setup data
|
||||
static SDL_AtomicInt next_request_code;
|
||||
mAndroidFileDialogData.request_code = SDL_AtomicAdd(&next_request_code, 1);
|
||||
mAndroidFileDialogData.request_code = SDL_AddAtomicInt(&next_request_code, 1);
|
||||
mAndroidFileDialogData.userdata = userdata;
|
||||
mAndroidFileDialogData.callback = callback;
|
||||
|
||||
|
@ -2808,7 +2808,7 @@ bool Android_JNI_OpenFileDialog(
|
|||
(*env)->DeleteLocalRef(env, filtersArray);
|
||||
if (!success) {
|
||||
mAndroidFileDialogData.callback = NULL;
|
||||
SDL_AtomicAdd(&next_request_code, -1);
|
||||
SDL_AddAtomicInt(&next_request_code, -1);
|
||||
SDL_SetError("Unspecified error in JNI");
|
||||
|
||||
return false;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue