aboutsummaryrefslogtreecommitdiff
path: root/src/common
diff options
context:
space:
mode:
Diffstat (limited to 'src/common')
-rw-r--r--src/common/memory.h (renamed from src/common/linux/memory.h)13
-rw-r--r--src/common/memory_unittest.cc (renamed from src/common/linux/memory_unittest.cc)4
2 files changed, 12 insertions, 5 deletions
diff --git a/src/common/linux/memory.h b/src/common/memory.h
index 868c9cc0..a02ac578 100644
--- a/src/common/linux/memory.h
+++ b/src/common/memory.h
@@ -27,15 +27,22 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#ifndef CLIENT_LINUX_HANDLER_MEMORY_H_
-#define CLIENT_LINUX_HANDLER_MEMORY_H_
+#ifndef GOOGLE_BREAKPAD_COMMON_MEMORY_H_
+#define GOOGLE_BREAKPAD_COMMON_MEMORY_H_
#include <stdint.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/mman.h>
+#ifdef __APPLE__
+#define sys_mmap mmap
+#define sys_mmap2 mmap
+#define sys_munmap munmap
+#define MAP_ANONYMOUS MAP_ANON
+#else
#include "third_party/lss/linux_syscall_support.h"
+#endif
namespace google_breakpad {
@@ -196,4 +203,4 @@ inline void* operator new(size_t nbytes,
return allocator.Alloc(nbytes);
}
-#endif // CLIENT_LINUX_HANDLER_MEMORY_H_
+#endif // GOOGLE_BREAKPAD_COMMON_MEMORY_H_
diff --git a/src/common/linux/memory_unittest.cc b/src/common/memory_unittest.cc
index 66c83465..8b2ec410 100644
--- a/src/common/linux/memory_unittest.cc
+++ b/src/common/memory_unittest.cc
@@ -27,7 +27,7 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#include "common/linux/memory.h"
+#include "common/memory.h"
#include "testing/gtest/include/gtest/gtest.h"
using namespace google_breakpad;
@@ -74,7 +74,7 @@ TEST(WastefulVectorTest, Setup) {
TEST(WastefulVectorTest, Simple) {
PageAllocator allocator_;
- wasteful_vector<int> v(&allocator_);
+ wasteful_vector<unsigned> v(&allocator_);
for (unsigned i = 0; i < 256; ++i)
v.push_back(i);