Browse Source

Revert "libobs: Assume Qt 6, always warn about Qt 5 plugins"

This reverts commit 5ed0b8a0b8f3d7687394de6cece81e870a83d6d9.
Ryan Foster 1 month ago
parent
commit
f31485939c
2 changed files with 9 additions and 3 deletions
  1. 3 3
      libobs/util/platform-nix.c
  2. 6 0
      libobs/util/platform-windows.c

+ 3 - 3
libobs/util/platform-nix.c

@@ -16,7 +16,7 @@
 
 
 #include "obsconfig.h"
 #include "obsconfig.h"
 
 
-#if !defined(__APPLE__)
+#if !defined(__APPLE__) && OBS_QT_VERSION == 6
 #define _GNU_SOURCE
 #define _GNU_SOURCE
 #include <link.h>
 #include <link.h>
 #include <stdlib.h>
 #include <stdlib.h>
@@ -110,7 +110,7 @@ void os_dlclose(void *module)
 		dlclose(module);
 		dlclose(module);
 }
 }
 
 
-#if !defined(__APPLE__)
+#if !defined(__APPLE__) && OBS_QT_VERSION == 6
 int module_has_qt5_check(const char *path)
 int module_has_qt5_check(const char *path)
 {
 {
 	void *mod = dlopen(path, RTLD_LAZY);
 	void *mod = dlopen(path, RTLD_LAZY);
@@ -151,7 +151,7 @@ void get_plugin_info(const char *path, bool *is_obs_plugin, bool *can_load)
 {
 {
 	*is_obs_plugin = true;
 	*is_obs_plugin = true;
 	*can_load = true;
 	*can_load = true;
-#if !defined(__APPLE__)
+#if !defined(__APPLE__) && OBS_QT_VERSION == 6
 	*can_load = !has_qt5_dependency(path);
 	*can_load = !has_qt5_dependency(path);
 #endif
 #endif
 	UNUSED_PARAMETER(path);
 	UNUSED_PARAMETER(path);

+ 6 - 0
libobs/util/platform-windows.c

@@ -134,6 +134,7 @@ void os_dlclose(void *module)
 	FreeLibrary(module);
 	FreeLibrary(module);
 }
 }
 
 
+#if OBS_QT_VERSION == 6
 static bool has_qt5_import(VOID *base, PIMAGE_NT_HEADERS nt_headers)
 static bool has_qt5_import(VOID *base, PIMAGE_NT_HEADERS nt_headers)
 {
 {
 	__try {
 	__try {
@@ -190,6 +191,7 @@ static bool has_qt5_import(VOID *base, PIMAGE_NT_HEADERS nt_headers)
 
 
 	return false;
 	return false;
 }
 }
+#endif
 
 
 static bool has_obs_export(VOID *base, PIMAGE_NT_HEADERS nt_headers)
 static bool has_obs_export(VOID *base, PIMAGE_NT_HEADERS nt_headers)
 {
 {
@@ -312,9 +314,13 @@ void get_plugin_info(const char *path, bool *is_obs_plugin, bool *can_load)
 
 
 		*is_obs_plugin = has_obs_export(base, nt_headers);
 		*is_obs_plugin = has_obs_export(base, nt_headers);
 
 
+#if OBS_QT_VERSION == 6
 		if (*is_obs_plugin) {
 		if (*is_obs_plugin) {
 			*can_load = !has_qt5_import(base, nt_headers);
 			*can_load = !has_qt5_import(base, nt_headers);
 		}
 		}
+#else
+		*can_load = true;
+#endif
 
 
 	} __except (EXCEPTION_EXECUTE_HANDLER) {
 	} __except (EXCEPTION_EXECUTE_HANDLER) {
 		/* we failed somehow, for compatibility let's assume it
 		/* we failed somehow, for compatibility let's assume it