Bug 786533. Add a comment about the purpose of XPCOM_MIN/MAX. r=ehsan
authorJeff Muizelaar <jmuizelaar@mozilla.com>
Tue, 15 Jan 2013 11:26:58 -0500
changeset 118903 9a7f61363efeb7623f7c5e19c9d1f319503bc1d4
parent 118902 c525391efd0d0141a488ff690b8fc49b00736c13
child 118904 72e34ce7fd9200a072bd20b3a7a8fe165dd8c0dc
child 118923 3dcd159e6cb53733bb4f8d96eecaeff282ad1646
push id24180
push useremorley@mozilla.com
push dateTue, 15 Jan 2013 22:58:27 +0000
treeherdermozilla-central@72e34ce7fd92 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersehsan
bugs786533
milestone21.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 786533. Add a comment about the purpose of XPCOM_MIN/MAX. r=ehsan
xpcom/string/public/nsAlgorithm.h
--- a/xpcom/string/public/nsAlgorithm.h
+++ b/xpcom/string/public/nsAlgorithm.h
@@ -20,16 +20,19 @@
 template <class T>
 inline
 T
 NS_ROUNDUP( const T& a, const T& b )
   {
     return ((a + (b - 1)) / b) * b;
   }
 
+// We use these instead of std::min/max because we can't include the algorithm
+// header in all of XPCOM because the stl wrappers will error out when included
+// in parts of XPCOM. These functions should never be used outside of XPCOM.
 template <class T>
 inline
 const T&
 XPCOM_MIN( const T& a, const T& b )
   {
     return b < a ? b : a;
   }