Issue 796 - OpenOffice relys on #define STLPORT_VERION < 321 to determine which STL is available
Summary: OpenOffice relys on #define STLPORT_VERION < 321 to determine which STL is av...
Status: CLOSED FIXED
Alias: None
Product: Build Tools
Classification: Code
Component: code (show other issues)
Version: 625
Hardware: All All
: P3 Trivial (vote)
Target Milestone: ---
Assignee: sander_traveling
QA Contact: issues@www
URL:
Keywords:
Depends on: 785 1096
Blocks:
  Show dependency tree
 
Reported: 2001-04-26 09:34 UTC by zeroj
Modified: 2003-12-06 14:52 UTC (History)
2 users (show)

See Also:
Issue Type: ENHANCEMENT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments
/tools/bootstrp/allmake.hxx : Solution to different issue, cause by same problem (550 bytes, patch)
2001-04-26 09:36 UTC, zeroj
no flags Details | Diff
tools/bootstrp/allmake.cxx : as above (528 bytes, patch)
2001-04-26 09:37 UTC, zeroj
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this issue.
Description zeroj 2001-04-26 09:34:46 UTC
I have found 93 uses of STLPORT_VERSION as a method of distiguishing between 
the old and the new STL standard.

#if SLTPORT_VERSION < 321
#include <abc.h>
#else
#include <abc>
#endif

This code is aimed at STLport, and does not allow native STL's to be used.

The bigger problem for SGI is that o32 binaries (for older SGI hardware) can 
only be compiled using the old STL, and hence this should be a build option.

