Merge branch 'master' into experimental_varlen

* master:
  chg: 'hf mf sim' - textual
  fix:  warning on mingw64.   This offset is calculated, casting it to u32 should be fine.
  fix: https://github.com/RfidResearchGroup/proxmark3/issues/174 remove all offending code,  return 1.   Will only impact the speed of hardnested execution.
  fix again OSX
  fix https://github.com/RfidResearchGroup/proxmark3/issues/173
  used predefined constants, common types moved to common header files
  backward compatibility, on load converter for old mfu dump format
  loops for counters output
  UL/NTAG new dump file format. Added counters support, simulation
This commit is contained in:
Philippe Teuwen
2019-04-25 20:05:04 +02:00
13 changed files with 251 additions and 109 deletions

View File

@@ -797,9 +797,22 @@ int num_CPUs(void) {
SYSTEM_INFO sysinfo;
GetSystemInfo(&sysinfo);
return sysinfo.dwNumberOfProcessors;
#elif defined(__linux__) || defined(__APPLE__)
#elif defined(__linux__) && defined(_SC_NPROCESSORS_ONLN)
#include <unistd.h>
return sysconf(_SC_NPROCESSORS_ONLN);
int count = sysconf(_SC_NPROCESSORS_ONLN);
if (count <= 0)
count = 1;
return count;
#elif defined(__APPLE__)
/*
TODO ICEMAN 2019, its commented out until someone finds a better solution
#include "sys/sysctl.h"
uint32_t logicalcores = 0;
size_t size = sizeof( logicalcores );
sysctlbyname( "hw.logicalcpu", &logicalcores, &size, NULL, 0 );
return logicalcores;
*/
return 1;
#else
return 1;
#endif