Updated documentation for SDL_migration.cocci

Especially note that this can be installed and run in WSL on Windows
This commit is contained in:
Sam Lantinga 2023-01-10 07:53:38 -08:00
parent c4b471bd13
commit 69b94145d3

View file

@ -1,44 +1,34 @@
// //
// This is a coccinelle semantic patch to ease migration of your project from SDL2 to SDL3.
// //
// This is a coccinelle semantic patch (https://github.com/coccinelle/coccinelle) // It generates a patch that you can apply to your project to build for SDL3. It does not
// to ease migration of your project, from SDL2 to SDL3. // handle conceptual API changes, but it automates API name changes and function parameter
// transformations.
// //
// It generates a 'diff' of your SDL2 project, that you can apply // To install (native Ubuntu or using WSL on Windows):
// to build for SDL3. // sudo apt install coccinelle
// //
// // Apply the semantic patch to generate a patch file:
// install: // cd path/to/your/code
// $> apt-get install coccinelle // spatch --sp-file path/to/SDL_migration.cocci . >patch.txt
//
// apply the semantic patch to generate a diff file:
// $> spatch --sp-file path/to/SDL_migration.cocci . > your_diff.txt
// //
// A few options: // A few options:
// --c++=11 to parse cpp file // --c++=11 to parse cpp file
// --max-width 200 to increase line witdth of generated source // --max-width 200 to increase line witdth of generated source
// //
// patch you project (make a copy before..): // Apply the patch to your project:
// $> patch -p1 < your_diff.txt // patch -p1 <patch.txt
//
// //
// //
// ############# // #############
// What it does ? // In very short, a semantic patch is composed of two sub-blocks, like
// - all function renaming (without parameter change) as in SDL_oldnames.h
// - remove SDL_WINDOW_SHOWN
// - migrate SDL_CreateRGB* and SDL_ConvertSurface* functions
//
// #############
// In very short, a patch is composed of two sub-blocks, like
// //
// @@ // @@
// declaration // declaration
// @@ // @@
// rule / transformation // rule / transformation
// //
// So this file, is a set of many patches, mostly independant. // So this file is a set of many semantic patches, mostly independant.
// it can be incremented by inserting new patches as SDL3 api evolves.
//
// SDL_PauseAudioDevice / SDL_PlayAudioDevice // SDL_PauseAudioDevice / SDL_PlayAudioDevice