% find * -name '*xx' | xargs grep STLPORT_VERSION
basic/source/classes/sbxmod.cxx:#if STLPORT_VERSION < 321
bridges/source/cpp_uno/gcc2_solaris_sparc/cpp2uno.cxx:#if STLPORT_VERSION<321
bridges/source/cpp_uno/gcc2_solaris_sparc/except.cxx:#if STLPORT_VERSION<321
bridges/source/cpp_uno/gcc2_macosx_powerpc/except.cxx:#if STLPORT_VERSION<321
bridges/source/cpp_uno/gcc2_linux_powerpc/cpp2uno.cxx:#if STLPORT_VERSION<321
bridges/source/cpp_uno/gcc2_linux_powerpc/except.cxx:#if STLPORT_VERSION<321
bridges/source/cpp_uno/gcc2_linux_intel/cpp2uno.cxx:#if STLPORT_VERSION<321
bridges/source/cpp_uno/gcc2_linux_intel/except.cxx:#if STLPORT_VERSION<321
bridges/source/cpp_uno/gcc2_netbsd_sparc/cpp2uno.cxx:#if STLPORT_VERSION<321
bridges/source/cpp_uno/gcc2_netbsd_sparc/except.cxx:#if STLPORT_VERSION<321
codemaker/source/codemaker/global.cxx:#if STLPORT_VERSION < 400
connectivity/source/inc/java/lang/Object.hxx:#if STLPORT_VERSION>=321
extensions/source/javavm/jvmargs.hxx:#if STLPORT_VERSION < 321
extensions/source/address/inc/propset.hxx:#if STLPORT_VERSION<321
extensions/source/address/core/services.cxx:#if STLPORT_VERSION<321
extensions/source/address/core/parser.cxx:#if STLPORT_VERSION<321
extensions/source/address/core/address.cxx:#if STLPORT_VERSION<321
extensions/source/addressbook/propset.hxx:#if STLPORT_VERSION < 321
extensions/source/addressbook/services.cxx:#if STLPORT_VERSION < 321
extensions/source/addressbook/parser.cxx:#if STLPORT_VERSION < 321
extensions/source/addressbook/address.cxx:#if STLPORT_VERSION < 321
extensions/source/plugin/unx/unxmgr.cxx:#if STLPORT_VERSION>=321
extensions/source/plugin/base/evtlstnr.cxx:#if STLPORT_VERSION>=321
extensions/source/plugin/base/nfuncs.cxx:#if STLPORT_VERSION>=321
extensions/source/plugin/base/plcom.cxx:#if STLPORT_VERSION>=321
extensions/source/plugin/base/service.cxx:#if STLPORT_VERSION>=321
extensions/source/plugin/base/context.cxx:#if STLPORT_VERSION>=321
extensions/source/plugin/base/manager.cxx:#if STLPORT_VERSION>=321
package/source/zippackage/AttributeList.cxx:#if STLPORT_VERSION<321
rdbmaker/source/codemaker/global.cxx:#if STLPORT_VERSION < 400
registry/source/regmap.hxx:#if STLPORT_VERSION<321
sc/source/ui/docshell/docsh4.cxx:#if STLPORT_VERSION>=321
sc/source/core/tool/token.cxx:#if STLPORT_VERSION<321
setup2/source/custom/jvmsetup/jvmscan.hxx:#if STLPORT_VERSION < 321
so3/source/dialog/plfilter.cxx:#if STLPORT_VERSION>=321
sot/source/sdstor/stgcache.cxx:#if STLPORT_VERSION<321
svtools/inc/itemset.hxx:#if STLPORT_VERSION<321
svtools/source/items/itemset.cxx:#if STLPORT_VERSION>=321
svx/source/form/fmshimp.cxx:#if STLPORT_VERSION>=321
sw/source/ui/app/appenv.cxx:#if STLPORT_VERSION>=321
sw/source/ui/app/applab.cxx:#if STLPORT_VERSION>=321
sw/source/ui/dbui/dbmgr.cxx:#if STLPORT_VERSION>=321
sw/source/ui/wrtsh/wrtsh1.cxx:#if STLPORT_VERSION>=321
sw/source/ui/shells/textsh2.cxx:#if STLPORT_VERSION>=321
sw/source/ui/uiview/viewprt.cxx:#if STLPORT_VERSION>=321
sw/source/ui/wizard/wizgo2.cxx:#if STLPORT_VERSION>=321
tools/bootstrp/allmake.hxx:#if STLPORT_VERSION < 321
tools/bootstrp/allmake.hxx:#endif       // STLPORT_VERSION < 321
tools/bootstrp/allmake.cxx:#if STLPORT_VERSION < 321
tools/bootstrp/allmake.cxx:#endif       // STLPORT_VERSION < 321
transex3/source/wrdtrans.cxx:#if STLPORT_VERSION < 321
transex3/source/wrdtrans.cxx:#endif     // STLPORT_VERSION < 321
unoidl/backends/beurd/burdutil.cxx:#if STLPORT_VERSION>=321
vcl/unx/source/app/vsound.hxx:#if STLPORT_VERSION>=321
vos/source/evtque.cxx:#if STLPORT_VERSION<321
xml2cmp/source/x2cclass/x2cstl.hxx:#if STLPORT_VERSION < 321
xml2cmp/source/x2cclass/x2cstl.hxx:#endif       // STLPORT_VERSION < 321
Comment 1 zeroj 2001-04-26 09:36:50 UTC
Created attachment 178 [details]
/tools/bootstrp/allmake.hxx : Solution to different issue, cause by same problem
Comment 2 zeroj 2001-04-26 09:37:29 UTC
Created attachment 179 [details]
tools/bootstrp/allmake.cxx : as above
Comment 3 sander_traveling 2001-04-26 11:26:39 UTC
Actually, consistently using

#if defined(STLPORT_VERSION) && STLPORT_VERSION < 321

sounds to be better than just testing for STLPORT_VERSION < 321 and won't break
any existing setups. 

Another thing to check for are any accourences of

#if STLPORT_VERSION == 400

There is no reason to change these:

