mirror of https://gitlab.com/rnger/amath
Haiku support
This commit is contained in:
parent
cc085c83e7
commit
7cdebb3c9d
|
@ -38,7 +38,7 @@
|
||||||
|
|
||||||
CharBuffer* StandardFilesystem::ListDirectory(const char *path)
|
CharBuffer* StandardFilesystem::ListDirectory(const char *path)
|
||||||
{
|
{
|
||||||
#ifdef UNIX
|
#if defined(UNIX) || defined(HAIKU)
|
||||||
CharBuffer *pathbuf = new CharBuffer();
|
CharBuffer *pathbuf = new CharBuffer();
|
||||||
pathbuf->Empty();
|
pathbuf->Empty();
|
||||||
if (path == NOMEM) {
|
if (path == NOMEM) {
|
||||||
|
@ -82,6 +82,9 @@ CharBuffer* StandardFilesystem::ListDirectory(const char *path)
|
||||||
|
|
||||||
const char *type;
|
const char *type;
|
||||||
|
|
||||||
|
#ifdef HAIKU
|
||||||
|
type = TXTLISTDIRTUNKNOWN;
|
||||||
|
#else
|
||||||
switch (entry->d_type) {
|
switch (entry->d_type) {
|
||||||
case DT_REG:
|
case DT_REG:
|
||||||
type = TXTLISTDIRTFILE;
|
type = TXTLISTDIRTFILE;
|
||||||
|
@ -92,6 +95,7 @@ CharBuffer* StandardFilesystem::ListDirectory(const char *path)
|
||||||
default:
|
default:
|
||||||
type = TXTLISTDIRTUNKNOWN;
|
type = TXTLISTDIRTUNKNOWN;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
const unsigned short colsize = 12;
|
const unsigned short colsize = 12;
|
||||||
unsigned int a = StrLen(type) > colsize ? colsize : StrLen(type);
|
unsigned int a = StrLen(type) > colsize ? colsize : StrLen(type);
|
||||||
|
|
|
@ -27,6 +27,7 @@
|
||||||
#ifndef _LANGUAGE_POSIX_H
|
#ifndef _LANGUAGE_POSIX_H
|
||||||
#define _LANGUAGE_POSIX_H
|
#define _LANGUAGE_POSIX_H
|
||||||
|
|
||||||
|
#include "clib.h"
|
||||||
#include "localize/lex.h"
|
#include "localize/lex.h"
|
||||||
#include "localize/help.h"
|
#include "localize/help.h"
|
||||||
#include "localize/text.h"
|
#include "localize/text.h"
|
||||||
|
|
|
@ -33,7 +33,7 @@
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
#ifdef UNIX
|
#if defined(UNIX) && defined(HAIKU)
|
||||||
static const char *tempname = "/tmp/amath.prefs";
|
static const char *tempname = "/tmp/amath.prefs";
|
||||||
static const char *permname = "/usr/local/etc/amath.conf";
|
static const char *permname = "/usr/local/etc/amath.conf";
|
||||||
#else
|
#else
|
||||||
|
@ -43,7 +43,7 @@ static const char *permname = "amath.conf";
|
||||||
|
|
||||||
bool StandardPreferences::Load()
|
bool StandardPreferences::Load()
|
||||||
{
|
{
|
||||||
#ifdef UNIX
|
#if defined(UNIX) && defined(HAIKU)
|
||||||
FILE *file = fopen(tempname, "r");
|
FILE *file = fopen(tempname, "r");
|
||||||
if (!file) {
|
if (!file) {
|
||||||
return false;
|
return false;
|
||||||
|
@ -85,7 +85,7 @@ bool StandardPreferences::Save()
|
||||||
|
|
||||||
bool StandardPreferences::SavePrefs(const char* name)
|
bool StandardPreferences::SavePrefs(const char* name)
|
||||||
{
|
{
|
||||||
#ifdef UNIX
|
#if defined(UNIX) && defined(HAIKU)
|
||||||
FILE *file = fopen(name, "w");
|
FILE *file = fopen(name, "w");
|
||||||
if (!file) {
|
if (!file) {
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -28,7 +28,7 @@
|
||||||
#include "system/task_stdc.h"
|
#include "system/task_stdc.h"
|
||||||
#include "system/base/thread.h"
|
#include "system/base/thread.h"
|
||||||
|
|
||||||
#ifdef UNIX
|
#if defined(UNIX) || defined(HAIKU)
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/wait.h>
|
#include <sys/wait.h>
|
||||||
|
|
Loading…
Reference in New Issue