Removed workaround for open_memstream and fmemopen for Haiku as these have been fixed in Haiku.
Make use of find_directory() for locating B_USER_DIRECTORY to save TuxPaint's user files. TODO: Get opening of files working again for Haiku.
This commit is contained in:
parent
7118469f05
commit
cc4a2a34d7
1 changed files with 12 additions and 7 deletions
|
|
@ -233,6 +233,8 @@ char *strcasestr(const char *haystack, const char *needle)
|
||||||
|
|
||||||
#ifdef __HAIKU__
|
#ifdef __HAIKU__
|
||||||
#include <zconf.h>
|
#include <zconf.h>
|
||||||
|
#include <FindDirectory.h>
|
||||||
|
#include <fs_info.h>
|
||||||
#endif
|
#endif
|
||||||
#if defined __BEOS__ || defined __HAIKU__ || defined __APPLE__
|
#if defined __BEOS__ || defined __HAIKU__ || defined __APPLE__
|
||||||
#include <wchar.h>
|
#include <wchar.h>
|
||||||
|
|
@ -512,7 +514,7 @@ extern WrapperData macosx;
|
||||||
|
|
||||||
//#define fmemopen_alternative */ /* Uncomment this to test the fmemopen alternative in systems were fmemopen exists */
|
//#define fmemopen_alternative */ /* Uncomment this to test the fmemopen alternative in systems were fmemopen exists */
|
||||||
|
|
||||||
#if defined (__HAIKU__) || defined (WIN32) || defined (__APPLE__) // Haiku, MINGW/MSYS, and MacOSX need it, at least for now
|
#if defined (WIN32) || defined (__APPLE__) // MINGW/MSYS, and MacOSX need it, at least for now
|
||||||
#define fmemopen_alternative
|
#define fmemopen_alternative
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
@ -12978,10 +12980,6 @@ static void set_chunk_data(unsigned char **chunk_data, size_t * chunk_data_len,
|
||||||
free(headers);
|
free(headers);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(__HAIKU__)
|
|
||||||
#define open_memstream fdopen // Haiku doesn't use open_memstream
|
|
||||||
#endif
|
|
||||||
|
|
||||||
static void do_png_embed_data(png_structp png_ptr)
|
static void do_png_embed_data(png_structp png_ptr)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
@ -21305,8 +21303,15 @@ static void setup_config(char *argv[])
|
||||||
{
|
{
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
savedir = GetDefaultSaveDir("TuxPaint");
|
savedir = GetDefaultSaveDir("TuxPaint");
|
||||||
#elif defined __BEOS__ || defined __HAIKU__
|
#elif __BEOS__
|
||||||
savedir = strdup("./tuxpaint");
|
savedir = strdup("~/tuxpaint");
|
||||||
|
#elif __HAIKU__
|
||||||
|
/* Haiku: Make use of find_directory() */
|
||||||
|
dev_t volume = dev_for_path("/boot");
|
||||||
|
char buffer[B_PATH_NAME_LENGTH+B_FILE_NAME_LENGTH];
|
||||||
|
status_t result;
|
||||||
|
result = find_directory(B_USER_DIRECTORY, volume, false, buffer, sizeof(buffer));
|
||||||
|
asprintf((char**)&savedir, "%s/%s", buffer, "TuxPaint");
|
||||||
#elif __APPLE__
|
#elif __APPLE__
|
||||||
savedir = strdup(macosx.preferencesPath);
|
savedir = strdup(macosx.preferencesPath);
|
||||||
#else
|
#else
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue