48 lines
1.4 KiB
Plaintext
48 lines
1.4 KiB
Plaintext
|
|
C++ porting notes
|
|
-----------------
|
|
|
|
I originally wrote this code using gcc/g++ as the compiler.
|
|
|
|
Below is a list of changes I had to make to accomodate SGI, Sun and Intel C++
|
|
compilers.
|
|
|
|
o Explicitly instantiate templates only in g++ (#ifdef __GNUG__).
|
|
|
|
o Avoid global static data referenced by template code. These symbols
|
|
become undefined in the instantiated template functions.
|
|
I use local static data, or global extern data instead (the latter
|
|
#ifndef __GNUG__).
|
|
|
|
o Avoid non-static inline functions in templates (.cc files). They
|
|
don't get properly instantiated by Sun CC and result in undefined
|
|
symbols.
|
|
|
|
o Use Sun CC -xar option to build libraries. This includes needed
|
|
template instances in the library (see the new $(ARCHIVE) macro to
|
|
refer to the appropriate archive command).
|
|
|
|
o To work around an internal compiler error in gcc 2.7.2, I had to
|
|
add empty destructors in a few classes. Howver, I no longer use gcc 2.7.2
|
|
in testing, so current version are no longer guaranteed to work with it.
|
|
|
|
o Intel C++ doesn't support arrays of non-POD objects on the stack. I had
|
|
to replace those with matching calls to new/delete.
|
|
|
|
Compilers that work
|
|
-------------------
|
|
|
|
(as of last checking, meaning current versions may not work out of the box)
|
|
|
|
+ gcc/g++ 2.8.1, 2.95.3, 3.2 and 3.3
|
|
+ Sun SC4.0
|
|
+ SGI NCC
|
|
+ Intel C++ 7.1
|
|
|
|
Compilers that don't work on this code
|
|
--------------------------------------
|
|
|
|
- Sun SC3.0.1
|
|
- CenterLine (Sun version, as of 6/96)
|
|
|