diff --git a/WinPort/WinCompat.h b/WinPort/WinCompat.h index 746bc69..292a5ff 100644 --- a/WinPort/WinCompat.h +++ b/WinPort/WinCompat.h @@ -83,7 +83,7 @@ typedef unsigned __int64 uint64_t; # define st_atim st_atimespec # include #else -# include +# include #endif #include diff --git a/WinPort/src/APIClipboard.cpp b/WinPort/src/APIClipboard.cpp index 3c668cd..248fb3a 100644 --- a/WinPort/src/APIClipboard.cpp +++ b/WinPort/src/APIClipboard.cpp @@ -224,7 +224,7 @@ extern "C" { #ifdef _WIN32 size_t len = _msize(mem); -#elif defined(__APPLE__) +#elif defined (__HAIKU__) size_t len = malloc_size(mem); #else size_t len = malloc_usable_size(mem); diff --git a/WinPort/src/APIFSNotify.cpp b/WinPort/src/APIFSNotify.cpp index fde66fb..ee491a7 100644 --- a/WinPort/src/APIFSNotify.cpp +++ b/WinPort/src/APIFSNotify.cpp @@ -4,7 +4,7 @@ #include #include #include -#ifndef __APPLE__ +#if !defined (__APPLE__) && !defined (__HAIKU__) #include #endif #include @@ -32,7 +32,7 @@ class WinPortFSNotify : public WinPortEvent void AddWatch(const char *path) { int w = -1; -#ifndef __APPLE__ +#if !defined (__APPLE__) && !defined (__HAIKU__) uint32_t mask = 0; //TODO: be smarter with filtering @@ -86,7 +86,7 @@ class WinPortFSNotify : public WinPortEvent void WatcherProc() { -#ifndef __APPLE__ +#if !defined (__APPLE__) && !defined (__HAIKU__) union { struct inotify_event ie; char space[ sizeof(struct inotify_event) + NAME_MAX + 10 ]; @@ -131,7 +131,7 @@ class WinPortFSNotify : public WinPortEvent void StopWatching() { -#ifndef __APPLE__ +#if !defined (__APPLE__) && !defined (__HAIKU__) if (_fd!=-1) { if (_watching) { _watching = false; @@ -155,7 +155,7 @@ public: : WinPortEvent(true, false), _watcher(0), _filter(dwNotifyFilter), _watching(false) { -#ifndef __APPLE__ +#if !defined (__APPLE__) && !defined (__HAIKU__) _fd = inotify_init1(IN_CLOEXEC | IN_NONBLOCK); if (_fd==-1) return; diff --git a/WinPort/src/APIFiles.cpp b/WinPort/src/APIFiles.cpp index a592989..01ea590 100644 --- a/WinPort/src/APIFiles.cpp +++ b/WinPort/src/APIFiles.cpp @@ -625,7 +625,7 @@ extern "C" if ( PreMatchDType(de->d_type) && MatchName(de->d_name) ) { mode_t hint_mode_type; - switch (de->d_type) { +/* switch (de->d_type) { case DT_DIR: hint_mode_type = S_IFDIR; break; case DT_REG: hint_mode_type = S_IFREG; break; case DT_LNK: hint_mode_type = S_IFLNK; break; @@ -635,7 +635,7 @@ extern "C" case DT_SOCK: hint_mode_type = S_IFSOCK; break; default: hint_mode_type = 0; } - if (MatchAttributesAndFillWFD(hint_mode_type, de->d_name, lpFindFileData)) +*/ if (MatchAttributesAndFillWFD(hint_mode_type, de->d_name, lpFindFileData)) return true; } } @@ -713,12 +713,12 @@ extern "C" bool PreMatchDType(unsigned char d_type) { - switch (d_type) { +/* switch (d_type) { case DT_DIR: return (_flags & FIND_FILE_FLAG_NO_DIRS) == 0; case DT_REG: return (_flags & FIND_FILE_FLAG_NO_FILES) == 0; case DT_LNK: return (_flags & FIND_FILE_FLAG_NO_LINKS) == 0; case DT_UNKNOWN: return true; - +*/ default: return (_flags&FIND_FILE_FLAG_NO_DEVICES) == 0; } diff --git a/WinPort/src/sudo/sudo_client_api.cpp b/WinPort/src/sudo/sudo_client_api.cpp index 7c546aa..de9537e 100644 --- a/WinPort/src/sudo/sudo_client_api.cpp +++ b/WinPort/src/sudo/sudo_client_api.cpp @@ -15,7 +15,7 @@ #include "sudo_private.h" #include "sudo.h" -#ifndef __APPLE__ +#if !defined(__APPLE__) && !defined(__HAIKU__) # include # include #endif @@ -1012,7 +1012,7 @@ extern "C" __attribute__ ((visibility("default"))) int sdc_fsetxattr(int fd, con extern "C" __attribute__ ((visibility("default"))) int sdc_fs_flags_set(const char *path, int flags) { -#ifdef __APPLE__ +#if defined(__APPLE__) || (__HAIKU__) //TODO return 0; #else diff --git a/WinPort/src/sudo/sudo_dispatcher.cpp b/WinPort/src/sudo/sudo_dispatcher.cpp index 54af120..5e8bd6a 100644 --- a/WinPort/src/sudo/sudo_dispatcher.cpp +++ b/WinPort/src/sudo/sudo_dispatcher.cpp @@ -6,6 +6,7 @@ #include #include #include +#ifndef __HAIKU__ #ifdef __APPLE__ #include #else @@ -13,6 +14,7 @@ #include #include #endif +#endif #include #include #include @@ -452,7 +454,7 @@ namespace Sudo static void OnSudoDispatch_FSFlagsGet(BaseTransaction &bt) { -#ifndef __APPLE__ +#if !defined (__APPLE__) && !defined (__HAIKU__) std::string path; bt.RecvStr(path); int r = -1; diff --git a/WinPort/sudo.h b/WinPort/sudo.h index 178192e..2f151b9 100644 --- a/WinPort/sudo.h +++ b/WinPort/sudo.h @@ -3,8 +3,8 @@ #include #ifdef __APPLE__ #include -#else - #include +/*#else + #include */ #endif #include diff --git a/multiarc/src/ArcMix.cpp b/multiarc/src/ArcMix.cpp index 3dcc61a..27034fc 100644 --- a/multiarc/src/ArcMix.cpp +++ b/multiarc/src/ArcMix.cpp @@ -4,7 +4,7 @@ #include #include #include -#include +//#include #include #include #include diff --git a/utils/src/utils.cpp b/utils/src/utils.cpp index de2a9ec..01af2c5 100644 --- a/utils/src/utils.cpp +++ b/utils/src/utils.cpp @@ -274,7 +274,7 @@ ErrnoSaver::~ErrnoSaver() ////////// int pipe_cloexec(int pipedes[2]) { -#ifdef __APPLE__ +#if defined(__APPLE__) || (__HAIKU__) int r = pipe(pipedes); if (r==0) { fcntl(pipedes[0], F_SETFD, FD_CLOEXEC);