Bug 712254 - Use StdInt.h in platform.h r=BenWa
authorJacek Caban <jacek@codeweavers.com>
Fri, 23 Dec 2011 13:21:35 +0100
changeset 84611 ad5b4312fc7d024e0b7637c475a2274a28b25cb0
parent 84610 1ea94dacda6845923be7fe9f6aa584319ca287c8
child 84612 ff350b65a6167bc9ddde60ac182588ecc92935e6
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)
reviewersBenWa
bugs712254
milestone12.0a1
Bug 712254 - Use StdInt.h in platform.h r=BenWa
tools/profiler/sps/platform-linux.cc
tools/profiler/sps/platform-macos.cc
tools/profiler/sps/platform-win32.cc
tools/profiler/sps/platform.h
tools/profiler/sps/v8-support.h
--- a/tools/profiler/sps/platform-linux.cc
+++ b/tools/profiler/sps/platform-linux.cc
@@ -29,17 +29,16 @@
 #include <fcntl.h>      // open
 #include <unistd.h>     // sysconf
 #ifdef __GLIBC__
 #include <execinfo.h>   // backtrace, backtrace_symbols
 #endif  // def __GLIBC__
 #include <strings.h>    // index
 #include <errno.h>
 #include <stdarg.h>
-#include "v8-support.h"
 #include "platform.h"
 
 #include <string.h>
 #include <stdio.h>
 
 // Real time signals are not supported on android.
 // This behaves as a standard signal.
 #define SIGNAL_SAVE_PROFILE 42
--- a/tools/profiler/sps/platform-macos.cc
+++ b/tools/profiler/sps/platform-macos.cc
@@ -20,17 +20,16 @@
 #include <sys/types.h>
 #include <sys/sysctl.h>
 #include <stdarg.h>
 #include <stdlib.h>
 #include <string.h>
 #include <errno.h>
 
 
-#include "v8-support.h"
 #include "platform.h"
 
 // this port is based off of v8 svn revision 9837
 
 // XXX: this is a very stubbed out implementation
 // that only supports a single Sampler
 struct SamplerRegistry {
   static void AddActiveSampler(Sampler *sampler) {
--- a/tools/profiler/sps/platform-win32.cc
+++ b/tools/profiler/sps/platform-win32.cc
@@ -1,14 +1,13 @@
 // Copyright (c) 2006-2011 The Chromium Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
 #include <windows.h>
-#include "v8-support.h"
 #include "platform.h"
 #include <process.h>
 
 
 class Sampler::PlatformData : public Malloced {
  public:
   // Get a handle to the calling thread. This is the thread that we are
   // going to profile. We need to make a copy of the handle because we are
--- a/tools/profiler/sps/platform.h
+++ b/tools/profiler/sps/platform.h
@@ -3,40 +3,31 @@
 // found in the LICENSE file.
 
 #ifdef ANDROID
 #include <android/log.h>
 #else
 #define __android_log_print(a, ...)
 #endif
 
+#include "mozilla/StdInt.h"
 #include "mozilla/Util.h"
 #include "mozilla/unused.h"
 #include "mozilla/TimeStamp.h"
 #include "v8-support.h"
 #include <vector>
 #define ASSERT(a) MOZ_ASSERT(a)
 #ifdef ANDROID
 #define ENABLE_SPS_LEAF_DATA
 #define LOG(text) __android_log_print(ANDROID_LOG_ERROR, "profiler", "%s", text);
 #else
 #define LOG(text) printf("Profiler: %s\n", text)
 #endif
 
-#ifdef _MSC_VER
- typedef __int8 byte;
- typedef __int32 int32_t;
- typedef unsigned __int32 uint32_t;
- typedef __int64 int64_t;
- typedef unsigned __int64 uint64_t;
-#else
- #include <stdint.h>
- typedef uint8 byte;
-#endif
-typedef byte* Address;
+typedef uint8_t* Address;
 
 class MapEntry {
 public:
   MapEntry(unsigned long aStart, unsigned long aEnd, unsigned long aOffset, char *aName)
     : mStart(aStart)
     , mEnd(aEnd)
     , mOffset(aOffset)
     , mName(strdup(aName))
--- a/tools/profiler/sps/v8-support.h
+++ b/tools/profiler/sps/v8-support.h
@@ -46,21 +46,17 @@
 #elif defined(_M_IX86) || defined(__i386__) || defined(__i386)
 #define V8_HOST_ARCH_IA32 1
 #elif defined(__ARMEL__)
 #define V8_HOST_ARCH_ARM 1
 #else
 #warning Please add support for your architecture in chromium_types.h
 #endif
 
-#ifdef _WIN32
- typedef __int32 Atomic32;
-#else
- typedef int32_t Atomic32;
-#endif
+typedef int32_t Atomic32;
 
 #if defined(V8_HOST_ARCH_X64) || defined(V8_HOST_ARCH_IA32) || defined(V8_HOST_ARCH_ARM)
 inline void NoBarrier_Store(volatile Atomic32* ptr, Atomic32 value) {
   *ptr = value;
 }
 #endif