Haiku support

This commit is contained in:
Carsten Larsen 2017-02-02 22:58:07 +01:00
parent cc085c83e7
commit 7cdebb3c9d
4 changed files with 10 additions and 5 deletions

View File

@ -38,7 +38,7 @@
CharBuffer* StandardFilesystem::ListDirectory(const char *path)
{
#ifdef UNIX
#if defined(UNIX) || defined(HAIKU)
CharBuffer *pathbuf = new CharBuffer();
pathbuf->Empty();
if (path == NOMEM) {
@ -82,6 +82,9 @@ CharBuffer* StandardFilesystem::ListDirectory(const char *path)
const char *type;
#ifdef HAIKU
type = TXTLISTDIRTUNKNOWN;
#else
switch (entry->d_type) {
case DT_REG:
type = TXTLISTDIRTFILE;
@ -92,6 +95,7 @@ CharBuffer* StandardFilesystem::ListDirectory(const char *path)
default:
type = TXTLISTDIRTUNKNOWN;
}
#endif
const unsigned short colsize = 12;
unsigned int a = StrLen(type) > colsize ? colsize : StrLen(type);

View File

@ -27,6 +27,7 @@
#ifndef _LANGUAGE_POSIX_H
#define _LANGUAGE_POSIX_H
#include "clib.h"
#include "localize/lex.h"
#include "localize/help.h"
#include "localize/text.h"

View File

@ -33,7 +33,7 @@
#include <stdio.h>
#include <stdlib.h>
#ifdef UNIX
#if defined(UNIX) && defined(HAIKU)
static const char *tempname = "/tmp/amath.prefs";
static const char *permname = "/usr/local/etc/amath.conf";
#else
@ -43,7 +43,7 @@ static const char *permname = "amath.conf";
bool StandardPreferences::Load()
{
#ifdef UNIX
#if defined(UNIX) && defined(HAIKU)
FILE *file = fopen(tempname, "r");
if (!file) {
return false;
@ -85,7 +85,7 @@ bool StandardPreferences::Save()
bool StandardPreferences::SavePrefs(const char* name)
{
#ifdef UNIX
#if defined(UNIX) && defined(HAIKU)
FILE *file = fopen(name, "w");
if (!file) {
return false;

View File

@ -28,7 +28,7 @@
#include "system/task_stdc.h"
#include "system/base/thread.h"
#ifdef UNIX
#if defined(UNIX) || defined(HAIKU)
#include <unistd.h>
#include <sys/types.h>
#include <sys/wait.h>