src/windows/native/sun/windows/alloc.h

Print this page

        

@@ -24,10 +24,15 @@
  */
 
 #ifndef _ALLOC_H_
 #define _ALLOC_H_
 
+/* Use THIS_FILE when it is available. */
+#ifndef THIS_FILE
+    #define THIS_FILE __FILE__
+#endif
+
 #include "stdhdrs.h"
 
 // By defining std::bad_alloc in a local header file instead of including
 // the Standard C++ <new> header file, we avoid making awt.dll dependent
 // on msvcp50.dll. This reduces the size of the JRE by 500kb.

@@ -125,16 +130,16 @@
         throw (std::bad_alloc);
     void * CDECL operator new(size_t size, const char *, int)
         throw (std::bad_alloc);
 
     #define safe_Malloc(size) \
-        safe_Malloc_outofmem(size, __FILE__, __LINE__)
+        safe_Malloc_outofmem(size, THIS_FILE, __LINE__)
     #define safe_Calloc(num, size) \
-        safe_Calloc_outofmem(num, size, __FILE__, __LINE__)
+        safe_Calloc_outofmem(num, size, THIS_FILE, __LINE__)
     #define safe_Realloc(memblock, size) \
-        safe_Realloc_outofmem(memblock, size, __FILE__, __LINE__)
-    #define new new(__FILE__, __LINE__)
+        safe_Realloc_outofmem(memblock, size, THIS_FILE, __LINE__)
+    #define new new(THIS_FILE, __LINE__)
 #endif /* OUTOFMEM_TEST */
 
 #define TRY \
     try { \
         entry_point(); \