From 759f98085a633cb8264f5fcc851865318455f028 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Fri, 23 Dec 2022 15:08:30 -0800 Subject: [PATCH] Used rename_api.py to add previously renamed symbols to SDL_oldnames.h --- WhatsNew.txt | 4 ++++ docs/README-migration.md | 14 ++++++++------ include/SDL3/SDL_oldnames.h | 18 ++++++++++++++++++ 3 files changed, 30 insertions(+), 6 deletions(-) diff --git a/WhatsNew.txt b/WhatsNew.txt index f9019f41f..37981ed48 100644 --- a/WhatsNew.txt +++ b/WhatsNew.txt @@ -11,6 +11,10 @@ General: * SDL_GetWindowWMInfo() returns a standard int result code instead of SDL_bool, and takes SDL_SYSWM_CURRENT_VERSION as a new third parameter * The preprocessor symbol __MACOSX__ has been renamed __MACOS__ * The preprocessor symbol __IPHONEOS__ has been renamed __IOS__ +* The following macros have been renamed: + * RW_SEEK_CUR -> SDL_RW_SEEK_CUR + * RW_SEEK_END -> SDL_RW_SEEK_END + * RW_SEEK_SET -> SDL_RW_SEEK_SET * The following functions have been renamed: * Removed the following functions from the API, see docs/README-migration.md for details: * SDL_CalculateGammaRamp() diff --git a/docs/README-migration.md b/docs/README-migration.md index aa61b0d28..b34439877 100644 --- a/docs/README-migration.md +++ b/docs/README-migration.md @@ -118,14 +118,14 @@ Furthermore, the different `SDL_*RunApp()` functions (SDL_WinRtRunApp, SDL_GDKRu have been unified into just `int SDL_RunApp(int argc, char* argv[], void * reserved)` (which is also used by additional platforms that didn't have a SDL_RunApp-like function before). -## SDL_platform.h - -The preprocessor symbol __MACOSX__ has been renamed __MACOS__, and __IPHONEOS__ has been renamed __IOS__ - ## SDL_pixels.h SDL_CalculateGammaRamp has been removed, because SDL_SetWindowGammaRamp has been removed as well due to poor support in modern operating systems (see [SDL_video.h](#sdl_videoh)). +## SDL_platform.h + +The preprocessor symbol __MACOSX__ has been renamed __MACOS__, and __IPHONEOS__ has been renamed __IOS__ + ## SDL_render.h SDL_GetRenderDriverInfo() has been removed, since most of the information it reported were @@ -142,8 +142,10 @@ to decide for you. ## SDL_rwops.h -The RW_SEEK_CUR, RW_SEEK_END and RW_SEEK_SET macros have been renamed SDL_RW_SEEK_CUR, SDL_RW_SEEK_END and SDL_RW_SEEK_SET. - +The following macros have been renamed: +* RW_SEEK_CUR => SDL_RW_SEEK_CUR +* RW_SEEK_END => SDL_RW_SEEK_END +* RW_SEEK_SET => SDL_RW_SEEK_SET SDL_RWread and SDL_RWwrite (and SDL_RWops::read, SDL_RWops::write) have a different function signature in SDL3. diff --git a/include/SDL3/SDL_oldnames.h b/include/SDL3/SDL_oldnames.h index 2da92c121..093cfd187 100644 --- a/include/SDL3/SDL_oldnames.h +++ b/include/SDL3/SDL_oldnames.h @@ -34,8 +34,26 @@ */ #ifdef SDL_ENABLE_OLD_NAMES +/* ##SDL_platform.h */ +#define __IPHONEOS__ __IOS__ +#define __MACOSX__ __MACOS__ + +/* ##SDL_rwops.h */ +#define RW_SEEK_CUR SDL_RW_SEEK_CUR +#define RW_SEEK_END SDL_RW_SEEK_END +#define RW_SEEK_SET SDL_RW_SEEK_SET + #else /* !SDL_ENABLE_OLD_NAMES */ +/* ##SDL_platform.h */ +#define __IPHONEOS__ __IPHONEOS___renamed___IOS__ +#define __MACOSX__ __MACOSX___renamed___MACOS__ + +/* ##SDL_rwops.h */ +#define RW_SEEK_CUR RW_SEEK_CUR_renamed_SDL_RW_SEEK_CUR +#define RW_SEEK_END RW_SEEK_END_renamed_SDL_RW_SEEK_END +#define RW_SEEK_SET RW_SEEK_SET_renamed_SDL_RW_SEEK_SET + #endif /* SDL_ENABLE_OLD_NAMES */ #endif /* SDL_oldnames_h_ */