bridges/source/cpp_uno/gcc2_solaris_sparc/cpp2uno.cxx:#if STLPORT_VERSION<321
bridges/source/cpp_uno/gcc2_solaris_sparc/except.cxx:#if STLPORT_VERSION<321
bridges/source/cpp_uno/gcc2_macosx_powerpc/except.cxx:#if STLPORT_VERSION<321
bridges/source/cpp_uno/gcc2_linux_powerpc/cpp2uno.cxx:#if STLPORT_VERSION<321
bridges/source/cpp_uno/gcc2_linux_powerpc/except.cxx:#if STLPORT_VERSION<321
bridges/source/cpp_uno/gcc2_linux_intel/cpp2uno.cxx:#if STLPORT_VERSION<321
bridges/source/cpp_uno/gcc2_linux_intel/except.cxx:#if STLPORT_VERSION<321
bridges/source/cpp_uno/gcc2_netbsd_sparc/cpp2uno.cxx:#if STLPORT_VERSION<321
bridges/source/cpp_uno/gcc2_netbsd_sparc/except.cxx:#if STLPORT_VERSION<321

as they are architecture specific. Otherwise, patch(es) are welcome.
Comment 4 jens-heiner.rechtien 2001-04-26 12:05:57 UTC
Hi,

I introduced the STLPORT_VERSION conditional long ago as a help for transition 
from STLPort 3.2.1 to STLPort 4.0. At that time we were not certain that 
STLPort 4.0 would work as expected so we needed a way out.

This stuff is obsolete. We will never ever go back to STLPort 3.2.1 so the 
conditional should simply be removed and only new style header names should be 
used.

John, do I understand you right that you need old style headers like vector.h 
for the o32 binaries? Than we are in deep trouble since most new code use new 
style header and the std namespace.

The whole STLport usage is a bit delicate since there are many potential 
conflicts with native headers. On the other hand, just using the native STL 
implementations were not an option when we introduced the STLPort. The quality 
of the implementations were far to diverging at that time.

I doubt that there is an easy way to support native STL implementations (maybe 
with the exception of the SGI STL), at least not old style ones. Additionally 
we have some dependencies on non standard stuff like slist, rope and hash_map.

I would welcome any effort to make our usage of the STL more standard 
conforming, although I don't think that this should go as far as to remove the 
usage of the aforementioned non standard containers.

Heiner

--
Jens-Heiner Rechtien
Release Engineer
Star Office Software Entwicklungs GmbH
Jens-Heiner.Rechtien@germany.sun.com

Comment 5 zeroj 2001-04-26 13:06:13 UTC
> John, do I understand you right that you need old style headers 
> like vector.h for the o32 binaries? Than we are in deep trouble 
> since most new code use new style header and the std namespace.

Very necessary.  The logical question is who in there right mind would run OO 
on a SGI machine that only supports o32 binaries.  If SGI's plans for OO are 
anything like Mozilla (which I am also working on) then n32 is the only 
binaries we are working towards, with mips3 arch as prefered.

> The quality of the implementations were far to diverging at that time.

Fair point.

> Additionally we have some dependencies on non standard stuff like slist, rope 
and hash_map.

I agree, not using these would be a far worse loss for efficiency than it would 
gain in portability.
Given that STLport is Open Source, any platform wishing to use there native STL 
can add these if necessary.

I would presume we could do a complex check in configure.in to ensure that the 
required containers are present.
Comment 6 Unknown 2001-04-26 15:03:45 UTC
reassign
Comment 7 sander_traveling 2001-04-26 18:51:09 UTC
So, what happens to this issue? 

Do I get a large & clean patch that takes out all STL_VERSION or should I take
them out assuming those who need will submit 

#ifdef XXX
#include <oldheader.h>
#endif

pathces? Or? 
Comment 8 zeroj 2001-04-26 23:43:15 UTC
I cant seem to see the problems in OO627, so perhaps we should just leave it 
for now ... other fires to fight?
Comment 9 sander_traveling 2001-04-26 23:54:03 UTC
Sure. I'm closing it for now as 'worksforme' and going home to sleep. If it
comes back, we can either reopen it or have a brand new issue. just helps to
keep stuff that is urgent and at hand in view.
Comment 10 zeroj 2001-05-03 22:49:09 UTC
Going thru and checking OO627B from the tree, I have run into this problem 
again.  Personally I would like to see these #if 's left in the tree, and 
modified as per these two patches for two reasons.
Firstly so that programmers continue the practise of explicitly indicating they 
are using the new stl.
Secondly to existing old stl around in case SGI needs to work on o32 
binaries/libraries, or to allow another platform which is having problems with 
STLport but have and older style STL, attempt to get this to work.

