Skip to content

Rework __GLIBC_PREREQ checks to avoid breaking non-glibc builds #1257

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 1, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions driver/others/memory.c
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,6 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifdef DYNAMIC_ARCH
gotoblas_t *gotoblas = NULL;
#endif

extern void openblas_warning(int verbose, const char * msg);

#ifndef SMP
Expand Down Expand Up @@ -187,25 +186,24 @@ int i,n;

#if !defined(__GLIBC_PREREQ)
return nums;
#endif
#if !__GLIBC_PREREQ(2, 3)
#else
#if !__GLIBC_PREREQ(2, 3)
return nums;
#endif
#endif

#if !__GLIBC_PREREQ(2, 7)
#if !__GLIBC_PREREQ(2, 7)
ret = sched_getaffinity(0,sizeof(cpu_set_t), cpusetp);
if (ret!=0) return nums;
n=0;
#if !__GLIBC_PREREQ(2, 6)
#if !__GLIBC_PREREQ(2, 6)
for (i=0;i<nums;i++)
if (CPU_ISSET(i,cpusetp)) n++;
nums=n;
#else
#else
nums = CPU_COUNT(sizeof(cpu_set_t),cpusetp);
#endif
#endif
return nums;
#endif

#else
cpusetp = CPU_ALLOC(nums);
if (cpusetp == NULL) return nums;
size = CPU_ALLOC_SIZE(nums);
Expand All @@ -214,6 +212,8 @@ int i,n;
nums = CPU_COUNT_S(size,cpusetp);
CPU_FREE(cpusetp);
return nums;
#endif
#endif
}
#endif
#endif
Expand Down