Merge pull request #141 from devnexen/openbsd_build

better openbsd support
This commit is contained in:
Mark Vejvoda 2017-02-05 13:32:59 -08:00 committed by GitHub
commit 15c3edae4f
2 changed files with 13 additions and 13 deletions

View File

@ -1093,7 +1093,7 @@ uint32 getFolderTreeContentsCheckSumRecursively(const string &path, const string
glob_t globbuf;
int res = glob(mypath.c_str(), 0, 0, &globbuf);
#if !defined(__APPLE__) && !defined(__FreeBSD__)
#if !defined(__APPLE__) && !defined(__FreeBSD__) && !defined(__OpenBSD__)
if(res < 0) {
std::stringstream msg;
msg << "#2 Couldn't scan directory '" << mypath << "': " << strerror(errno);
@ -1127,13 +1127,13 @@ uint32 getFolderTreeContentsCheckSumRecursively(const string &path, const string
globfree(&globbuf);
// Look recursively for sub-folders
#if defined(__APPLE__) || defined(__FreeBSD__)
#if defined(__APPLE__) || defined(__FreeBSD__) || defined(__OpenBSD__)
res = glob(mypath.c_str(), 0, 0, &globbuf);
#else
res = glob(mypath.c_str(), GLOB_ONLYDIR, 0, &globbuf);
#endif
#if !defined(__APPLE__) && !defined(__FreeBSD__)
#if !defined(__APPLE__) && !defined(__FreeBSD__) && !defined(__OpenBSD__)
if(res < 0) {
std::stringstream msg;
msg << "#3 Couldn't scan directory '" << mypath << "': " << strerror(errno);
@ -1142,7 +1142,7 @@ uint32 getFolderTreeContentsCheckSumRecursively(const string &path, const string
#endif
for(int i = 0; i < (int)globbuf.gl_pathc; ++i) {
#if defined(__APPLE__) || defined(__FreeBSD__)
#if defined(__APPLE__) || defined(__FreeBSD__) || defined(__OpenBSD__)
struct stat statStruct;
// only process if dir..
lstat( globbuf.gl_pathv[i], &statStruct);
@ -1274,7 +1274,7 @@ vector<string> getFolderTreeContentsListRecursively(const string &path, const st
}
int res = glob(mypath.c_str(), globFlags, 0, &globbuf);
#if !defined(__APPLE__) && !defined(__FreeBSD__)
#if !defined(__APPLE__) && !defined(__FreeBSD__) && !defined(__OpenBSD__)
if(res < 0) {
std::stringstream msg;
msg << "#4 Couldn't scan directory '" << mypath << "': " << strerror(errno);
@ -1307,14 +1307,14 @@ vector<string> getFolderTreeContentsListRecursively(const string &path, const st
globfree(&globbuf);
// Look recursively for sub-folders
#if defined(__APPLE__) || defined(__FreeBSD__)
#if defined(__APPLE__) || defined(__FreeBSD__) || defined(__OpenBSD__)
res = glob(mypath.c_str(), 0, 0, &globbuf);
#else //APPLE doesn't have the GLOB_ONLYDIR definition..
globFlags |= GLOB_ONLYDIR;
res = glob(mypath.c_str(), globFlags, 0, &globbuf);
#endif
#if !defined(__APPLE__) && !defined(__FreeBSD__)
#if !defined(__APPLE__) && !defined(__FreeBSD__) && !defined(__OpenBSD__)
if(res < 0) {
std::stringstream msg;
msg << "#5 Couldn't scan directory '" << mypath << "': " << strerror(errno);
@ -1323,7 +1323,7 @@ vector<string> getFolderTreeContentsListRecursively(const string &path, const st
#endif
for(int i = 0; i < (int)globbuf.gl_pathc; ++i) {
#if defined(__APPLE__) || defined(__FreeBSD__)
#if defined(__APPLE__) || defined(__FreeBSD__) || defined(__OpenBSD__)
struct stat statStruct;
// only get if dir..
lstat( globbuf.gl_pathv[ i], &statStruct);
@ -1415,7 +1415,7 @@ vector<std::pair<string,uint32> > getFolderTreeContentsCheckSumListRecursively(c
int res = glob(mypath.c_str(), 0, 0, &globbuf);
#if !defined(__APPLE__) && !defined(__FreeBSD__)
#if !defined(__APPLE__) && !defined(__FreeBSD__) && !defined(__OpenBSD__)
if(res < 0) {
std::stringstream msg;
msg << "#6 Couldn't scan directory '" << mypath << "': " << strerror(errno);
@ -1447,13 +1447,13 @@ vector<std::pair<string,uint32> > getFolderTreeContentsCheckSumListRecursively(c
globfree(&globbuf);
// Look recursively for sub-folders
#if defined(__APPLE__) || defined(__FreeBSD__)
#if defined(__APPLE__) || defined(__FreeBSD__) || defined(__OpenBSD__)
res = glob(mypath.c_str(), 0, 0, &globbuf);
#else //APPLE doesn't have the GLOB_ONLYDIR definition..
res = glob(mypath.c_str(), GLOB_ONLYDIR, 0, &globbuf);
#endif
#if !defined(__APPLE__) && !defined(__FreeBSD__)
#if !defined(__APPLE__) && !defined(__FreeBSD__) && !defined(__OpenBSD__)
if(res < 0) {
std::stringstream msg;
msg << "#7 Couldn't scan directory '" << mypath << "': " << strerror(errno);
@ -1462,7 +1462,7 @@ vector<std::pair<string,uint32> > getFolderTreeContentsCheckSumListRecursively(c
#endif
for(int i = 0; i < (int)globbuf.gl_pathc; ++i) {
#if defined(__APPLE__) || defined(__FreeBSD__)
#if defined(__APPLE__) || defined(__FreeBSD__) || defined(__OpenBSD__)
struct stat statStruct;
// only get if dir..
lstat( globbuf.gl_pathv[ i], &statStruct);

View File

@ -319,7 +319,7 @@ string Ip::getString() const{
// class Socket
// ===============================================
#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(BSD) || defined(__APPLE__) || defined(__linux__)
#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__OpenBSD__) || defined(BSD) || defined(__APPLE__) || defined(__linux__)
# define USE_GETIFADDRS 1
# include <ifaddrs.h>
#endif