Here a patch to the current 5.0 CVS Branch (not the
HEAD) adding support for the SunPro CC compiler version
5.7 (Sun Studio 10).
The patch consist of 2 files. The patch file for the
existing STLport files and a new file for the unit test
The port required changes to three areas:
1) Build files:
1.1) Simple porting of the compiler options in CC.mak
1.2) I also changed the depend target by adding a
compiler specific target. This target allows the
STLport include files to be linked correctly to allow
the SunPro compiler to find them.
2) STLport include files changes:
2.1) stlport/cstdlib: Updated to allow the compiler to
find abs() and div().
2.2) stlport/config/stl_sunpro.h: Disabled
_STLP_LINK_TIME_INSTANTIATION since this nolonger works
with current files. The issue here is that a number of
defines that are required in the c versions of the
files use defines that are undefed at the end of the
include. So, when the compiler finally compiles the c
version at link time the defines are lost and the files
don't compile. Also added a minor change to allow files
that are compiled with cc to include stl_sunpro.h
without bailing out.
2.3) stlport/stl/_bvector.h: Added stl/_range_errors.h
required by an exception that can be called.
2.4) stlport/stl/_cmath.h: Changed to pull all math
functions from std namespace for SunPro compiles only.
2.5) stlport/stl/_rope.c: Removed extra semi-colons.
2.6) stlport/stl/_rope.h: Sunpro compiler had a problem
with the __ROPE_DEPTH_SIZE macro doing an addition.
Changed to a fixed value instead.
3) Unit test file changes:
3.1) test/unit/fstream_test.cpp: Added SunPro compile
to the list of compilers that don't use the
3.2) test/unit/string_test.cpp: Added Sun UI Threads to
the list of supported thread types in the test.
3.3) test/unit/valarray_test.cpp: The compiler was
having trouble finding abs(). Added a "using std::abs"
for the SunPro compiler which solved the problem.
3.4) test/unit/cppunit/cppunit_mini.h: Added additional
using statements for the str* commands.
3.5) test/unit/cppunit/test_main.cpp: Added "using
namespace std;" for the SunPro compiler.
I've built STLport with these changes on Sun Solaris
using the SunPro CC 5.7 compiler, Linux using gcc 3.2.2
, and Win2K using VC++ 7.1. All compiled succesfully.
If you have any questions just let me know.