Bug 278672 can't build myspell on Solaris using SunONE Studio compiler

r=mvl, sr=mscott, added using namespace std for SunONE studio compiler.
This commit is contained in:
kyle.yuan%sun.com 2005-01-18 05:16:33 +00:00
parent 78106ba7da
commit 3f760ea415
5 changed files with 19 additions and 3 deletions

View File

@ -11,3 +11,4 @@ Changes made for mozilla:
the resulting library.
* Commented out std namespace declarations from .cpp files (using namespace std;)
* Removed #include <unistd.h> for the build system
* Some specific changes are needed for SunONE studio compiler, please refer to https://bugzilla.mozilla.org/show_bug.cgi?id=278672

View File

@ -1,6 +1,10 @@
#ifndef _AFFIXMGR_HXX_
#define _AFFIXMGR_HXX_
#ifdef __SUNPRO_CC // for SunONE Studio compiler
using namespace std;
#endif
#include "atypes.hxx"
#include "baseaffix.hxx"
#include "hashmgr.hxx"

View File

@ -15,7 +15,9 @@
static NS_DEFINE_CID(kCharsetConverterManagerCID, NS_ICHARSETCONVERTERMANAGER_CID);
static NS_DEFINE_CID(kUnicharUtilCID, NS_UNICHARUTIL_CID);
// using namespace std;
#ifdef __SUNPRO_CC // for SunONE Studio compiler
using namespace std;
#endif
// strip strings into token based on single char delimiter
// acts like strsep() but only uses a delim char and not

View File

@ -9,8 +9,9 @@
extern void mychomp(char * s);
extern char * mystrdup(const char *);
// using namespace std;
#ifdef __SUNPRO_CC // for SunONE Studio compiler
using namespace std;
#endif
// build a hash table from a munched word list

View File

@ -116,7 +116,11 @@ int SuggestMgr::map_related(const char * word, int i, char** wlst, int ns, const
for (int j = 0; j < nummap; j++) {
if (strchr(maptable[j].set,c) != 0) {
in_map = 1;
#ifdef __SUNPRO_CC // for SunONE Studio compiler
char * newword = mystrdup(word);
#else
char * newword = strdup(word);
#endif
for (int k = 0; k < maptable[j].len; k++) {
*(newword + i) = *(maptable[j].set + k);
ns = map_related(newword, (i+1), wlst, ns, maptable, nummap);
@ -403,7 +407,11 @@ int SuggestMgr::ngsuggest(char** wlst, char * word, HashMgr* pHMgr)
int thresh = 0;
char * mw = NULL;
for (int sp = 1; sp < 4; sp++) {
#ifdef __SUNPRO_CC // for SunONE Studio compiler
mw = mystrdup(word);
#else
mw = strdup(word);
#endif
for (int k=sp; k < n; k+=4) *(mw + k) = '*';
thresh = thresh + ngram(n, word, mw, NGRAM_ANY_MISMATCH);
free(mw);