You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2021/03/23 06:13:48 UTC

[GitHub] [incubator-nuttx] yamt commented on a change in pull request #3149: arch/sim/src/sim/up_hostmemory.c: build fix for older macOS versions

yamt commented on a change in pull request #3149:
URL: https://github.com/apache/incubator-nuttx/pull/3149#discussion_r599294845



##########
File path: arch/sim/src/sim/up_hostmemory.c
##########
@@ -140,5 +140,22 @@ void *host_calloc(size_t n, size_t elem_size)
 
 void *host_memalign(size_t alignment, size_t size)
 {
+  /* Note: macOS prior to 10.15 (Catalina) doesn't have aligned_alloc().  */
+
+#if !defined(__APPLE__) || \
+   (defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && \
+    __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 101500)
   return aligned_alloc(alignment, size);
+#else

Review comment:
       do all other relevant platforms have posix_memalign?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org