Browse Source

Revert "libobs: Use macOS specific APIs to report free disk space"

This reverts commit f0c343ec24e08cda7ad16a4b5401e4c9d9920763.
Ryan Foster 1 year ago
parent
commit
d822584cb1
2 changed files with 0 additions and 29 deletions
  1. 0 25
      libobs/util/platform-cocoa.m
  2. 0 4
      libobs/util/platform-nix.c

+ 0 - 25
libobs/util/platform-cocoa.m

@@ -358,31 +358,6 @@ uint64_t os_get_sys_free_size(void)
     return vmstat.free_count * vm_page_size;
 }
 
-int64_t os_get_free_space(const char *path)
-{
-    if (path) {
-        NSURL *fileURL = [NSURL fileURLWithPath:@(path)];
-
-        NSDictionary *values = [fileURL resourceValuesForKeys:@[NSURLVolumeAvailableCapacityForOpportunisticUsageKey]
-                                                        error:nil];
-
-        NSNumber *availableSpace = values[NSURLVolumeAvailableCapacityForOpportunisticUsageKey];
-
-        if (availableSpace) {
-            return availableSpace.longValue;
-        }
-    }
-
-    return 0;
-}
-
-uint64_t os_get_free_disk_space(const char *dir)
-{
-    int64_t free_space = os_get_free_space(dir);
-
-    return (uint64_t) free_space;
-}
-
 static uint64_t total_memory = 0;
 static bool total_memory_initialized = false;
 

+ 0 - 4
libobs/util/platform-nix.c

@@ -571,7 +571,6 @@ void os_closedir(os_dir_t *dir)
 	}
 }
 
-#ifndef __APPLE__
 int64_t os_get_free_space(const char *path)
 {
 	struct statvfs info;
@@ -582,7 +581,6 @@ int64_t os_get_free_space(const char *path)
 
 	return ret;
 }
-#endif
 
 struct posix_glob_info {
 	struct os_glob_info base;
@@ -1138,7 +1136,6 @@ uint64_t os_get_sys_total_size(void)
 }
 #endif
 
-#ifndef __APPLE__
 uint64_t os_get_free_disk_space(const char *dir)
 {
 	struct statvfs info;
@@ -1147,7 +1144,6 @@ uint64_t os_get_free_disk_space(const char *dir)
 
 	return (uint64_t)info.f_frsize * (uint64_t)info.f_bavail;
 }
-#endif
 
 char *os_generate_uuid(void)
 {