Bump oldest supported MacOS to version 11.

PiperOrigin-RevId: 547479684
Change-Id: Idb6a432af0e7872ca087a0c571aafa72e9528818
This commit is contained in:
Kyle Bayes
2023-07-12 06:37:24 -07:00
committed by Copybara-Service
parent 77b3533d90
commit 242aea93c6
5 changed files with 16 additions and 21 deletions
-15
View File
@@ -43,13 +43,6 @@ extern "C" {
#endif
}
#ifdef __APPLE__
#include <Availability.h>
#if !defined(MAC_OS_X_VERSION_MIN_REQUIRED) && defined(__MAC_OS_X_VERSION_MIN_REQUIRED)
#define MAC_OS_X_VERSION_MIN_REQUIRED __MAC_OS_X_VERSION_MIN_REQUIRED
#endif
#endif
#include <mujoco/mjplugin.h>
#include "engine/engine_util_errmem.h"
@@ -163,15 +156,7 @@ template<typename T>
PluginTable<T>* AddNewTableBlock(PluginTable<T>* table) {
char err[512];
err[0] = '\0';
#if defined(MAC_OS_X_VERSION_MIN_REQUIRED) && MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_14
// aligned nothrow new is not available until macOS 10.14
posix_memalign(reinterpret_cast<void**>(&table->next),
alignof(PluginTable<T>), sizeof(PluginTable<T>));
if (table->next) new(table->next) PluginTable<T>;
#else
table->next = new(std::nothrow) PluginTable<T>;
#endif
if (!table->next) {
std::snprintf(err, sizeof(err), "failed to allocate memory for the global plugin table");
return nullptr;