浏览代码

Fix compile

luboslenco 1 月之前
父节点
当前提交
bc170bfd61
共有 1 个文件被更改,包括 6 次插入2 次删除
  1. 6 2
      base/sources/backends/macos_system.m

+ 6 - 2
base/sources/backends/macos_system.m

@@ -26,8 +26,10 @@ static const char *videoFormats[] = {"ogv", NULL};
 static NSApplication *myapp;
 static NSWindow *window;
 static BasicMTKView *view;
-static struct HIDManager *hidManager;
 static char language[3];
+#ifdef WITH_GAMEPAD
+static struct HIDManager *hidManager;
+#endif
 
 @implementation BasicMTKView
 
@@ -987,10 +989,12 @@ void iron_init(const char *name, int width, int height, iron_window_options_t *w
 		[myapp finishLaunching];
 		[[NSRunningApplication currentApplication] activateWithOptions:(NSApplicationActivateAllWindows | NSApplicationActivateIgnoringOtherApps)];
 		NSApp.activationPolicy = NSApplicationActivationPolicyRegular;
+		add_menubar();
 
+		#ifdef WITH_GAMEPAD
 		hidManager = (struct HIDManager *)malloc(sizeof(struct HIDManager));
 		HIDManager_init(hidManager);
-		add_menubar();
+		#endif
 	}
 
 	iron_window_options_t defaultWindowOptions;