[pypy-commit] pypy default: define VMPROF_WINDOWS if it has not already been defined (only on windows), this should simplify the vmprof setup

plan_rich pypy.commits at gmail.com
Mon Apr 3 14:00:13 EDT 2017


Author: Richard Plangger <planrichi at gmail.com>
Branch: 
Changeset: r90936:a73be2d612a2
Date: 2017-04-03 13:58 -0400
http://bitbucket.org/pypy/pypy/changeset/a73be2d612a2/

Log:	define VMPROF_WINDOWS if it has not already been defined (only on
	windows), this should simplify the vmprof setup

diff --git a/pypy/module/_vmprof/test/test_direct.py b/pypy/module/_vmprof/test/test_direct.py
--- a/pypy/module/_vmprof/test/test_direct.py
+++ b/pypy/module/_vmprof/test/test_direct.py
@@ -1,4 +1,4 @@
-
+import sys
 import py
 try:
     import cffi
@@ -7,6 +7,7 @@
 
 from rpython.rlib import rvmprof
 srcdir = py.path.local(rvmprof.__file__).join("..", "src")
+shareddir = srcdir.join('shared')
 
 ffi = cffi.FFI()
 ffi.cdef("""
@@ -43,7 +44,7 @@
 }
 
 
-""" + open(str(srcdir.join("shared/vmprof_get_custom_offset.h"))).read(), include_dirs=[str(srcdir)])
+""" + open(str(srcdir.join("shared/vmprof_get_custom_offset.h"))).read(), include_dirs=[str(srcdir), str(shareddir)])
 
 class TestDirect(object):
     def test_infrastructure(self):
diff --git a/rpython/rlib/rvmprof/src/shared/vmprof.h b/rpython/rlib/rvmprof/src/shared/vmprof.h
--- a/rpython/rlib/rvmprof/src/shared/vmprof.h
+++ b/rpython/rlib/rvmprof/src/shared/vmprof.h
@@ -29,6 +29,12 @@
 
 #define DYN_JIT_FLAG 0xbeefbeef
 
+#ifdef _WIN32
+#ifndef VMPROF_WINDOWS
+#define VMPROF_WINDOWS
+#endif
+#endif
+
 #ifdef VMPROF_UNIX
 #define VMP_SUPPORTS_NATIVE_PROFILING
 #endif
diff --git a/rpython/rlib/rvmprof/src/shared/vmprof_get_custom_offset.h b/rpython/rlib/rvmprof/src/shared/vmprof_get_custom_offset.h
--- a/rpython/rlib/rvmprof/src/shared/vmprof_get_custom_offset.h
+++ b/rpython/rlib/rvmprof/src/shared/vmprof_get_custom_offset.h
@@ -1,5 +1,7 @@
 #pragma once
 
+#include "vmprof.h"
+
 #ifdef VMPROF_WINDOWS
 #include "msiinttypes/stdint.h"
 #else


More information about the pypy-commit mailing list