Backout 057e7ead186e (bug 714029) because of failure to build on Windows.
authorMike Hommey <mh+mozilla@glandium.org>
Tue, 10 Jan 2012 10:51:55 +0100
changeset 85319 b2447177ec5aaa7ade93fd129c5c723710d9c2e2
parent 85318 838aece95748a64bc31c93ba4696e19c77378ab3
child 85320 e9aeacb404ba444aca4d37cf7498aaef75a9c8a3
push id805
push userakeybl@mozilla.com
push dateWed, 01 Feb 2012 18:17:35 +0000
treeherdermozilla-aurora@6fb3bf232436 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs714029
milestone12.0a1
backs out057e7ead186e1b232a88210fa6be3259fa3185cc
Backout 057e7ead186e (bug 714029) because of failure to build on Windows.
toolkit/components/ctypes/tests/Makefile.in
toolkit/components/ctypes/tests/jsctypes-test.cpp
--- a/toolkit/components/ctypes/tests/Makefile.in
+++ b/toolkit/components/ctypes/tests/Makefile.in
@@ -51,16 +51,22 @@ FORCE_SHARED_LIB = 1
 NO_DIST_INSTALL = 1
 
 CPPSRCS = jsctypes-test.cpp
 
 LOCAL_INCLUDES = \
     -I$(topsrcdir)/js/src/ctypes \
     $(NULL)
 
+EXTRA_DSO_LDOPTS += \
+    $(XPCOM_STANDALONE_GLUE_LDOPTS) \
+    $(MOZALLOC_LIB) \
+    $(NSPR_LIBS) \
+    $(NULL)
+
 XPCSHELL_TESTS = unit
 
 _CHROME_TEST_FILES = \
   xpcshellTestHarnessAdaptor.js \
   ctypes_worker.js \
   test_ctypes.xul \
   $(NULL)
 
--- a/toolkit/components/ctypes/tests/jsctypes-test.cpp
+++ b/toolkit/components/ctypes/tests/jsctypes-test.cpp
@@ -35,16 +35,17 @@
  * and other provisions required by the GPL or the LGPL. If you do not delete
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 #include "jsctypes-test.h"
 #include "nsCRTGlue.h"
+#include <string.h>
 #include <math.h>
 #include <stdarg.h>
 
 template <typename T> struct ValueTraits {
   static T literal() { return static_cast<T>(109.25); }
   static T sum(T a, T b) { return a + b; }
   static T sum_many(
     T a, T b, T c, T d, T e, T f, T g, T h, T i,
@@ -155,34 +156,26 @@ get_##name##_stats(size_t* align, size_t
   *nalign = offsetof(nested_##name, b);                                        \
   *nsize = sizeof(nested_##name);                                              \
   offsets[0] = offsetof(align_##name, y);                                      \
   offsets[1] = offsetof(nested_##name, b);                                     \
   offsets[2] = offsetof(nested_##name, c);                                     \
 }
 #include "typedefs.h"
 
-template <typename T>
-PRInt32 StrLen(const T* string)
-{
-  const T *end;
-  for (end = string; *end; ++end);
-  return end - string;
-}
-
 PRInt32
 test_ansi_len(const char* string)
 {
-  return StrLen(string);
+  return PRInt32(strlen(string));
 }
 
 PRInt32
 test_wide_len(const PRUnichar* string)
 {
-  return StrLen(string);
+  return PRInt32(NS_strlen(string));
 }
 
 const char *
 test_ansi_ret()
 {
   return "success";
 }