forked from bartvdbraak/blender
Build: fixes for OpenBSD
Pull Request: https://projects.blender.org/blender/blender/pulls/107666
This commit is contained in:
parent
8ba9d7b67a
commit
322dab936f
2
extern/wcwidth/wcwidth.h
vendored
2
extern/wcwidth/wcwidth.h
vendored
@ -21,7 +21,7 @@
|
||||
#define __WCWIDTH_H__
|
||||
|
||||
#ifndef __cplusplus
|
||||
# if defined(__APPLE__) || defined(__NetBSD__)
|
||||
# if defined(__APPLE__) || defined(__NetBSD__) || defined(__OpenBSD__)
|
||||
/* The <uchar.h> standard header is missing on macOS. */
|
||||
#include <stddef.h>
|
||||
typedef unsigned int char32_t;
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
/* Adopted from Libmv. */
|
||||
|
||||
#if !defined(__APPLE__) && !defined(__FreeBSD__) && !defined(__NetBSD__)
|
||||
#if !defined(__APPLE__) && !defined(__FreeBSD__) && !defined(__NetBSD__) && !defined(__OpenBSD__)
|
||||
/* Needed for memalign on Linux and _aligned_alloc on Windows. */
|
||||
# ifdef FREE_WINDOWS
|
||||
/* Make sure _aligned_malloc is included. */
|
||||
@ -33,7 +33,7 @@ void *util_aligned_malloc(size_t size, int alignment)
|
||||
return MEM_mallocN_aligned(size, alignment, "Cycles Aligned Alloc");
|
||||
#elif defined(_WIN32)
|
||||
return _aligned_malloc(size, alignment);
|
||||
#elif defined(__FreeBSD__) || defined(__NetBSD__) || defined(__APPLE__)
|
||||
#elif defined(__APPLE__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)
|
||||
void *result;
|
||||
if (posix_memalign(&result, alignment, size)) {
|
||||
/* Non-zero means allocation error
|
||||
|
@ -59,7 +59,7 @@ void *aligned_malloc(size_t size, size_t alignment)
|
||||
|
||||
#ifdef _WIN32
|
||||
return _aligned_malloc(size, alignment);
|
||||
#elif defined(__FreeBSD__) || defined(__NetBSD__) || defined(__APPLE__)
|
||||
#elif defined(__APPLE__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)
|
||||
void *result;
|
||||
|
||||
if (posix_memalign(&result, alignment, size)) {
|
||||
|
@ -52,7 +52,7 @@ size_t malloc_usable_size(void *ptr);
|
||||
# define UNLIKELY(x) (x)
|
||||
#endif
|
||||
|
||||
#if !defined(__APPLE__) && !defined(__FreeBSD__) && !defined(__NetBSD__)
|
||||
#if !defined(__APPLE__) && !defined(__FreeBSD__) && !defined(__NetBSD__) && !defined(__OpenBSD__)
|
||||
// Needed for memalign on Linux and _aligned_alloc on Windows.
|
||||
|
||||
# include <malloc.h>
|
||||
|
@ -21,7 +21,8 @@
|
||||
#include "libmv/base/aligned_malloc.h"
|
||||
#include "libmv/logging/logging.h"
|
||||
|
||||
#if !defined(__APPLE__) && !defined(__FreeBSD__) && !defined(__NetBSD__)
|
||||
#if !defined(__APPLE__) && !defined(__FreeBSD__) && !defined(__NetBSD__) && \
|
||||
!defined(__OpenBSD__)
|
||||
// Needed for memalign on Linux and _aligned_alloc on Windows.
|
||||
# ifdef FREE_WINDOWS
|
||||
/* make sure _aligned_malloc is included */
|
||||
@ -44,7 +45,8 @@ namespace libmv {
|
||||
void* aligned_malloc(int size, int alignment) {
|
||||
#ifdef _WIN32
|
||||
return _aligned_malloc(size, alignment);
|
||||
#elif defined(__FreeBSD__) || defined(__NetBSD__) || defined(__APPLE__)
|
||||
#elif defined(__APPLE__) || defined(__FreeBSD__) || defined(__NetBSD__) || \
|
||||
defined(__OpenBSD__)
|
||||
void* result;
|
||||
|
||||
if (posix_memalign(&result, alignment, size)) {
|
||||
|
@ -17,7 +17,8 @@
|
||||
#include "BLI_compiler_attrs.h"
|
||||
#include "BLI_utildefines.h"
|
||||
|
||||
#if defined(_MSC_VER) || defined(__APPLE__) || defined(__HAIKU__) || defined(__NetBSD__)
|
||||
#if defined(_MSC_VER) || defined(__APPLE__) || defined(__HAIKU__) || defined(__NetBSD__) || \
|
||||
defined(__OpenBSD__)
|
||||
typedef int64_t off64_t;
|
||||
#endif
|
||||
|
||||
|
@ -57,7 +57,7 @@ typedef uint64_t u_int64_t;
|
||||
|
||||
#ifndef __cplusplus
|
||||
/* The <uchar.h> standard header is missing on some systems. */
|
||||
# if defined(__APPLE__) || defined(__NetBSD__)
|
||||
# if defined(__APPLE__) || defined(__NetBSD__) || defined(__OpenBSD__)
|
||||
typedef unsigned int char32_t;
|
||||
# else
|
||||
# include <uchar.h>
|
||||
|
@ -13,7 +13,7 @@
|
||||
|
||||
#include <sys/stat.h>
|
||||
|
||||
#if defined(__NetBSD__) || defined(__DragonFly__) || defined(__HAIKU__)
|
||||
#if defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__) || defined(__HAIKU__)
|
||||
/* Other modern unix OS's should probably use this also. */
|
||||
# include <sys/statvfs.h>
|
||||
# define USE_STATFS_STATVFS
|
||||
|
Loading…
Reference in New Issue
Block a user