Being a Good Traveler

Or, how not to stop your Allegro program from being easily portable

By Shawn Hargreaves, November 1999

As of the 3.9.x work-in-progress series which is current at the time of this writing, Allegro has been ported to DOS (djgpp and Watcom), Windows (MSVC, mingw32, and RSXNTDJ), Linux (console and X) and BeOS. By the time you read this, version 4.0 will probably be out, or perhaps even some later release with support for more different platforms. Allegro gives you the exact same library functions no matter where you are running it, and this makes it very easy to produce versions of your program for all of these systems: in theory, a simple recompile should be all the porting work required. Things are rarely quite that simple in the real world, though, so you will probably need to tweak a few things to get your program working on each new platform. This document tries to guess what the most likely problem areas will be, in hopes that you can avoid them right from the start rather than getting stuck having to do lots of fiddling later on. Some of these are Allegro things, but most are general C things: in either case, please let me know if you can think of any other problem areas that I left out!