Signed-off-by: James Cherry <cherry@parallaxsw.com>
This commit is contained in:
James Cherry 2022-01-04 09:51:07 -07:00
parent cf50d07d20
commit 1a31130267
5 changed files with 12 additions and 23 deletions

View File

@ -47,10 +47,13 @@
#if defined(_WINDOWS) || defined(_WIN32)
#include <stdarg.h>
#include <inttypes.h>
#define va_copy(d,s) ((d)=(s))
#define strcasecmp _stricmp
#define strncasecmp strncmp
#define strtoull _strtoui64
#ifndef __GNUC__
#define strcasecmp _stricmp
#define strncasecmp strncmp
#define strtoull _strtoui64
#endif
// Flex doesn't check for unistd.h.
#define YY_NO_UNISTD_H
namespace sta {
@ -59,7 +62,7 @@
}
#else
#define vsnprint vsnprintf
#endif // _WINDOWS
#endif
#include <stddef.h> // size_t

View File

@ -14,7 +14,7 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
#if defined(WIN32)
#if defined(_WIN32)
#include "MachineWin32.cc"
#elif defined(__APPLE__)
#include "MachineApple.cc"

View File

@ -21,6 +21,7 @@
#include <stdio.h>
#include <sys/time.h>
#include <sys/resource.h>
#include <thread>
#include "StaConfig.hh"
#include "StringUtil.hh"
@ -32,11 +33,7 @@ static struct timeval elapsed_begin_time_;
int
processorCount()
{
#if HAVE_PTHREAD_H
return sysconf(_SC_NPROCESSORS_CONF);
#else
return 1;
#endif
return std::thread::hardware_concurrency();
}
void

View File

@ -21,6 +21,7 @@
#include <stdio.h>
#include <sys/time.h>
#include <sys/resource.h>
#include <thread>
#include "StaConfig.hh"
#include "StringUtil.hh"
@ -32,11 +33,7 @@ static struct timeval elapsed_begin_time_;
int
processorCount()
{
#if HAVE_PTHREAD_H
return sysconf(_SC_NPROCESSORS_CONF);
#else
return 1;
#endif
return std::thread::hardware_concurrency();
}
void

View File

@ -11,8 +11,6 @@
#include <stdio.h>
#include <windows.h> // GetSystemInfo
#include "StaConfig.hh" // HAVE_PTHREAD_H
namespace sta {
// Windows returns -1 if the string does not fit rather than the
@ -63,13 +61,7 @@ vasprintf(char **str,
int
processorCount()
{
#if HAVE_PTHREAD_H
SYSTEM_INFO info;
GetSystemInfo(&info);
return info.dwNumberOfProcessors;
#else
return 1;
#endif
}
void