<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Feb 2, 2017 at 7:51 PM,  <span dir="ltr"><<a href="mailto:praveen@multicorewareinc.com" target="_blank">praveen@multicorewareinc.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"># HG changeset patch<br>
# User Praveen Tiwari <<a href="mailto:praveen@multicorewareinc.com" target="_blank">praveen@multicorewareinc.com</a>><br>
# Date 1486045258 -19800<br>
#      Thu Feb 02 19:50:58 2017 +0530<br>
# Node ID 573841e2efb5a68e9d4951bf287c7a<wbr>64dfa72823<br>
# Parent  fa52b516f5ff122c4486ed840c5bf1<wbr>de3c06e974<br>
Threadpool: correctly detect 'mac' os<br>
<br>
diff -r fa52b516f5ff -r 573841e2efb5 source/common/threadpool.cpp<br>
--- a/source/common/threadpool.cpp<wbr>      Mon Jan 30 10:35:00 2017 +0530<br>
+++ b/source/common/threadpool.cpp<wbr>      Thu Feb 02 19:50:58 2017 +0530<br>
@@ -57,7 +57,7 @@<br>
<br>
 #endif<br>
<br>
-#if MACOS<br>
+#if __APPLE__ && __MACH__<br></blockquote><div><br></div><div>It would be better to edit CMakelists.txt to add_definition(-DMACOS) when the right pre-processor flags that are auto detected by the compiler are enabled. Keeps the code inside x265 cleaner.</div><div><br></div><div>From this document (<a href="https://developer.apple.com/library/content/documentation/Porting/Conceptual/PortingUnix/compiling/compiling.html#//apple_ref/doc/uid/TP40002850-SW13" target="_blank">https://developer.apple.com/<wbr>library/content/documentation/<wbr>Porting/Conceptual/<wbr>PortingUnix/compiling/<wbr>compiling.html#//apple_ref/<wbr>doc/uid/TP40002850-SW13</a>) it looks like __APPLE__ is the only standard one; we don't use any MacOS system calls directly to make __MACH__ mandatory. Is there some other source that says that __MACH__ is also required?</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
 #include <sys/param.h><br>
 #include <sys/sysctl.h><br>
 #endif<br>
@@ -617,7 +617,7 @@<br>
     return sysconf(_SC_NPROCESSORS_CONF);<br>
 #elif __unix__<br>
     return sysconf(_SC_NPROCESSORS_ONLN);<br>
-#elif MACOS<br>
+#elif __APPLE__ && __MACH__<br>
     int nm[2];<br>
     size_t len = 4;<br>
     uint32_t count;<br>
______________________________<wbr>_________________<br>
x265-devel mailing list<br>
<a href="mailto:x265-devel@videolan.org" target="_blank">x265-devel@videolan.org</a><br>
<a href="https://mailman.videolan.org/listinfo/x265-devel" rel="noreferrer" target="_blank">https://mailman.videolan.org/l<wbr>istinfo/x265-devel</a><br>
</blockquote></div><br></div></div>