--- old/make/common/Defs.gmk 2012-09-06 09:37:39.000000000 -0700 +++ new/make/common/Defs.gmk 2012-09-06 09:37:39.000000000 -0700 @@ -542,6 +542,21 @@ CXXFLAGS_$(VARIANT)/BYFILE = $(CXXFLAGS_$(VARIANT)/$(@F)) \ $(CXXFLAGS_$(VARIANT)$(CXXFLAGS_$(VARIANT)/$(@F))) +# Command line define to provide basename of file being compiled to source. +# The C macro THIS_FILE can replace the use of __FILE__ in the source +# files for the current filename being compiled. +# The value of the __FILE__ macro is unpredictable and can be anything +# from a relative path to a full path, THIS_FILE will be more consistent.. +# The THIS_FILE macro will always be just the basename of the file being +# compiled. +# Different string literals in the the object files makes it difficult to +# compare shared libraries from different builds. +# +# NOTE: If the THIS_FILE macro is actually expanded while in an included +# source file, it will not return the name of the included file. +# +CPP_THIS_FILE = -DTHIS_FILE='"$( $@ + @$(ECHO) $(sort $(FILES_o)) > $@ ifndef LOCAL_RESOURCE_FILE @$(ECHO) $(OBJDIR)/$(LIBRARY).res >> $@ endif @@ -256,9 +256,9 @@ @$(ECHO) "STATS: LIBRARY=$(LIBRARY), PRODUCT=$(PRODUCT), OPTIMIZATION_LEVEL=$(OPTIMIZATION_LEVEL)" @$(ECHO) "Rebuilding $@ because of $?" ifeq ($(LIBRARY), fdlibm) - $(AR) $(ARFLAGS) $@ $(FILES_o) + $(AR) $(ARFLAGS) $@ $(sort $(FILES_o)) else # LIBRARY - $(LINKER) $(SHARED_LIBRARY_FLAG) -o $@ $(FILES_o) $(LDLIBS) + $(LINKER) $(SHARED_LIBRARY_FLAG) -o $@ $(sort $(FILES_o)) $(LDLIBS) @$(call binary_file_verification,$@) ifeq ($(WRITE_LIBVERSION),true) $(MCS) -d -a "$(FULL_VERSION)" $@ --- old/make/common/Program.gmk 2012-09-06 09:37:44.000000000 -0700 +++ new/make/common/Program.gmk 2012-09-06 09:37:43.000000000 -0700 @@ -242,7 +242,7 @@ $(ECHO) Rebuilding $@ because of $$1 $$2 $$3 $$4 $$5 $$6 $${7:+...}; @$(MKDIR) -p $(TEMPDIR) $(LINK_PRE_CMD) $(CC) $(CC_OBJECT_OUTPUT_FLAG)$@ $(LDFLAGS) \ - $(FILES_o) $(THREADLIBS) $(LDLIBS) + $(sort $(FILES_o)) $(THREADLIBS) $(LDLIBS) ifeq ($(findstring privileged, $(INFO_PLIST_FILE)), privileged) -codesign -s openjdk_codesign $@ endif @@ -372,8 +372,6 @@ VERSION_DEFINES += -DJDK_MAJOR_VERSION='"$(JDK_MAJOR_VERSION)"' \ -DJDK_MINOR_VERSION='"$(JDK_MINOR_VERSION)"' - - $(OBJDIR)/main.$(OBJECT_SUFFIX): $(LAUNCHER_SHARE_SRC)/bin/main.c @$(prep-target) $(COMPILE.c) $(CC_OBJECT_OUTPUT_FLAG)$(OBJDIR)/main.$(OBJECT_SUFFIX) \ --- old/src/macosx/native/com/apple/laf/ScreenMenu.m 2012-09-06 09:37:45.000000000 -0700 +++ new/src/macosx/native/com/apple/laf/ScreenMenu.m 2012-09-06 09:37:45.000000000 -0700 @@ -37,7 +37,11 @@ #import "ThreadUtilities.h" #import "CMenuBar.h" - +/* Use THIS_FILE when it is available. */ +#ifndef THIS_FILE + #define THIS_FILE __FILE__ +#endif + static JNF_CLASS_CACHE(sjc_ScreenMenu, "com/apple/laf/ScreenMenu"); static jint ns2awtModifiers(NSUInteger keyMods) { @@ -97,7 +101,7 @@ { if (self.javaObjectWrapper == nil) { #ifdef DEBUG - NSLog(@"_javaObject is NULL: (%s - %s : %d)", __FILE__, __FUNCTION__, __LINE__); + NSLog(@"_javaObject is NULL: (%s - %s : %d)", THIS_FILE, __FUNCTION__, __LINE__); #endif return; } @@ -115,7 +119,7 @@ { if (self.javaObjectWrapper == nil) { #ifdef DEBUG - NSLog(@"_javaObject is NULL: (%s - %s : %d)", __FILE__, __FUNCTION__, __LINE__); + NSLog(@"_javaObject is NULL: (%s - %s : %d)", THIS_FILE, __FUNCTION__, __LINE__); #endif return; } @@ -133,7 +137,7 @@ { if (self.javaObjectWrapper == nil) { #ifdef DEBUG - NSLog(@"_javaObject is NULL: (%s - %s : %d)", __FILE__, __FUNCTION__, __LINE__); + NSLog(@"_javaObject is NULL: (%s - %s : %d)", THIS_FILE, __FUNCTION__, __LINE__); #endif return; } --- old/src/macosx/native/com/sun/media/sound/PLATFORM_API_MacOSX_MidiOut.c 2012-09-06 09:37:47.000000000 -0700 +++ new/src/macosx/native/com/sun/media/sound/PLATFORM_API_MacOSX_MidiOut.c 2012-09-06 09:37:46.000000000 -0700 @@ -26,6 +26,11 @@ //#define USE_ERROR //#define USE_TRACE +/* Use THIS_FILE when it is available. */ +#ifndef THIS_FILE + #define THIS_FILE __FILE__ +#endif + #if USE_PLATFORM_MIDI_OUT == TRUE #include "PLATFORM_API_MacOSX_MidiUtils.h" @@ -128,7 +133,7 @@ case 0xF7: // System exclusive fprintf(stderr, "%s: %d->internal error: sysex message status=0x%X while sending short message\n", - __FILE__, __LINE__, data[0]); + THIS_FILE, __LINE__, data[0]); byteIsInvalid = TRUE; break; @@ -154,7 +159,7 @@ default: // Invalid message fprintf(stderr, "%s: %d->Invalid message: message status=0x%X while sending short message\n", - __FILE__, __LINE__, data[0]); + THIS_FILE, __LINE__, data[0]); byteIsInvalid = TRUE; break; } @@ -164,7 +169,7 @@ default: // This can't happen, but handle it anyway. fprintf(stderr, "%s: %d->Invalid message: message status=0x%X while sending short message\n", - __FILE__, __LINE__, data[0]); + THIS_FILE, __LINE__, data[0]); byteIsInvalid = TRUE; break; } --- old/src/macosx/native/com/sun/media/sound/PLATFORM_API_MacOSX_MidiUtils.c 2012-09-06 09:37:48.000000000 -0700 +++ new/src/macosx/native/com/sun/media/sound/PLATFORM_API_MacOSX_MidiUtils.c 2012-09-06 09:37:48.000000000 -0700 @@ -42,6 +42,11 @@ //#define USE_ERROR //#define USE_TRACE +/* Use THIS_FILE when it is available. */ +#ifndef THIS_FILE + #define THIS_FILE __FILE__ +#endif + #if (USE_PLATFORM_MIDI_IN == TRUE) || (USE_PLATFORM_MIDI_OUT == TRUE) #include "PLATFORM_API_MacOSX_MidiUtils.h" @@ -317,7 +322,7 @@ packedMsg = pendingMessageStatus | pendingData[0] << 8; } else { fprintf(stderr, "%s: %d->internal error: pendingMessageStatus=0x%X, pendingDataLength=%d\n", - __FILE__, __LINE__, pendingMessageStatus, pendingDataLength); + THIS_FILE, __LINE__, pendingMessageStatus, pendingDataLength); byteIsInvalid = TRUE; } pendingDataLength = 0; --- old/src/macosx/native/sun/awt/CSystemColors.m 2012-09-06 09:37:49.000000000 -0700 +++ new/src/macosx/native/sun/awt/CSystemColors.m 2012-09-06 09:37:49.000000000 -0700 @@ -33,6 +33,11 @@ #import "ThreadUtilities.h" +/* Use THIS_FILE when it is available. */ +#ifndef THIS_FILE + #define THIS_FILE __FILE__ +#endif + NSColor **sColors = nil; NSColor **appleColors = nil; @@ -130,7 +135,7 @@ result = (useAppleColor ? appleColors : sColors)[colorIndex]; } else { - NSLog(@"%s: %s %sColor: %ld not found, returning black.", __FILE__, __FUNCTION__, (useAppleColor) ? "Apple" : "System", colorIndex); + NSLog(@"%s: %s %sColor: %ld not found, returning black.", THIS_FILE, __FUNCTION__, (useAppleColor) ? "Apple" : "System", colorIndex); result = [NSColor blackColor]; } --- old/src/macosx/native/sun/awt/CTextPipe.m 2012-09-06 09:37:51.000000000 -0700 +++ new/src/macosx/native/sun/awt/CTextPipe.m 2012-09-06 09:37:50.000000000 -0700 @@ -36,6 +36,10 @@ #import "QuartzSurfaceData.h" #include "AWTStrike.h" +/* Use THIS_FILE when it is available. */ +#ifndef THIS_FILE + #define THIS_FILE __FILE__ +#endif static const CGAffineTransform sInverseTX = { 1, 0, 0, -1, 0, 0 }; @@ -488,7 +492,7 @@ if (glyphs == NULL || advances == NULL) { (*env)->DeleteLocalRef(env, glyphsArray); - [NSException raise:NSMallocException format:@"%s-%s:%d", __FILE__, __FUNCTION__, __LINE__]; + [NSException raise:NSMallocException format:@"%s-%s:%d", THIS_FILE, __FUNCTION__, __LINE__]; return; } --- old/src/macosx/native/sun/font/AWTStrike.m 2012-09-06 09:37:52.000000000 -0700 +++ new/src/macosx/native/sun/font/AWTStrike.m 2012-09-06 09:37:52.000000000 -0700 @@ -33,6 +33,11 @@ #import "CoreTextSupport.h" //#import "jni_util.h" +/* Use THIS_FILE when it is available. */ +#ifndef THIS_FILE + #define THIS_FILE __FILE__ +#endif + @implementation AWTStrike static CGAffineTransform sInverseTX = { 1, 0, 0, -1, 0, 0 }; @@ -102,7 +107,7 @@ #define AWT_FONT_CLEANUP_FINISH \ if (_fontThrowJavaException == YES) { \ char s[512]; \ - sprintf(s, "%s-%s:%d", __FILE__, __FUNCTION__, __LINE__); \ + sprintf(s, "%s-%s:%d", THIS_FILE, __FUNCTION__, __LINE__); \ [JNFException raise:env as:kRuntimeException reason:s]; \ } --- old/src/share/back/error_messages.h 2012-09-06 09:37:54.000000000 -0700 +++ new/src/share/back/error_messages.h 2012-09-06 09:37:53.000000000 -0700 @@ -42,31 +42,36 @@ const char * eventText(int); const char * jdwpErrorText(jdwpError); +/* Use THIS_FILE when it is available. */ +#ifndef THIS_FILE + #define THIS_FILE __FILE__ +#endif + #define EXIT_ERROR(error,msg) \ { \ print_message(stderr, "JDWP exit error ", "\n", \ "%s(%d): %s [%s:%d]", \ jvmtiErrorText((jvmtiError)error), error, (msg==NULL?"":msg), \ - __FILE__, __LINE__); \ + THIS_FILE, __LINE__); \ debugInit_exit((jvmtiError)error, msg); \ } #define JDI_ASSERT(expression) \ do { \ if (gdata && gdata->assertOn && !(expression)) { \ - jdiAssertionFailed(__FILE__, __LINE__, #expression); \ + jdiAssertionFailed(THIS_FILE, __LINE__, #expression); \ } \ } while (0) #define JDI_ASSERT_MSG(expression, msg) \ do { \ if (gdata && gdata->assertOn && !(expression)) { \ - jdiAssertionFailed(__FILE__, __LINE__, msg); \ + jdiAssertionFailed(THIS_FILE, __LINE__, msg); \ } \ } while (0) #define JDI_ASSERT_FAILED(msg) \ - jdiAssertionFailed(__FILE__, __LINE__, msg) + jdiAssertionFailed(THIS_FILE, __LINE__, msg) void do_pause(void); --- old/src/share/back/log_messages.h 2012-09-06 09:37:55.000000000 -0700 +++ new/src/share/back/log_messages.h 2012-09-06 09:37:55.000000000 -0700 @@ -33,11 +33,15 @@ #define LOG_NULL ((void)0) -#ifdef JDWP_LOGGING +/* Use THIS_FILE when it is available. */ +#ifndef THIS_FILE + #define THIS_FILE __FILE__ +#endif +#ifdef JDWP_LOGGING #define _LOG(flavor,args) \ - (log_message_begin(flavor,__FILE__,__LINE__), \ + (log_message_begin(flavor,THIS_FILE,__LINE__), \ log_message_end args) #define LOG_TEST(flag) (gdata->log_flags & (flag)) --- old/src/share/demo/jvmti/hprof/debug_malloc.h 2012-09-06 09:37:56.000000000 -0700 +++ new/src/share/demo/jvmti/hprof/debug_malloc.h 2012-09-06 09:37:56.000000000 -0700 @@ -59,6 +59,11 @@ #include #include +/* 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_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 --- old/src/share/demo/jvmti/hprof/hprof_error.h 2012-09-06 09:37:58.000000000 -0700 +++ new/src/share/demo/jvmti/hprof/hprof_error.h 2012-09-06 09:37:57.000000000 -0700 @@ -41,20 +41,25 @@ #ifndef HPROF_ERROR_H #define HPROF_ERROR_H +/* Use THIS_FILE when it is available. */ +#ifndef THIS_FILE + #define THIS_FILE __FILE__ +#endif + /* Macros over assert and error functions so we can capture the source loc. */ #define HPROF_BOOL(x) ((jboolean)((x)==0?JNI_FALSE:JNI_TRUE)) #define HPROF_ERROR(fatal,msg) \ - error_handler(HPROF_BOOL(fatal), JVMTI_ERROR_NONE, msg, __FILE__, __LINE__) + error_handler(HPROF_BOOL(fatal), JVMTI_ERROR_NONE, msg, THIS_FILE, __LINE__) #define HPROF_JVMTI_ERROR(error,msg) \ error_handler(HPROF_BOOL(error!=JVMTI_ERROR_NONE), \ - error, msg, __FILE__, __LINE__) + error, msg, THIS_FILE, __LINE__) #if defined(DEBUG) || !defined(NDEBUG) #define HPROF_ASSERT(cond) \ - (((int)(cond))?(void)0:error_assert(#cond, __FILE__, __LINE__)) + (((int)(cond))?(void)0:error_assert(#cond, THIS_FILE, __LINE__)) #else #define HPROF_ASSERT(cond) #endif @@ -77,11 +82,11 @@ #define LOG_FORMAT(format) "HPROF LOG: " format " [%s:%d]\n" #define LOG1(str1) LOG_STDERR((stderr, LOG_FORMAT("%s"), \ - str1, __FILE__, __LINE__ )) + str1, THIS_FILE, __LINE__ )) #define LOG2(str1,str2) LOG_STDERR((stderr, LOG_FORMAT("%s %s"), \ - str1, str2, __FILE__, __LINE__ )) + str1, str2, THIS_FILE, __LINE__ )) #define LOG3(str1,str2,num) LOG_STDERR((stderr, LOG_FORMAT("%s %s 0x%x"), \ - str1, str2, num, __FILE__, __LINE__ )) + str1, str2, num, THIS_FILE, __LINE__ )) #define LOG(str) LOG1(str) --- old/src/share/demo/jvmti/hprof/hprof_util.h 2012-09-06 09:37:59.000000000 -0700 +++ new/src/share/demo/jvmti/hprof/hprof_util.h 2012-09-06 09:37:59.000000000 -0700 @@ -41,6 +41,11 @@ #ifndef HPROF_UTIL_H #define HPROF_UTIL_H +/* Use THIS_FILE when it is available. */ +#ifndef THIS_FILE + #define THIS_FILE __FILE__ +#endif + /* Macros that protect code from accidently using a local ref improperly */ #define WITH_LOCAL_REFS(env, number) \ { \ @@ -184,8 +189,8 @@ #ifdef DEBUG void * hprof_debug_malloc(int size, char *file, int line); void hprof_debug_free(void *ptr, char *file, int line); - #define HPROF_MALLOC(size) hprof_debug_malloc(size, __FILE__, __LINE__) - #define HPROF_FREE(ptr) hprof_debug_free(ptr, __FILE__, __LINE__) + #define HPROF_MALLOC(size) hprof_debug_malloc(size, THIS_FILE, __LINE__) + #define HPROF_FREE(ptr) hprof_debug_free(ptr, THIS_FILE, __LINE__) #else #define HPROF_MALLOC(size) hprof_malloc(size) #define HPROF_FREE(ptr) hprof_free(ptr) --- old/src/share/demo/jvmti/java_crw_demo/java_crw_demo.c 2012-09-06 09:38:00.000000000 -0700 +++ new/src/share/demo/jvmti/java_crw_demo/java_crw_demo.c 2012-09-06 09:38:00.000000000 -0700 @@ -70,12 +70,20 @@ /* Macros over error functions to capture line numbers */ -#define CRW_FATAL(ci, message) fatal_error(ci, message, __FILE__, __LINE__) +/* Fatal error used in all builds. */ -#if defined(DEBUG) || !defined(NDEBUG) +/* Use THIS_FILE when it is available. */ +#ifndef THIS_FILE + #define THIS_FILE "java_crw.demo.c" /* Never use __FILE__ */ +#endif +#define CRW_FATAL(ci, message) fatal_error(ci, message, THIS_FILE, __LINE__) + +#if defined(DEBUG) || !defined(NDEBUG) + + /* This assert macro is only used in the debug builds. */ #define CRW_ASSERT(ci, cond) \ - ((cond)?(void)0:assert_error(ci, #cond, __FILE__, __LINE__)) + ((cond)?(void)0:assert_error(ci, #cond, THIS_FILE, __LINE__)) #else --- old/src/share/instrument/JPLISAssert.h 2012-09-06 09:38:02.000000000 -0700 +++ new/src/share/instrument/JPLISAssert.h 2012-09-06 09:38:02.000000000 -0700 @@ -49,10 +49,14 @@ #define JPLISASSERT_ENABLEASSERTIONS (0) #endif +/* Use THIS_FILE when it is available. */ +#ifndef THIS_FILE + #define THIS_FILE __FILE__ +#endif #if JPLISASSERT_ENABLEASSERTIONS -#define jplis_assert(x) JPLISAssertCondition((jboolean)(x), #x, __FILE__, __LINE__) -#define jplis_assert_msg(x, msg) JPLISAssertConditionWithMessage((jboolean)(x), #x, msg, __FILE__, __LINE__) +#define jplis_assert(x) JPLISAssertCondition((jboolean)(x), #x, THIS_FILE, __LINE__) +#define jplis_assert_msg(x, msg) JPLISAssertConditionWithMessage((jboolean)(x), #x, msg, THIS_FILE, __LINE__) #else #define jplis_assert(x) #define jplis_assert_msg(x, msg) --- old/src/share/native/sun/awt/debug/debug_assert.h 2012-09-06 09:38:03.000000000 -0700 +++ new/src/share/native/sun/awt/debug/debug_assert.h 2012-09-06 09:38:03.000000000 -0700 @@ -32,17 +32,22 @@ #include "debug_util.h" +/* Use THIS_FILE when it is available. */ +#ifndef THIS_FILE + #define THIS_FILE __FILE__ +#endif + #if defined(DEBUG) #define DASSERT(_expr) \ if ( !(_expr) ) { \ - DAssert_Impl( #_expr, __FILE__, __LINE__); \ + DAssert_Impl( #_expr, THIS_FILE, __LINE__); \ } else { \ } #define DASSERTMSG(_expr, _msg) \ if ( !(_expr) ) { \ - DAssert_Impl( (_msg), __FILE__, __LINE__); \ + DAssert_Impl( (_msg), THIS_FILE, __LINE__); \ } else { \ } --- old/src/share/native/sun/awt/debug/debug_mem.c 2012-09-06 09:38:05.000000000 -0700 +++ new/src/share/native/sun/awt/debug/debug_mem.c 2012-09-06 09:38:04.000000000 -0700 @@ -27,6 +27,11 @@ #include "debug_util.h" +/* Use THIS_FILE when it is available. */ +#ifndef THIS_FILE + #define THIS_FILE __FILE__ +#endif + #define DMEM_MIN(a,b) (a) < (b) ? (a) : (b) #define DMEM_MAX(a,b) (a) > (b) ? (a) : (b) @@ -291,7 +296,7 @@ DMutex_Enter(DMemMutex); /* Force memory leaks to be output regardless of trace settings */ - DTrace_EnableFile(__FILE__, TRUE); + DTrace_EnableFile(THIS_FILE, TRUE); DTRACE_PRINTLN("--------------------------"); DTRACE_PRINTLN("Debug Memory Manager Leaks"); DTRACE_PRINTLN("--------------------------"); --- old/src/share/native/sun/awt/debug/debug_trace.h 2012-09-06 09:38:06.000000000 -0700 +++ new/src/share/native/sun/awt/debug/debug_trace.h 2012-09-06 09:38:06.000000000 -0700 @@ -34,6 +34,11 @@ #include "debug_util.h" +/* Use THIS_FILE when it is available. */ +#ifndef THIS_FILE + #define THIS_FILE __FILE__ +#endif + typedef int dtrace_id; enum { UNDEFINED_TRACE_ID = -1 /* indicates trace point has not been registered yet */ @@ -69,7 +74,7 @@ #define _DTrace_Template(_func, _ac, _f, _a1, _a2, _a3, _a4, _a5, _a6, _a7, _a8) \ { \ static dtrace_id _dt_lineid_ = UNDEFINED_TRACE_ID; \ - DTrace_PrintFunction((_func), &_Dt_FileTraceId, &_dt_lineid_, __FILE__, __LINE__, (_ac), (_f), (_a1), (_a2), (_a3), (_a4), (_a5), (_a6), (_a7), (_a8) ); \ + DTrace_PrintFunction((_func), &_Dt_FileTraceId, &_dt_lineid_, THIS_FILE, __LINE__, (_ac), (_f), (_a1), (_a2), (_a3), (_a4), (_a5), (_a6), (_a7), (_a8) ); \ } /* printf style trace macros */ --- old/src/share/native/sun/security/pkcs11/wrapper/pkcs11wrapper.h 2012-09-06 09:38:08.000000000 -0700 +++ new/src/share/native/sun/security/pkcs11/wrapper/pkcs11wrapper.h 2012-09-06 09:38:07.000000000 -0700 @@ -452,7 +452,12 @@ void *p11malloc(size_t c, char *file, int line); void p11free(void *p, char *file, int line); -#define malloc(c) (p11malloc((c), __FILE__, __LINE__)) -#define free(c) (p11free((c), __FILE__, __LINE__)) +/* Use THIS_FILE when it is available. */ +#ifndef THIS_FILE + #define THIS_FILE __FILE__ +#endif + +#define malloc(c) (p11malloc((c), THIS_FILE, __LINE__)) +#define free(c) (p11free((c), THIS_FILE, __LINE__)) #endif --- old/src/share/npt/utf.h 2012-09-06 09:38:09.000000000 -0700 +++ new/src/share/npt/utf.h 2012-09-06 09:38:09.000000000 -0700 @@ -33,8 +33,13 @@ #include "jni.h" #include "utf_md.h" +/* Use THIS_FILE when it is available. */ +#ifndef THIS_FILE + #define THIS_FILE __FILE__ +#endif + /* Error and assert macros */ -#define UTF_ERROR(m) utfError(__FILE__, __LINE__, m) +#define UTF_ERROR(m) utfError(THIS_FILE, __LINE__, m) #define UTF_ASSERT(x) ( (x)==0 ? UTF_ERROR("ASSERT ERROR " #x) : (void)0 ) void utfError(char *file, int line, char *message); --- old/src/share/transport/shmem/shmemBase.h 2012-09-06 09:38:10.000000000 -0700 +++ new/src/share/transport/shmem/shmemBase.h 2012-09-06 09:38:10.000000000 -0700 @@ -49,11 +49,16 @@ jint shmemBase_name(SharedMemoryTransport *, char **name); jint shmemBase_getlasterror(char *msg, jint size); +/* Use THIS_FILE when it is available. */ +#ifndef THIS_FILE + #define THIS_FILE __FILE__ +#endif + #ifdef DEBUG #define SHMEM_ASSERT(expression) \ do { \ if (!(expression)) { \ - exitTransportWithError("assertion failed", __FILE__, __DATE__, __LINE__); \ + exitTransportWithError("assertion failed", THIS_FILE, __DATE__, __LINE__); \ } \ } while (0) #else @@ -63,7 +68,7 @@ #define SHMEM_GUARANTEE(expression) \ do { \ if (!(expression)) { \ - exitTransportWithError("assertion failed", __FILE__, __DATE__, __LINE__); \ + exitTransportWithError("assertion failed", THIS_FILE, __DATE__, __LINE__); \ } \ } while (0) --- old/src/solaris/instrument/EncodingSupport_md.c 2012-09-06 09:38:12.000000000 -0700 +++ new/src/solaris/instrument/EncodingSupport_md.c 2012-09-06 09:38:11.000000000 -0700 @@ -33,8 +33,13 @@ /* Routines to convert back and forth between Platform Encoding and UTF-8 */ +/* Use THIS_FILE when it is available. */ +#ifndef THIS_FILE + #define THIS_FILE __FILE__ +#endif + /* Error and assert macros */ -#define UTF_ERROR(m) utfError(__FILE__, __LINE__, m) +#define UTF_ERROR(m) utfError(THIS_FILE, __LINE__, m) #define UTF_ASSERT(x) ( (x)==0 ? UTF_ERROR("ASSERT ERROR " #x) : (void)0 ) #define UTF_DEBUG(x) --- old/src/windows/native/com/sun/media/sound/PLATFORM_API_WinOS_MidiIn.cpp 2012-09-06 09:38:13.000000000 -0700 +++ new/src/windows/native/com/sun/media/sound/PLATFORM_API_WinOS_MidiIn.cpp 2012-09-06 09:38:13.000000000 -0700 @@ -35,9 +35,15 @@ #ifdef USE_ERROR #include + +/* Use THIS_FILE when it is available. */ +#ifndef THIS_FILE + #define THIS_FILE __FILE__ +#endif + #define MIDIIN_CHECK_ERROR { \ if (err != MMSYSERR_NOERROR) \ - ERROR3("MIDI IN Error in %s:%d : %s\n", __FILE__, __LINE__, MIDI_IN_GetErrorStr((INT32) err)); \ + ERROR3("MIDI IN Error in %s:%d : %s\n", THIS_FILE, __LINE__, MIDI_IN_GetErrorStr((INT32) err)); \ } #else #define MIDIIN_CHECK_ERROR --- old/src/windows/native/com/sun/media/sound/PLATFORM_API_WinOS_MidiOut.c 2012-09-06 09:38:15.000000000 -0700 +++ new/src/windows/native/com/sun/media/sound/PLATFORM_API_WinOS_MidiOut.c 2012-09-06 09:38:15.000000000 -0700 @@ -33,9 +33,15 @@ #ifdef USE_ERROR #include + +/* Use THIS_FILE when it is available. */ +#ifndef THIS_FILE + #define THIS_FILE __FILE__ +#endif + #define MIDIOUT_CHECK_ERROR { \ if (err != MMSYSERR_NOERROR) \ - ERROR3("MIDI OUT Error in %s:%d : %s\n", __FILE__, __LINE__, MIDI_OUT_GetErrorStr((INT32) err)); \ + ERROR3("MIDI OUT Error in %s:%d : %s\n", THIS_FILE, __LINE__, MIDI_OUT_GetErrorStr((INT32) err)); \ } #else #define MIDIOUT_CHECK_ERROR --- old/src/windows/native/sun/java2d/d3d/D3DPipeline.h 2012-09-06 09:38:17.000000000 -0700 +++ new/src/windows/native/sun/java2d/d3d/D3DPipeline.h 2012-09-06 09:38:16.000000000 -0700 @@ -28,6 +28,11 @@ #define D3D_DEBUG_INFO #endif // DEBUG +/* Use THIS_FILE when it is available. */ +#ifndef THIS_FILE + #define THIS_FILE THIS_FILE +#endif + #ifdef D3D_PPL_DLL @@ -104,7 +109,7 @@ #define ACT_IF_NULL(ACTION, value) \ if ((value) == NULL) { \ J2dTraceLn3(J2D_TRACE_ERROR, \ - "%s is null in %s:%d", #value, __FILE__, __LINE__); \ + "%s is null in %s:%d", #value, THIS_FILE, __LINE__); \ ACTION; \ } else do { } while (0) #define RETURN_IF_NULL(value) ACT_IF_NULL(return, value) @@ -114,12 +119,12 @@ #define RETURN_STATUS_IF_EXP_FAILED(EXPR) \ if (FAILED(res = (EXPR))) { \ - DebugPrintD3DError(res, " " ## #EXPR ## " failed in " ## __FILE__); \ + DebugPrintD3DError(res, " " ## #EXPR ## " failed in " ## THIS_FILE); \ return res; \ } else do { } while (0) #define RETURN_STATUS_IF_FAILED(status) \ if (FAILED((status))) { \ - DebugPrintD3DError((status), " failed in " ## __FILE__ ## ", return;");\ + DebugPrintD3DError((status), " failed in " ## THIS_FILE ## ", return;");\ return (status); \ } else do { } while (0) --- old/src/windows/native/sun/windows/alloc.h 2012-09-06 09:38:19.000000000 -0700 +++ new/src/windows/native/sun/windows/alloc.h 2012-09-06 09:38:19.000000000 -0700 @@ -26,6 +26,11 @@ #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 @@ -127,12 +132,12 @@ 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 \ --- old/src/windows/native/sun/windows/awt_Debug.h 2012-09-06 09:38:22.000000000 -0700 +++ new/src/windows/native/sun/windows/awt_Debug.h 2012-09-06 09:38:21.000000000 -0700 @@ -65,7 +65,12 @@ #define AWT_DUMP_CLIP_RECTANGLE(_msg, _hwnd) \ _DTrace_Template(DumpClipRectangle, 2, "", (_msg), (_hwnd), 0, 0, 0, 0, 0, 0) - #define new new(__FILE__, __LINE__) + /* Use THIS_FILE when it is available. */ + #ifndef THIS_FILE + #define THIS_FILE __FILE__ + #endif + + #define new new(THIS_FILE, __LINE__) #define VERIFY(exp) DASSERT(exp) #define UNIMPLEMENTED() DASSERT(FALSE) --- old/src/windows/native/sun/windows/awt_Toolkit.h 2012-09-06 09:38:23.000000000 -0700 +++ new/src/windows/native/sun/windows/awt_Toolkit.h 2012-09-06 09:38:23.000000000 -0700 @@ -132,24 +132,30 @@ // Macros for using CriticalSection objects that help trace // lock/unlock actions + +/* Use THIS_FILE when it is available. */ +#ifndef THIS_FILE + #define THIS_FILE __FILE__ +#endif + #define CRITICAL_SECTION_ENTER(cs) { \ J2dTraceLn4(J2D_TRACE_VERBOSE2, \ "CS.Wait: tid, cs, file, line = 0x%x, 0x%x, %s, %d", \ - GetCurrentThreadId(), &(cs), __FILE__, __LINE__); \ + GetCurrentThreadId(), &(cs), THIS_FILE, __LINE__); \ (cs).Enter(); \ J2dTraceLn4(J2D_TRACE_VERBOSE2, \ "CS.Enter: tid, cs, file, line = 0x%x, 0x%x, %s, %d", \ - GetCurrentThreadId(), &(cs), __FILE__, __LINE__); \ + GetCurrentThreadId(), &(cs), THIS_FILE, __LINE__); \ } #define CRITICAL_SECTION_LEAVE(cs) { \ J2dTraceLn4(J2D_TRACE_VERBOSE2, \ "CS.Leave: tid, cs, file, line = 0x%x, 0x%x, %s, %d", \ - GetCurrentThreadId(), &(cs), __FILE__, __LINE__); \ + GetCurrentThreadId(), &(cs), THIS_FILE, __LINE__); \ (cs).Leave(); \ J2dTraceLn4(J2D_TRACE_VERBOSE2, \ "CS.Left: tid, cs, file, line = 0x%x, 0x%x, %s, %d", \ - GetCurrentThreadId(), &(cs), __FILE__, __LINE__); \ + GetCurrentThreadId(), &(cs), THIS_FILE, __LINE__); \ } /************************************************************************ --- old/src/windows/transport/shmem/shmem_md.c 2012-09-06 09:38:25.000000000 -0700 +++ new/src/windows/transport/shmem/shmem_md.c 2012-09-06 09:38:25.000000000 -0700 @@ -30,6 +30,11 @@ #include "sysShmem.h" #include "shmemBase.h" /* for exitTransportWithError */ +/* Use THIS_FILE when it is available. */ +#ifndef THIS_FILE + #define THIS_FILE __FILE__ +#endif + /* * These functions are not completely universal. For now, they are used * exclusively for Jbug's shared memory transport mechanism. They have @@ -44,7 +49,7 @@ if (!(expression)) { \ exitTransportWithError \ ("\"%s\", line %d: assertion failure\n", \ - __FILE__, __DATE__, __LINE__); \ + THIS_FILE, __DATE__, __LINE__); \ } \ } #else