From b7fcafc9ec36da703fd8a10ccf724ae5d1889c14 Mon Sep 17 00:00:00 2001 From: Jeff Inman Date: Wed, 30 Jul 2014 17:17:21 -0600 Subject: [PATCH] changes while trying to build on a Mac --- .gitignore | 11 +++++++++++ src/ior.c | 8 +++++--- src/parse_options.c | 4 ++++ src/utilities.c | 20 ++++++++++++-------- 4 files changed, 32 insertions(+), 11 deletions(-) diff --git a/.gitignore b/.gitignore index 5518e01..6287534 100644 --- a/.gitignore +++ b/.gitignore @@ -21,3 +21,14 @@ src/Makefile.in src/config.h src/config.h.in src/stamp-h1 +*~ +NOTES.txt +autom4te.cache +contrib/cbif.o +src/aiori-MPIIO.o +src/aiori-PLFS.c +src/aiori-POSIX.o +src/ior +src/ior.o +src/parse_options.o +src/utilities.o diff --git a/src/ior.c b/src/ior.c index 163a59c..15209a7 100644 --- a/src/ior.c +++ b/src/ior.c @@ -9,7 +9,7 @@ \******************************************************************************/ #ifdef HAVE_CONFIG_H -#include "config.h" +# include "config.h" #endif #include @@ -22,10 +22,12 @@ #include #include /* struct stat */ #include + #ifndef _WIN32 -#include /* gettimeofday() */ -#include /* uname() */ +# include /* gettimeofday() */ +# include /* uname() */ #endif + #include #include "ior.h" diff --git a/src/parse_options.c b/src/parse_options.c index 9f66f1d..b5d7d0e 100644 --- a/src/parse_options.c +++ b/src/parse_options.c @@ -73,9 +73,13 @@ static size_t NodeMemoryStringToBytes(char *size_str) ERR("percentage must be between 0 and 100"); page_size = sysconf(_SC_PAGESIZE); +#ifdef _SC_PHYS_PAGES num_pages = sysconf(_SC_PHYS_PAGES); if (num_pages == -1) ERR("sysconf(_SC_PHYS_PAGES) is not supported"); +#else + ERR("sysconf(_SC_PHYS_PAGES) is not supported"); +#endif mem = page_size * num_pages; return mem / 100 * percent; diff --git a/src/utilities.c b/src/utilities.c index 61b4f85..16c02d8 100644 --- a/src/utilities.c +++ b/src/utilities.c @@ -13,7 +13,7 @@ \******************************************************************************/ #ifdef HAVE_CONFIG_H -#include "config.h" +# include "config.h" #endif #include @@ -25,14 +25,18 @@ #include #include #include + #ifndef _WIN32 -#include -#ifdef __sun /* SunOS does not support statfs(), instead uses statvfs() */ -#include -#else /* !__sun */ -#include -#endif /* __sun */ -#include /* gettimeofday() */ +# include +# ifdef __sun /* SunOS does not support statfs(), instead uses statvfs() */ +# include +# elif (defined __APPLE__) +# include +# include +# else /* ! __sun or __APPLE__ */ +# include +# endif /* __sun */ +# include /* gettimeofday() */ #endif #include "utilities.h"