FlightGear Portability Guide
Bernie Bright (email@example.com)
28 November 1998
FlightGear is a multi-platform general aviation flight simulator. It is an
open development project in which anyone with network access and a C++ compiler
can contribute patches or new features.
The file Include/compiler.h attempts to capture the differences between
C++ compiler and STL implementations through the use of ``feature test macros''.
The file is divided into two parts. The first part contains a section for each
compiler, consisting of manifest constants specifying the features supported
or absent from the particular compiler/STL combination. The second part uses
the feature test macros to supply any missing features.
1.1 Supported compilers (more to come)
Inprise (Borland) C++ 5.02
Inprise (Borland) C++Builder 1 (5.20)
1.2 Features Tests
- Some STL implementations don't supply an auto_ptr<>
class template. Define this to provide one.
- Define this if the compiler doesn't support
default arguments in template declarations. (example)
- Some STL implementations don't have mem_fun_ref().
Define this to provide one.
- Define this if iterators don't support operator->().
- Define if compiler supports namespaces.
- Define if std:: namespace supported.
- Define if headers should be included as <iostream>
instead of <iostream.h>. Also implies that all ISO C++ standard include
files are present.
- Define if <streambuf> or <streambuf.h>
- Define if the compiler doesn't support the explicit
- Define if the compiler doesn't support the typename
- Define if the compiler doesn't support the mutable
- Define if the compiler doesn't have the bool
1.2.3 Include Files
This section deals with header file naming conventions. Some systems truncate
filenames, 8.3 being common, other systems use old or non-standard names for
some header files. We deal with the simple cases by defining macros that expand
to the appropriate filename.
In use, instead of writing #include <iostream> you write #include STD_IOSTREAM.
- => <algorithm>, ``algorithm''
- => <functional>, ``functional''
- => <iomanip>, <iomanip.h>
- => <iostream>, <iostream.h>, <iostreams.h>
- => <stdexcept> (ignore this, FlightGear doesn't use exceptions)
- => <string>
- => <strstream>, <strstream.h>
The situation becomes complicated with missing header files. <streambuf> is
a good example. In this case we must rely on FG_HAVE_STD_INCLUDES and FG_HAVE_STREAMBUF.
1.3 and the rest
1.3.1 Namespace Issues
- Stroustrup, Bjarne, The C++ Programming Programming Language, 3rd edition,
June 1997, ISBN 0-201-88954-4
- SGI Standard Template Library (STL) release 3.11
About this document ...
FlightGear Flight Simulator
This document was generated using the LaTeX2HTML translator Version 96.1 (Feb 5, 1996) Copyright © 1993, 1994, 1995, 1996, Nikos Drakos, Computer Based Learning Unit, University of Leeds.
The command line arguments were:
latex2html -show_section_numbers -split 0 fgfs-portability-guide.
The translation was initiated by Curtis L. Olson on Mon Dec 7 15:43:47 CST 1998
Curtis L. Olson
Mon Dec 7 15:43:47 CST 1998