aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--README6
-rw-r--r--configure.ac3
m---------scintilla0
-rw-r--r--src/interface-curses.cpp7
-rw-r--r--src/ioview.cpp14
-rw-r--r--src/main.cpp10
-rw-r--r--src/spawn.cpp2
7 files changed, 27 insertions, 15 deletions
diff --git a/README b/README
index 4a552aa..8835d95 100644
--- a/README
+++ b/README
@@ -24,13 +24,15 @@ The Curses frontend is verified to work with [ncurses](https://www.gnu.org/softw
[EMCurses](https://github.com/rhaberkorn/emcurses).
Others might work as well.
-Both Linux and Windows (MinGW 32/64) are tested and supported.
+Linux, Windows (MinGW 32/64) and
+[Haiku](https://www.haiku-os.org/) (gcc4) are tested and supported.
SciTECO compiles with both GCC and Clang.
SciTECO should compile just fine on other UNIX-compatible platforms,
like Mac OS X - however I cannot test it regularily and there is currently no
Mac OS X maintainer.
+However UNIX-compatibility is not strictly required:
Since SciTECO primarily depends on [glib](https://developer.gnome.org/glib/) and
-Curses, it should be easy to port to even more exotic platforms.
+some implementation of Curses, it should be easy to port to even more exotic platforms.
__Warning: The SciTECO language is work in progress and has not yet fully stabilized.
It may change drastically and in backwards-incompatible ways in the repository's
diff --git a/configure.ac b/configure.ac
index f952d44..3011c22 100644
--- a/configure.ac
+++ b/configure.ac
@@ -109,8 +109,9 @@ AC_CHECK_FUNCS([memset setlocale strchr strrchr fstat], , [
])
# Library functions that should exist on UNIX/Linux
+# and UNIXoid systems
case $host in
-*-*-darwin* | *-*-linux* | *-*-cygwin*)
+*-*-darwin* | *-*-linux* | *-*-cygwin* | *-*-haiku*)
AC_CHECK_FUNCS([realpath fchown dup dup2], , [
AC_MSG_ERROR([Missing libc function])
])
diff --git a/scintilla b/scintilla
-Subproject 3f61ee6101fcfc346f5c212a5ee16c450db8d2f
+Subproject 201ba525ed650145160dea05149435d6a38d5fa
diff --git a/src/interface-curses.cpp b/src/interface-curses.cpp
index b4d83ec..5180d48 100644
--- a/src/interface-curses.cpp
+++ b/src/interface-curses.cpp
@@ -80,9 +80,12 @@
#endif
#ifdef NCURSES_VERSION
-#ifdef G_OS_UNIX
+#if defined(G_OS_UNIX) || defined(G_OS_HAIKU)
/**
- * Whether we're on ncurses/UNIX
+ * Whether we're on ncurses/UNIX.
+ * Haiku has a UNIX-like terminal and is largely
+ * POSIX compliant, so we can handle it like a
+ * UNIX ncurses.
*/
#define NCURSES_UNIX
#elif defined(G_OS_WIN32)
diff --git a/src/ioview.cpp b/src/ioview.cpp
index 6cab3f9..71b5b9f 100644
--- a/src/ioview.cpp
+++ b/src/ioview.cpp
@@ -467,7 +467,7 @@ make_savepoint(const gchar *filename)
undo.push(new UndoTokenRestoreSavePoint(savepoint, filename));
}
-#endif /* !G_OS_UNIX */
+#endif
GIOStatus
IOView::save(GIOChannel *channel, guint position, gsize len,
@@ -603,7 +603,7 @@ IOView::save(const gchar *filename)
GError *error = NULL;
GIOChannel *channel;
-#ifdef G_OS_UNIX
+#if defined(G_OS_UNIX) || defined(G_OS_HAIKU)
GStatBuf file_stat;
file_stat.st_uid = -1;
file_stat.st_gid = -1;
@@ -612,7 +612,7 @@ IOView::save(const gchar *filename)
if (undo.enabled) {
if (g_file_test(filename, G_FILE_TEST_IS_REGULAR)) {
-#ifdef G_OS_UNIX
+#if defined(G_OS_UNIX) || defined(G_OS_HAIKU)
g_stat(filename, &file_stat);
#endif
attributes = get_file_attributes(filename);
@@ -644,7 +644,7 @@ IOView::save(const gchar *filename)
/* if file existed but has been renamed, restore attributes */
if (attributes != INVALID_FILE_ATTRIBUTES)
set_file_attributes(filename, attributes);
-#ifdef G_OS_UNIX
+#if defined(G_OS_UNIX) || defined(G_OS_HAIKU)
/*
* only a good try to inherit owner since process user must have
* CHOWN capability traditionally reserved to root only.
@@ -698,7 +698,7 @@ expand_path(const gchar *path)
return ret;
}
-#ifdef G_OS_UNIX
+#if defined(G_OS_UNIX) || defined(G_OS_HAIKU)
gchar *
get_absolute_path(const gchar *path)
@@ -752,7 +752,7 @@ file_is_visible(const gchar *path)
return !(get_file_attributes(path) & FILE_ATTRIBUTE_HIDDEN);
}
-#else /* !G_OS_UNIX && !G_OS_WIN32 */
+#else /* !G_OS_UNIX && !G_OS_HAIKU && !G_OS_WIN32 */
/*
* This will never canonicalize relative paths.
@@ -791,6 +791,6 @@ file_is_visible(const gchar *path)
return true;
}
-#endif /* !G_OS_UNIX && !G_OS_WIN32 */
+#endif /* !G_OS_UNIX && !G_OS_HAIKU && !G_OS_WIN32 */
} /* namespace SciTECO */
diff --git a/src/main.cpp b/src/main.cpp
index 951e5b3..1f89156 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -88,7 +88,7 @@ static gpointer g_realloc_exception(gpointer mem, gsize n_bytes);
static void sigint_handler(int signal);
}
-#ifdef G_OS_UNIX
+#if defined(G_OS_UNIX) || defined(G_OS_HAIKU)
void
interrupt(void)
@@ -102,7 +102,7 @@ interrupt(void)
sigint_occurred = TRUE;
}
-#else
+#else /* !G_OS_UNIX && !G_OS_HAIKU */
void
interrupt(void)
@@ -143,6 +143,12 @@ get_default_config_path(const gchar *program)
#elif defined(G_OS_UNIX)
+/*
+ * NOTE: We explicitly do not handle
+ * Haiku like UNIX here, since it appears to
+ * be uncommon on Haiku to clutter the HOME directory
+ * with config files.
+ */
static inline gchar *
get_default_config_path(const gchar *program)
{
diff --git a/src/spawn.cpp b/src/spawn.cpp
index cd160f9..4f11ce1 100644
--- a/src/spawn.cpp
+++ b/src/spawn.cpp
@@ -102,7 +102,7 @@ parse_shell_command_line(const gchar *cmdline, GError **error)
};
return g_strdupv((gchar **)argv_win32);
}
-#elif defined(G_OS_UNIX)
+#elif defined(G_OS_UNIX) || defined(G_OS_HAIKU)
if (!(Flags::ed & Flags::ED_SHELLEMU)) {
const gchar *argv_unix[] = {
"/bin/sh", "-c", cmdline, NULL