浏览代码

obs-scripting: Fix compilation warnings on Clang and GCC

* Fix unused-parameter when Python is disabled
* Calm PySys_SetArgv deprecation since Python 3.11
tytan652 2 年之前
父节点
当前提交
e13e0937a2
共有 2 个文件被更改,包括 4 次插入0 次删除
  1. 3 0
      deps/obs-scripting/obs-scripting-python.c
  2. 1 0
      deps/obs-scripting/obs-scripting.c

+ 3 - 0
deps/obs-scripting/obs-scripting-python.c

@@ -1702,7 +1702,10 @@ bool obs_scripting_load_python(const char *python_path)
 	wchar_t *argv[] = {L"", NULL};
 	int argc = sizeof(argv) / sizeof(wchar_t *) - 1;
 
+	PRAGMA_WARN_PUSH
+	PRAGMA_WARN_DEPRECATION
 	PySys_SetArgv(argc, argv);
+	PRAGMA_WARN_POP
 
 #ifdef DEBUG_PYTHON_STARTUP
 	/* ---------------------------------------------- */

+ 1 - 0
deps/obs-scripting/obs-scripting.c

@@ -461,6 +461,7 @@ bool obs_scripting_python_runtime_linked(void)
 
 void obs_scripting_python_version(char *version, size_t version_length)
 {
+	UNUSED_PARAMETER(version_length);
 	version[0] = 0;
 }
 #endif