Hello everyone,

I've been working on a build using both MSVC and the Intel Windows compiler 
(ICL).  These three patches allow building of hwloc + utils.

1) add-ifndef-guard-around-gnu-source.patch - this minor change only adds 
#ifndef _GNU_SOURCE inside the hwloc.m4 tests because it seems to be defined on 
Linux systems beforehand causing a warning in these autoconf tests.

2) use-ac-check-decl.patch - this change removes the _HWLOC_CHECK_DECL() macro 
with the autoconf AC_CHECK_DECLS() macro.  The problem I was having concerned 
how _HWLOC_CHECK_DECL() worked.  It has an expected failure structure where if 
say, sched_setaffinity, is already defined, then the AC_COMPILE_IFELSE() macro 
will fail and say it *is* declared (the AC_MSG_RESULT([yes]) is in the 
"if-false" part of the check).  This is problematic when using MSVC because it 
will say that sched_setaffinity is declared when it really isn't.  The comment 
for _HWLOC_CHECK_DECL is also outdated so I think this can be safely removed.

3) windows-compatibility-changes.patch - this change adds necessary autoconf 
checks that I needed to get MSVC/ICL to compile hwloc.  For instance, ssize_t 
wasn't declared and is defined from SSIZE_T instead, S_ISREG isn't defined in 
the windows headers so it is defined correctly when it doesn't exist, etc.  
This also introduced hwloc_strcasecmp() which is modeled after 
hwloc_strncasecmp().  If strcasecmp() isn't defined, then hwloc_strcasecmp() is 
used instead.  These MSVC/ICL auxiliary defines are put in 
include/private/misc.h and this header was added to some source files that 
needed it.

I'm of course open to any suggested changes, feedback is welcome!

Thanks,
Johnny

Attachment: add-ifndef-guard-around-gnu-source.patch
Description: add-ifndef-guard-around-gnu-source.patch

Attachment: use-ac-check-decl.patch
Description: use-ac-check-decl.patch

Attachment: windows-compatibility-changes.patch
Description: windows-compatibility-changes.patch

Reply via email to