Files
haikuports/app-misc/far/patches/far.patch
2017-07-31 20:45:33 +03:00

205 lines
5.7 KiB
Diff

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 <sys/syslimits.h>
#else
-# include <linux/limits.h>
+# include <limits.h>
#endif
#include <sys/types.h>
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 <chrono>
#include <thread>
#include <condition_variable>
-#ifndef __APPLE__
+#if !defined (__APPLE__) && !defined (__HAIKU__)
#include <sys/inotify.h>
#endif
#include <pthread.h>
@@ -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 <sys/ioctl.h>
# include <linux/fs.h>
#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 <fcntl.h>
#include <string.h>
#include <sys/stat.h>
+#ifndef __HAIKU__
#ifdef __APPLE__
#include <sys/mount.h>
#else
@@ -13,6 +14,7 @@
#include <sys/ioctl.h>
#include <linux/fs.h>
#endif
+#endif
#include <sys/statvfs.h>
#include <sys/time.h>
#include <sys/types.h>
@@ -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 <sys/statvfs.h>
#ifdef __APPLE__
#include <sys/mount.h>
-#else
- #include <sys/statfs.h>
+/*#else
+ #include <sys/statfs.h>*/
#endif
#include <dirent.h>
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 <stdlib.h>
#include <string.h>
#include <unistd.h>
-#include <wordexp.h>
+//#include <wordexp.h>
#include <sys/stat.h>
#include <windows.h>
#include <string>
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);