mirror of
https://github.com/glest/glest-source.git
synced 2025-08-16 05:13:59 +02:00
Merge pull request #141 from devnexen/openbsd_build
better openbsd support
This commit is contained in:
@@ -1093,7 +1093,7 @@ uint32 getFolderTreeContentsCheckSumRecursively(const string &path, const string
|
|||||||
glob_t globbuf;
|
glob_t globbuf;
|
||||||
|
|
||||||
int res = glob(mypath.c_str(), 0, 0, &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) {
|
if(res < 0) {
|
||||||
std::stringstream msg;
|
std::stringstream msg;
|
||||||
msg << "#2 Couldn't scan directory '" << mypath << "': " << strerror(errno);
|
msg << "#2 Couldn't scan directory '" << mypath << "': " << strerror(errno);
|
||||||
@@ -1127,13 +1127,13 @@ uint32 getFolderTreeContentsCheckSumRecursively(const string &path, const string
|
|||||||
globfree(&globbuf);
|
globfree(&globbuf);
|
||||||
|
|
||||||
// Look recursively for sub-folders
|
// 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);
|
res = glob(mypath.c_str(), 0, 0, &globbuf);
|
||||||
#else
|
#else
|
||||||
res = glob(mypath.c_str(), GLOB_ONLYDIR, 0, &globbuf);
|
res = glob(mypath.c_str(), GLOB_ONLYDIR, 0, &globbuf);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !defined(__APPLE__) && !defined(__FreeBSD__)
|
#if !defined(__APPLE__) && !defined(__FreeBSD__) && !defined(__OpenBSD__)
|
||||||
if(res < 0) {
|
if(res < 0) {
|
||||||
std::stringstream msg;
|
std::stringstream msg;
|
||||||
msg << "#3 Couldn't scan directory '" << mypath << "': " << strerror(errno);
|
msg << "#3 Couldn't scan directory '" << mypath << "': " << strerror(errno);
|
||||||
@@ -1142,7 +1142,7 @@ uint32 getFolderTreeContentsCheckSumRecursively(const string &path, const string
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
for(int i = 0; i < (int)globbuf.gl_pathc; ++i) {
|
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;
|
struct stat statStruct;
|
||||||
// only process if dir..
|
// only process if dir..
|
||||||
lstat( globbuf.gl_pathv[i], &statStruct);
|
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);
|
int res = glob(mypath.c_str(), globFlags, 0, &globbuf);
|
||||||
#if !defined(__APPLE__) && !defined(__FreeBSD__)
|
#if !defined(__APPLE__) && !defined(__FreeBSD__) && !defined(__OpenBSD__)
|
||||||
if(res < 0) {
|
if(res < 0) {
|
||||||
std::stringstream msg;
|
std::stringstream msg;
|
||||||
msg << "#4 Couldn't scan directory '" << mypath << "': " << strerror(errno);
|
msg << "#4 Couldn't scan directory '" << mypath << "': " << strerror(errno);
|
||||||
@@ -1307,14 +1307,14 @@ vector<string> getFolderTreeContentsListRecursively(const string &path, const st
|
|||||||
globfree(&globbuf);
|
globfree(&globbuf);
|
||||||
|
|
||||||
// Look recursively for sub-folders
|
// 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);
|
res = glob(mypath.c_str(), 0, 0, &globbuf);
|
||||||
#else //APPLE doesn't have the GLOB_ONLYDIR definition..
|
#else //APPLE doesn't have the GLOB_ONLYDIR definition..
|
||||||
globFlags |= GLOB_ONLYDIR;
|
globFlags |= GLOB_ONLYDIR;
|
||||||
res = glob(mypath.c_str(), globFlags, 0, &globbuf);
|
res = glob(mypath.c_str(), globFlags, 0, &globbuf);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !defined(__APPLE__) && !defined(__FreeBSD__)
|
#if !defined(__APPLE__) && !defined(__FreeBSD__) && !defined(__OpenBSD__)
|
||||||
if(res < 0) {
|
if(res < 0) {
|
||||||
std::stringstream msg;
|
std::stringstream msg;
|
||||||
msg << "#5 Couldn't scan directory '" << mypath << "': " << strerror(errno);
|
msg << "#5 Couldn't scan directory '" << mypath << "': " << strerror(errno);
|
||||||
@@ -1323,7 +1323,7 @@ vector<string> getFolderTreeContentsListRecursively(const string &path, const st
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
for(int i = 0; i < (int)globbuf.gl_pathc; ++i) {
|
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;
|
struct stat statStruct;
|
||||||
// only get if dir..
|
// only get if dir..
|
||||||
lstat( globbuf.gl_pathv[ i], &statStruct);
|
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);
|
int res = glob(mypath.c_str(), 0, 0, &globbuf);
|
||||||
|
|
||||||
#if !defined(__APPLE__) && !defined(__FreeBSD__)
|
#if !defined(__APPLE__) && !defined(__FreeBSD__) && !defined(__OpenBSD__)
|
||||||
if(res < 0) {
|
if(res < 0) {
|
||||||
std::stringstream msg;
|
std::stringstream msg;
|
||||||
msg << "#6 Couldn't scan directory '" << mypath << "': " << strerror(errno);
|
msg << "#6 Couldn't scan directory '" << mypath << "': " << strerror(errno);
|
||||||
@@ -1447,13 +1447,13 @@ vector<std::pair<string,uint32> > getFolderTreeContentsCheckSumListRecursively(c
|
|||||||
globfree(&globbuf);
|
globfree(&globbuf);
|
||||||
|
|
||||||
// Look recursively for sub-folders
|
// 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);
|
res = glob(mypath.c_str(), 0, 0, &globbuf);
|
||||||
#else //APPLE doesn't have the GLOB_ONLYDIR definition..
|
#else //APPLE doesn't have the GLOB_ONLYDIR definition..
|
||||||
res = glob(mypath.c_str(), GLOB_ONLYDIR, 0, &globbuf);
|
res = glob(mypath.c_str(), GLOB_ONLYDIR, 0, &globbuf);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !defined(__APPLE__) && !defined(__FreeBSD__)
|
#if !defined(__APPLE__) && !defined(__FreeBSD__) && !defined(__OpenBSD__)
|
||||||
if(res < 0) {
|
if(res < 0) {
|
||||||
std::stringstream msg;
|
std::stringstream msg;
|
||||||
msg << "#7 Couldn't scan directory '" << mypath << "': " << strerror(errno);
|
msg << "#7 Couldn't scan directory '" << mypath << "': " << strerror(errno);
|
||||||
@@ -1462,7 +1462,7 @@ vector<std::pair<string,uint32> > getFolderTreeContentsCheckSumListRecursively(c
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
for(int i = 0; i < (int)globbuf.gl_pathc; ++i) {
|
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;
|
struct stat statStruct;
|
||||||
// only get if dir..
|
// only get if dir..
|
||||||
lstat( globbuf.gl_pathv[ i], &statStruct);
|
lstat( globbuf.gl_pathv[ i], &statStruct);
|
||||||
|
@@ -319,7 +319,7 @@ string Ip::getString() const{
|
|||||||
// class Socket
|
// 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
|
# define USE_GETIFADDRS 1
|
||||||
# include <ifaddrs.h>
|
# include <ifaddrs.h>
|
||||||
#endif
|
#endif
|
||||||
|
Reference in New Issue
Block a user