OS4.0 compared to OS4.1+

4 posts / 0 new
Last post
mritter0
mritter0's picture
Offline
Last seen: 2 months 2 weeks ago
Joined: 2014-04-21 21:15
OS4.0 compared to OS4.1+
Is it safe to say that if someone running OS4.0, but has been doing all the AmiUpdates for the classes (up to v53+), would not have a problem running a program intended for OS4.1+? What I am getting at is if I use a gadget class tag the requires v53 of the class, like CLICKTAB_CloseImage, is it backwards compatible with OS4.0? Then will the class function, say FreeClickTabList() (requires 53.11), still work on OS4.0? Just asking because if I use the latest version of tags/functions will I lose all of OS4.0 users from using my program?
thomas
thomas's picture
Offline
Last seen: 6 days 4 hours ago
Joined: 2011-05-16 14:23
AmiUpdate does not exist in
AmiUpdate does not exist in 4.0 and I doubt that you can update 4.0 with components from 4.1. Anyway, if a function was added to a later version of as library or class, calling it on an earlier version does simply crash. That's why OpenLibrary and OpenClass functions have a version check. If a function was added without increasing the version number (not only the revision number), then this is very bad practice by the maintainer. It should always be possible to get the required function just by a version check. Example:
  1. /* I need version 40 of graphics.library because it contains the WriteChunkyPixels function: */
  2.  
  3. GfxBase = OpenLibrary ("graphics.library",40);
  4.  
  5. if (!GfxBase)
  6. fail ("this program requires graphics.library V40");
  7.  
  8. WriteChunkyPixels (...);
  9.  
  10. CloseLibrary (GfxBase);
  1. /* I can work with version 39 but benefit from version 40: */
  2.  
  3. GfxBase = OpenLibrary ("graphics.library",39);
  4.  
  5. if (!GfxBase)
  6. fail ("this program requires graphics.library V39 or higher");
  7.  
  8. if (GfxBase->lib_Version >= 40)
  9. WriteChunkyPixels(...);
  10. else
  11. {
  12. change_alignment_of_array_to_meet_the_requirements(...);
  13. WritePixelArray8(...);
  14. }
  15.  
  16. CloseLibrary (GfxBase);
salass00
salass00's picture
Offline
Last seen: 3 weeks 1 day ago
Joined: 2011-02-03 11:27
AmiUpdate does not exist in
AmiUpdate does not exist in 4.0 and I doubt that you can update 4.0 with components from 4.1.
You also need a registered AmigaOS 4.1 in order to download updates.
If a function was added without increasing the version number (not only the revision number), then this is very bad practice by the maintainer. It should always be possible to get the required function just by a version check.
It makes no sense to increase the version number every time a new tag or function is added. Checking only version number as you propose only "worked" in C= days when new OS releases were few and far between and there was no AmiUpdate for updating individual OS components. For checking against minimum version and revision numbers there is the LIB_IS_AT_LEAST(lib,vers,rev) convenience macro in "exec/libraries.h".
mritter0
mritter0's picture
Offline
Last seen: 2 months 2 weeks ago
Joined: 2014-04-21 21:15
No AmiUpdate on 4.0 pretty
No AmiUpdate on 4.0 pretty much clears it all up. Assumed as much, just making sure.
Log in or register to post comments