Take libakgl 0.5.0 and rename every symbol it namespaced
0.5.0 gives every exported symbol the akgl_ prefix, which is the first libakgl release to break this project's source rather than only its ABI. The soname goes to libakgl.so.0.5 and include/akbasic/akgl.h asserts the floor. What moved here: akgl_render_bind2d is akgl_render_2d_bind, akgl_sprite_sheet_coords_for_frame is akgl_spritesheet_coords_for_frame, the renderer, camera and window globals carry the prefix, and _akgl_renderer and _akgl_camera are akgl_default_renderer and akgl_default_camera. The renames were applied by site rather than by pattern, because renderer is also a parameter name in src/sprite_akgl.c and a struct member throughout src/frontend_akgl.c -- a substitution would have rewritten both without a word. That is the same trap upstream describes hitting, and it is worth knowing that the defect behind the rename was not cosmetic: an exported global called renderer collided with a test's own variable, the executable's definition preempted the library's, and every texture load in that suite failed while the suite passed. 0.5.0 also fixes libakgl defect 26, which was one of the two reasons src/sprite_akgl.c installs its own renderfunc: akgl_actor_render took its destination height from the sprite's width, drawing a 24x21 Commodore sprite as a 24x24 square. The renderfunc stays, because the other reason has not moved -- an actor carries one scalar scale and SPRITE has separate x- and y-expand bits -- but the comments and TODO.md deviation 40 no longer claim a defect that is fixed. Every documentation figure re-renders byte-identical under the new library, which is what says the sprite and drawing paths did not move underneath them. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -36,26 +36,34 @@
|
||||
#include <akgl/version.h>
|
||||
|
||||
/*
|
||||
* The API floor is 0.3.0: akgl_render_bind2d(), akgl_audio_sweep(), and
|
||||
* akgl_Keystroke with akgl_controller_poll_keystroke() all arrived there, and
|
||||
* nothing in this target uses anything newer. The floor asserted below is
|
||||
* 0.4.0 anyway, and the difference is ABI rather than API.
|
||||
* **0.5.0 is a hard floor, API as well as ABI**, which is new: every release
|
||||
* before it moved this line for ABI reasons alone. 0.5.0 namespaced every
|
||||
* exported symbol, so the spellings this target compiles against do not exist in
|
||||
* 0.4.0 and the ones 0.4.0 had do not exist here. `akgl_render_bind2d` is
|
||||
* `akgl_render_2d_bind`, `akgl_sprite_sheet_coords_for_frame` is
|
||||
* `akgl_spritesheet_coords_for_frame`, and the `renderer`, `camera` and `window`
|
||||
* globals carry the prefix -- with `_akgl_renderer` and `_akgl_camera` now
|
||||
* `akgl_default_renderer` and `akgl_default_camera`.
|
||||
*
|
||||
* The soname carries MAJOR.MINOR while the major is 0, so 0.3 and 0.4 are
|
||||
* different ABIs *by declaration* -- libakgl's versioning policy says a 0.x
|
||||
* minor bump may break, and the soname is built to match. 0.4.0 in fact changed
|
||||
* no public struct: it is leak and overread fixes inside src/. The floor moves
|
||||
* anyway, because the alternative is deciding for ourselves which of libakgl's
|
||||
* minor releases were really compatible, and that is exactly the judgement the
|
||||
* soname exists to take away from us.
|
||||
* That rename was not cosmetic and libakgl's TODO.md says why at length: an
|
||||
* exported global called `renderer` collided with a test's own variable of the
|
||||
* same name, the executable's definition preempted the library's, and every
|
||||
* texture load in that suite failed while the suite reported success.
|
||||
*
|
||||
* What it catches is the case the soname cannot: a build against 0.3 headers
|
||||
* that happens to find a 0.4 library, or the reverse. Refused here rather than
|
||||
* The soname carries MAJOR.MINOR while the major is 0, so 0.4 and 0.5 are
|
||||
* different ABIs *by declaration* -- libakgl's versioning policy says a 0.x minor
|
||||
* bump may break, and the soname is built to match. The floor moves with every
|
||||
* one of them, because the alternative is deciding for ourselves which of
|
||||
* libakgl's minor releases were really compatible, and that is exactly the
|
||||
* judgement the soname exists to take away from us.
|
||||
*
|
||||
* What it catches is the case the soname cannot: a build against 0.4 headers
|
||||
* that happens to find a 0.5 library, or the reverse. Refused here rather than
|
||||
* at link time, because a missing symbol names a function and this names the
|
||||
* release.
|
||||
*/
|
||||
#if !AKGL_VERSION_AT_LEAST(0, 4, 0)
|
||||
#error "akbasic's libakgl adaptors require libakgl 0.4.0 or later"
|
||||
#if !AKGL_VERSION_AT_LEAST(0, 5, 0)
|
||||
#error "akbasic's libakgl adaptors require libakgl 0.5.0 or later"
|
||||
#endif
|
||||
|
||||
#include <akbasic/audio.h>
|
||||
|
||||
Reference in New Issue
Block a user