FlightGear Portability Guide

Bernie Bright (bbright@c031.aone.net.au)
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.

1 Introduction

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)

gcc 2.7.x
gcc 2.8.x
egcs 1.x
Inprise (Borland) C++ 5.02
Inprise (Borland) C++Builder 1 (5.20)

1.2 Features Tests

1.2.1 STL

FG_NEED_AUTO_PTR
Some STL implementations don't supply an auto_ptr<> class template. Define this to provide one.
FG_NO_DEFAULT_TEMPLATE_ARGS
Define this if the compiler doesn't support default arguments in template declarations. (example)
FG_INCOMPLETE_FUNCTIONAL
Some STL implementations don't have mem_fun_ref(). Define this to provide one.
FG_NO_ARROW_OPERATOR
Define this if iterators don't support operator->(). (example)
FG_EXPLICIT_FUNCTION_TMPL_ARGS
 
FG_MEMBER_TEMPLATES
 

1.2.2 Compiler

FG_NAMESPACES
Define if compiler supports namespaces.
FG_HAVE_STD
Define if std:: namespace supported.
FG_HAVE_STD_INCLUDES
Define if headers should be included as <iostream> instead of <iostream.h>. Also implies that all ISO C++ standard include files are present.
FG_HAVE_STREAMBUF
Define if <streambuf> or <streambuf.h> are present.
FG_CLASS_PARTIAL_SPECIALIZATION
 
FG_NEED_EXPLICIT
Define if the compiler doesn't support the explicit keyword.
FG_NEED_TYPENAME
Define if the compiler doesn't support the typename keyword.
FG_NEED_MUTABLE
Define if the compiler doesn't support the mutable keyword.
FG_NEED_BOOL
Define if the compiler doesn't have the bool type.

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.

STD_ALGORITHM
=> <algorithm>, ``algorithm''
STD_FUNCTIONAL
=> <functional>, ``functional''
STD_IOMANIP
=> <iomanip>, <iomanip.h>
STD_IOSTREAM
=> <iostream>, <iostream.h>, <iostreams.h>
STD_STDEXCEPT
=> <stdexcept> (ignore this, FlightGear doesn't use exceptions)
STD_STRING
=> <string>
STD_STRSTREAM
=> <strstream>, <strstream.h>
In use, instead of writing #include <iostream> you write #include STD_IOSTREAM.

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.

TODO

1.3 and the rest

1.3.1 Namespace Issues

FG_USING_STD(X)
 
FG_NAMESPACE(X)
 
FG_NAMESPACE_END
 
FG_USING_NAMESPACE(X)
 

1.3.2 Templates

FG_NULL_TMPL_ARGS
 
FG_TEMPLATE_NULL
 

References

1
Stroustrup, Bjarne, The C++ Programming Programming Language, 3rd edition, June 1997, ISBN 0-201-88954-4
2
SGI Standard Template Library (STL) release 3.11

About this document ...

FlightGear Flight Simulator
Portability Guide

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

Google Advertisements - Click to support FlightGear

Latest Version

v2.0.0 - 18 Feb 2010

A new major update of the FligtGear simulator. Please check the readme

Notam

Notam image file

Would all pilots try and avoid mpserver02 as its often overloaded.