Author: Richard Plangger <planri...@gmail.com>
Branch: 
Changeset: r87821:6017a1055480
Date: 2016-10-16 09:21 +0200
http://bitbucket.org/pypy/pypy/changeset/6017a1055480/

Log:    expose function prototype for compilation stage

diff --git a/rpython/rlib/rposix.py b/rpython/rlib/rposix.py
--- a/rpython/rlib/rposix.py
+++ b/rpython/rlib/rposix.py
@@ -2306,6 +2306,7 @@
 
 _pipe2_syscall = ENoSysCache()
 
+post_include_bits=['int _cpu_count(void);']
 # cpu count for linux, windows and mac (+ bsds)
 # note that the code is copied from cpython and split up here
 if sys.platform.startswith('linux'):
@@ -2314,7 +2315,7 @@
             RPY_EXTERN int _cpu_count(void) {
                 return sysconf(_SC_NPROCESSORS_ONLN);
             }
-            """])
+            """], post_include_bits=post_include_bits)
 elif sys.platform == "win32":
     cpucount_eci = ExternalCompilationInfo(includes=["Windows.h"],
             separate_module_sources=["""
@@ -2323,7 +2324,7 @@
             GetSystemInfo(&sysinfo);
             return sysinfo.dwNumberOfProcessors;
         }
-        """])
+        """], post_include_bits=post_include_bits)
 else:
     cpucount_eci = ExternalCompilationInfo(includes=["sys/types.h", 
"sys/sysctl.h"],
             separate_module_sources=["""
@@ -2343,7 +2344,7 @@
             #endif
                 return ncpu;
             }
-            """])
+            """], post_include_bits=post_include_bits)
 
 _cpu_count = rffi.llexternal('_cpu_count', [], rffi.INT_real,
                             compilation_info=cpucount_eci)
_______________________________________________
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to