mirror of https://gitlab.com/rnger/amath
Haiku support
This commit is contained in:
parent
abd4bb8929
commit
e10734c005
|
@ -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);
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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>
|
||||
|
|
Loading…
Reference in New Issue