It would be nice if these two went into the tree sooner than later, however I 
agree we should tackle all these at once, and so I am willing to create a patch 
for all these files to add the #if defined (STLPORT_VERSION)

CC -KPIC -c -n32 -ansi -ptused -OPT:Olimit=20523 -I. -I. -I../inc -I../inc -
I../unx/inc -I../unxirxm3.pro/inc -I. -
I/projects/sise/mozilla/devel/workpits/oo/OO627B/workarea/sal/inc -
I/projects/sise/mozilla/devel/workpits/oo/OO627B/workarea/vos/inc  -I. -
I/projects/sise/mozilla/devel/workpits/oo/OO627B/workarea/solver/627/unxirxm3.pr
o/inc -
I/projects/sise/mozilla/devel/workpits/oo/OO627B/workarea/solver/627/unxirxm3.pr
o/inc/external -
I/projects/sise/mozilla/devel/workpits/oo/OO627B/workarea/solenv/unxirxm3/inc -
I/projects/sise/mozilla/devel/workpits/oo/OO627B/workarea/solenv/inc -
I/projects/sise/mozilla/devel/workpits/oo/OO627B/workarea/res -I/usr/include -
I/usr/include/CC/stlport -
I/projects/sise/mozilla/devel/workpits/oo/OO627B/workarea/solenv/inc/Xp31 -
I/projects/sise/mozilla/devel/workpits/oo/java_1.2.2/usr/java/include -
I/projects/sise/mozilla/devel/workpits/oo/java_1.2.2/usr/java/include/irix -
I/projects/sise/mozilla/devel/workpits/oo/java_1.2.2/usr/java/include/native_thr
eads/include -I/usr/include -I/usr/include     -I. -I../res -I. -O   -LANG:std -
woff 
1009,1021,1107,1110,1155,1171,1183,1185,1188,1233,1234,1257,1440,1516,1681,1682 
     -DIRIX -DUNX -DVCL -DC730 -DC730 -DMIPS -DTF_UCB -DENABLEUNICODE -
DTF_SDBAPI -DTF_FILTER -DCVER=C730 -D_USE_NAMESPACE -DVCL -D_STD_NO_NAMESPACE -
D_VOS_NO_NAMESPACE -D_UNO_NO_NAMESPACE -D__DMAKE -DUNIX -DSUPD=627 -
DBUILD=6382 -DSOLAR_PLUGIN -DVCL -DSO3 -DPRODUCT -DNDEBUG -DPRODUCT_FULL -
DOPTIMIZE -DEXCEPTIONS_OFF -DCUI  -DSRC627 -DBOOTSTRAPPER -DTF_ONE51 -
D_TOOLS_STRINGLIST -DMULTITHREAD  -
o ../unxirxm3.pro/obj/allmake.o /projects/sise/mozilla/devel/workpits/oo/OO627B/
workarea/tools/bootstrp/allmake.cxx
cc-1005 CC: ERROR File 
= /projects/sise/mozilla/devel/workpits/oo/OO627B/workarea/tools/bootstrp/allmak
e.hxx, Line = 70
  The source file "tools/presys.h" is unavailable.

  #include <tools/presys.h>
                           ^

1 catastrophic error detected in the compilation 
of "/projects/sise/mozilla/devel/workpits/oo/OO627B/workarea/tools/bootstrp/allm
ake.cxx".
Comment 11 sander_traveling 2001-05-04 19:01:38 UTC
allmake.cxx patch applied in 1.5.4.1
allmake.hxx patch applied in 1.3.4.1


Comment 12 foskey 2003-03-18 10:37:51 UTC
Verifying issue is no longer around.  Please close.
Comment 13 nickb 2003-03-18 21:56:13 UTC
Closing