just use statvfs() on OpenBSD and skip the misguided attempt to

check operating system features with __sparc__; ok pascal@
This commit is contained in:
naddy 2012-04-16 12:03:25 +00:00
parent f9ae4318c6
commit ce3281d632
2 changed files with 44 additions and 2 deletions

View File

@ -1,9 +1,9 @@
# $OpenBSD: Makefile,v 1.40 2012/04/02 07:11:46 pascal Exp $
# $OpenBSD: Makefile,v 1.41 2012/04/16 12:03:25 naddy Exp $
COMMENT = 3D creation software
DISTNAME = blender-2.62
REVISION = 1
REVISION = 2
CATEGORIES = graphics

View File

@ -0,0 +1,42 @@
$OpenBSD: patch-source_blender_blenlib_intern_storage_c,v 1.5 2012/04/16 12:03:25 naddy Exp $
--- source/blender/blenlib/intern/storage.c.orig Sun Apr 15 23:46:30 2012
+++ source/blender/blenlib/intern/storage.c Sun Apr 15 23:49:16 2012
@@ -43,13 +43,13 @@
#include <time.h>
#include <sys/stat.h>
-#if defined (__sun__) || defined (__sun) || defined (__NetBSD__)
+#if defined (__sun__) || defined (__sun) || defined (__NetBSD__) || defined (__OpenBSD__)
#include <sys/statvfs.h> /* Other modern unix os's should probably use this also */
#elif !defined(__FreeBSD__) && !defined(linux) && (defined(__sparc) || defined(__sparc__))
#include <sys/statfs.h>
#endif
-#if defined (__FreeBSD__) || defined (__OpenBSD__)
+#if defined (__FreeBSD__)
#include <sys/param.h>
#include <sys/mount.h>
#endif
@@ -162,7 +162,7 @@ double BLI_dir_free_space(const char *dir)
return (double) (freec*bytesps*sectorspc);
#else
-#if defined (__sun__) || defined (__sun) || defined (__NetBSD__)
+#if defined (__sun__) || defined (__sun) || defined (__NetBSD__) || defined (__OpenBSD__)
struct statvfs disk;
#else
struct statfs disk;
@@ -180,11 +180,11 @@ double BLI_dir_free_space(const char *dir)
if (slash) slash[1] = 0;
} else strcpy(name,"/");
-#if defined (__FreeBSD__) || defined (linux) || defined (__OpenBSD__) || defined (__APPLE__) || defined(__GNU__) || defined(__GLIBC__)
+#if defined (__FreeBSD__) || defined (linux) || defined (__APPLE__) || defined(__GNU__) || defined(__GLIBC__)
if (statfs(name, &disk)) return(-1);
#endif
-#if defined (__sun__) || defined (__sun) || defined (__NetBSD__)
+#if defined (__sun__) || defined (__sun) || defined (__NetBSD__) || defined (__OpenBSD__)
if (statvfs(name, &disk)) return(-1);
#elif !defined(__FreeBSD__) && !defined(linux) && (defined(__sparc) || defined(__sparc__))
/* WARNING - This may not be supported by geeneric unix os's - Campbell */