Explorar el Código

libobs: Restore Windows Vista compatibility

Certain PSAPI functions moved to KERNEL32 after Vista, setting
PSAPI_VERSION 1 uses the old PSAPI exports for compatibility. Vista
support was unintentionally broken by a6318ff.
Richard Stanway hace 8 años
padre
commit
27d16f961b
Se han modificado 2 ficheros con 3 adiciones y 2 borrados
  1. 1 1
      libobs/CMakeLists.txt
  2. 2 1
      libobs/util/platform-windows.c

+ 1 - 1
libobs/CMakeLists.txt

@@ -91,7 +91,7 @@ if(WIN32)
 	set(libobs_audio_monitoring_HEADERS
 		audio-monitoring/win32/wasapi-output.h
 		)
-	set(libobs_PLATFORM_DEPS winmm)
+	set(libobs_PLATFORM_DEPS winmm psapi)
 	if(MSVC)
 		set(libobs_PLATFORM_DEPS
 		${libobs_PLATFORM_DEPS}

+ 2 - 1
libobs/util/platform-windows.c

@@ -14,6 +14,7 @@
  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
+#define PSAPI_VERSION 1
 #include <windows.h>
 #include <mmsystem.h>
 #include <shellapi.h>
@@ -48,7 +49,7 @@ static inline uint32_t get_winver(void)
 		winver = (ver.major << 16) | ver.minor;
 	}
 
-	return winver;	
+	return winver;
 }
 
 void *os_dlopen(const char *path)