Closed
Bug 483799
Opened 16 years ago
Closed 15 years ago
unable to build ssltunnel.cpp for wince due to no std::max support
Categories
(Testing :: Mochitest, defect)
Tracking
(Not tracked)
VERIFIED
FIXED
People
(Reporter: jmaher, Assigned: hiro)
References
Details
Attachments
(1 file)
(deleted),
patch
|
Waldo
:
review+
|
Details | Diff | Splinter Review |
building xulrunner with --enable-tests for wince results in failure. This is due to:
http://mxr.mozilla.org/mozilla-central/source/testing/mochitest/ssltunnel/ssltunnel.cpp#862
we don't have a std::max available to use in the wince build. Instead, if we change this to a simple comparison it will work:
a>b?a:b
This was resolved by doing this:
#define PR_MAX(x,y) ((x)>(y)?(x):(y))
threads = PR_CreateThreadPool(PR_MAX(INITIAL_THREADS,
servers.size()*2),
PR_MAX(MAX_THREADS,
servers.size()*2),
DEFAULT_STACKSIZE);
We should consider doing this for all platforms instead of #ifdef for wince only.
Comment 1•16 years ago
|
||
Would adding
#ifdef WINCE
namespace std
{
template<typename T> inline const T& max(const T& a, const T& b)
{
return a < b ? b : a;
}
}
#endif
do the trick?
Reporter | ||
Comment 2•16 years ago
|
||
I tried building with this code. I put this at the top (after the #include) in ssltunnel.cpp and it does not build:
c:/mozilla/src/testing/mochitest/ssltunnel/ssltunnel.cpp(71) : error C2226: synt
ax error : unexpected type 'T'
c:/mozilla/src/testing/mochitest/ssltunnel/ssltunnel.cpp(71) : error C2988: unre
cognizable template declaration/definition
c:/mozilla/src/testing/mochitest/ssltunnel/ssltunnel.cpp(71) : error C2059: synt
ax error : '<cv-qualifer>'
c:/mozilla/src/testing/mochitest/ssltunnel/ssltunnel.cpp(71) : error C2059: synt
ax error : ')'
c:/mozilla/src/testing/mochitest/ssltunnel/ssltunnel.cpp(75) : error C2143: synt
ax error : missing ';' before '}'
c:/mozilla/src/testing/mochitest/ssltunnel/ssltunnel.cpp(96) : error C2143: synt
ax error : missing ';' before 'identifier'
c:/mozilla/src/testing/mochitest/ssltunnel/ssltunnel.cpp(96) : error C2332: 'str
uct' : missing tag name
c:/mozilla/src/testing/mochitest/ssltunnel/ssltunnel.cpp(96) : error C3306: '<un
named-tag>': unnamed class template is not allowed
c:/mozilla/src/testing/mochitest/ssltunnel/ssltunnel.cpp(96) : warning C4094: un
tagged 'struct' declared no symbols
c:/mozilla/src/testing/mochitest/ssltunnel/ssltunnel.cpp(96) : fatal error C1004
: unexpected end-of-file found
make[2]: *** [ssltunnel.obj] Error 2
make[2]: Leaving directory `/c/mozilla/src/objdir-wm6/xulrunner/testing/mochites
t/ssltunnel'
make[1]: *** [libs] Error 2
make[1]: Leaving directory `/c/mozilla/src/objdir-wm6/xulrunner/testing/mochites
t'
make: *** [all] Error 2
make: Leaving directory `/c/mozilla/src/objdir-wm6/xulrunner/testing/mochitest'
mozilla@MOZILLA-QA /c/mozilla/src
$
Comment 3•16 years ago
|
||
How about
#ifdef WINCE
namespace std
{
template<class T> inline const T& max(const T& a, const T& b)
{
return a < b ? b : a;
}
}
#endif
or
#ifdef WINCE
namespace std
{
template<typename T> inline T& max(T& a, T& b)
{
return a < b ? b : a;
}
}
#endif
or
#ifdef WINCE
namespace std
{
template<class T> inline T& max(T& a, T& b)
{
return a < b ? b : a;
}
}
#endif
?
Reporter | ||
Comment 4•16 years ago
|
||
All of the above fail with the same (or very similar) errors.
After hunting around, I believe we disable STL in our builds:
http://mxr.mozilla.org/mozilla-central/source/build/wince/tools/arm-wince-gcc.c#40
I am not sure if there is a reason for this. If I build with -GR instead of -GR- in the CLI, I get this:
cl : Command line warning D9025 : overriding '/GR-' with '/GR'
This is misleading, because this warning doesn't show up when I have -GR-.
Is there a need for using STL in our code? There is so little used it seems like we could remove it without many headaches.
Assignee | ||
Comment 5•16 years ago
|
||
I agree Joel' suggestion. PR_MAX might be sufficient.
Reporter | ||
Comment 6•16 years ago
|
||
I verified this patch will allow --enable-tests to build on wince
Assignee | ||
Updated•15 years ago
|
Assignee: nobody → ikezoe
Status: NEW → ASSIGNED
Assignee | ||
Updated•15 years ago
|
Attachment #376169 -
Flags: review?(jwalden+bmo)
Comment 7•15 years ago
|
||
Comment on attachment 376169 [details] [diff] [review]
A patch
I don't really like using a macro where there's a standardized way to do this, but I guess it's the only option here.
Attachment #376169 -
Flags: review?(jwalden+bmo) → review+
Assignee | ||
Updated•15 years ago
|
Keywords: checkin-needed
Reporter | ||
Comment 9•15 years ago
|
||
verified with 1.9.2 build and winmo alpha3
Status: RESOLVED → VERIFIED
You need to log in
before you can comment on or make changes to this bug.
Description
•