Build fixes for OpenBSD #107666

Merged
Brecht Van Lommel merged 3 commits from Brad-Smith/blender:openbsd_build_fixes into main 2023-05-09 13:19:24 +02:00
8 changed files with 13 additions and 10 deletions

View File

@ -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;

View File

@ -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

View File

@ -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)) {

View File

@ -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>

View File

@ -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)) {

View File

@ -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

View File

@ -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>

View File

@ -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