src/macosx/native/com/apple/laf/ScreenMenu.m

Print this page

        

@@ -35,10 +35,14 @@
 #import <JavaRuntimeSupport/JavaRuntimeSupport.h>
 
 #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) {
     jint result = 0;

@@ -95,11 +99,11 @@
 
 - (void)menuWillOpen:(NSMenu *)menu
 {
     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;
     }
 
     JNIEnv *env = [ThreadUtilities getJNIEnv];

@@ -113,11 +117,11 @@
 
 - (void)menuDidClose:(NSMenu *)menu
 {
     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;
     }
 
     JNIEnv *env = [ThreadUtilities getJNIEnv];

@@ -131,11 +135,11 @@
 
 - (void)handleJavaMenuItemTargetedAtIndex:(NSUInteger)menuIndex rect:(NSRect)rect
 {
     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;
     }
 
     JNIEnv *env = [ThreadUtilities getJNIEnv];