aboutsummaryrefslogtreecommitdiff
path: root/src/share/demo/jvmti/hprof/debug_malloc.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/share/demo/jvmti/hprof/debug_malloc.h')
-rw-r--r--src/share/demo/jvmti/hprof/debug_malloc.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/share/demo/jvmti/hprof/debug_malloc.h b/src/share/demo/jvmti/hprof/debug_malloc.h
index 6b6b4c6b73..d74ff608b2 100644
--- a/src/share/demo/jvmti/hprof/debug_malloc.h
+++ b/src/share/demo/jvmti/hprof/debug_malloc.h
@@ -59,6 +59,11 @@
#include <stdlib.h>
#include <string.h>
+/* Use THIS_FILE when it is available. */
+#ifndef THIS_FILE
+ #define THIS_FILE __FILE__
+#endif
+
/* The real functions behind the macro curtains. */
void *debug_malloc(size_t, const char *, int);
@@ -71,10 +76,10 @@ void debug_free(void *, const char *, int);
void debug_malloc_verify(const char*, int);
#undef malloc_verify
-#define malloc_verify() debug_malloc_verify(__FILE__, __LINE__)
+#define malloc_verify() debug_malloc_verify(THIS_FILE, __LINE__)
void debug_malloc_police(const char*, int);
#undef malloc_police
-#define malloc_police() debug_malloc_police(__FILE__, __LINE__)
+#define malloc_police() debug_malloc_police(THIS_FILE, __LINE__)
#endif