Browse Source

libobs: Refactor check for Windows bitness/arch

Commit aa899c2 (PR #603) added logging for Windows bitness/arch, but it
was a bit incomplete/short-sighted.  It only added that information to
the regular logs.  This commit makes it easier to retrieve that
information for other purposes, like the crash handler.
Ryan Foster 9 years ago
parent
commit
788a1e22b7
3 changed files with 11 additions and 10 deletions
  1. 0 10
      libobs/obs-windows.c
  2. 10 0
      libobs/util/platform-windows.c
  3. 1 0
      libobs/util/windows/win-version.h

+ 0 - 10
libobs/obs-windows.c

@@ -172,16 +172,6 @@ static void log_available_memory(void)
 			note);
 }
 
-static bool is_64_bit_windows(void)
-{
-#if defined(_WIN64)
-	return true;
-#elif defined(_WIN32)
-	BOOL b64 = false;
-	return IsWow64Process(GetCurrentProcess(), &b64) && b64;
-#endif
-}
-
 static void log_windows_version(void)
 {
 	struct win_version_info ver;

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

@@ -757,6 +757,16 @@ bool get_dll_ver(const wchar_t *lib, struct win_version_info *ver_info)
 	return true;
 }
 
+bool is_64_bit_windows(void)
+{
+#if defined(_WIN64)
+	return true;
+#elif defined(_WIN32)
+	BOOL b64 = false;
+	return IsWow64Process(GetCurrentProcess(), &b64) && b64;
+#endif
+}
+
 #define WINVER_REG_KEY L"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion"
 
 void get_win_ver(struct win_version_info *info)

+ 1 - 0
libobs/util/windows/win-version.h

@@ -29,6 +29,7 @@ struct win_version_info {
 	int revis;
 };
 
+EXPORT bool is_64_bit_windows(void);
 EXPORT bool get_dll_ver(const wchar_t *lib, struct win_version_info *info);
 EXPORT void get_win_ver(struct win_version_info *info);