Bug 735191 - shared-libraries-win32.cc fails to crosscompile on case-sensitive OSes r=ehsan
authorJacek Caban <jacek@codeweavers.com>
Thu, 15 Mar 2012 13:44:02 +0100
changeset 91300 d8cafe95ef83333b48c0f81d3965be23eec75970
parent 91299 61447dccb529ab286190cf44980946978b81b3d8
child 91301 6801ef0d83b87d9c620835718af6f89a057d0d55
push idunknown
push userunknown
push dateunknown
reviewersehsan
bugs735191
milestone14.0a1
Bug 735191 - shared-libraries-win32.cc fails to crosscompile on case-sensitive OSes r=ehsan
tools/profiler/shared-libraries-win32.cc
tools/profiler/sps_sampler.h
tools/profiler/thread_helper.h
--- a/tools/profiler/shared-libraries-win32.cc
+++ b/tools/profiler/shared-libraries-win32.cc
@@ -34,17 +34,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 <windows.h>
 #include <tlhelp32.h>
-#include <Dbghelp.h>
+#include <dbghelp.h>
 
 #include "shared-libraries.h"
 #include "nsWindowsHelpers.h"
 
 #define CV_SIGNATURE 0x53445352 // 'SDSR'
 
 struct CodeViewRecord70
 {
--- a/tools/profiler/sps_sampler.h
+++ b/tools/profiler/sps_sampler.h
@@ -37,16 +37,17 @@
  * ***** END LICENSE BLOCK ***** */
 
 #include <stdlib.h>
 #include <signal.h>
 #include "thread_helper.h"
 #include "nscore.h"
 #include "jsapi.h"
 #include "mozilla/TimeStamp.h"
+#include "mozilla/Util.h"
 
 using mozilla::TimeStamp;
 using mozilla::TimeDuration;
 
 extern mozilla::tls::key pkey_stack;
 extern mozilla::tls::key pkey_ticker;
 extern bool stack_key_initialized;
 
@@ -178,17 +179,17 @@ public:
   void addMarker(const char *aMarker)
   {
     if (mQueueClearMarker) {
       clearMarkers();
     }
     if (!aMarker) {
       return; //discard
     }
-    if (mMarkerPointer == 1024) {
+    if (mMarkerPointer == mozilla::ArrayLength(mMarkers)) {
       return; //array full, silently drop
     }
     mMarkers[mMarkerPointer] = aMarker;
     STORE_SEQUENCER();
     mMarkerPointer++;
   }
 
   // called within signal. Function must be reentrant
@@ -207,17 +208,17 @@ public:
   void clearMarkers()
   {
     mMarkerPointer = 0;
     mQueueClearMarker = false;
   }
 
   void push(const char *aName)
   {
-    if (mStackPointer >= 1024) {
+    if (mStackPointer >= mozilla::ArrayLength(mStack)) {
       mDroppedStackEntries++;
       return;
     }
 
     // Make sure we increment the pointer after the name has
     // been written such that mStack is always consistent.
     mStack[mStackPointer] = aName;
     // Prevent the optimizer from re-ordering these instructions
--- a/tools/profiler/thread_helper.h
+++ b/tools/profiler/thread_helper.h
@@ -46,17 +46,17 @@
   // # include <windef.h>
   // # include <winbase.h>
   // Unfortunately, even including these headers causes
   // us to add a bunch of ugly to our namespace. e.g #define CreateEvent CreateEventW
 extern "C" {
 __declspec(dllimport) void * __stdcall TlsGetValue(unsigned long);
 __declspec(dllimport) int __stdcall TlsSetValue(unsigned long, void *);
 __declspec(dllimport) unsigned long __stdcall TlsAlloc();
-};
+}
 #else
 # include <pthread.h>
 # include <signal.h>
 #endif
 
 namespace mozilla {
 
 #if defined(XP_WIN)