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