Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorscottmc <scottmc>2010-06-02 15:40:11 (GMT)
committer scottmc <scottmc>2010-06-02 15:40:11 (GMT)
commit743ac23f9c173b8051bd09d1ce0e31b9c89cc8e9 (patch)
tree7024567b439ad033007e9328c112ddea2da92c5b
parent91c4ac70a6452d1514f333658c2f475353a35ef9 (diff)
This now allows tuxpaint to build on a gcc4 Haiku.
-rw-r--r--Makefile4
-rw-r--r--src/tuxpaint.c19
2 files changed, 15 insertions, 8 deletions
diff --git a/Makefile b/Makefile
index a85601c..707cf67 100644
--- a/Makefile
+++ b/Makefile
@@ -49,7 +49,7 @@ comptest = $(shell if $(CC) $(CPPFLAGS) $(CFLAGS) $(1) $(2) -o dummy.o dummy.c $
echo "$(1)"; \
fi ;)
-beos_RSRC_CMD:=rc src/tuxpaint.rdef && xres -o tuxpaint src/tuxpaint.rsrc
+beos_RSRC_CMD:=rc haiku/tuxpaint.rdef && xres -o tuxpaint haiku/tuxpaint.rsrc
RSRC_CMD:=$($(OS)_RSRC_CMD)
beos_MIMESET_CMD:=mimeset -f tuxpaint
@@ -82,7 +82,7 @@ FRIBIDI_CFLAGS:=$(shell $(PKG_CONFIG) --cflags fribidi)
windows_ARCH_LINKS:=-lintl $(PNG) -lz -lwinspool -lshlwapi $(FRIBIDI_LIB)
osx_ARCH_LINKS:=$(PAPER_LIB) $(FRIBIDI_LIB)
-beos_ARCH_LINKS:="-lintl $(PNG) -lz -lbe -lnetwork -liconv $(FRIBIDI_LIB)"
+beos_ARCH_LINKS:="-lintl $(PNG) -lz -lbe -lnetwork -liconv $(FRIBIDI_LIB) $(PAPER_LIB) -lstdc++"
linux_ARCH_LINKS:=$(PAPER_LIB) $(FRIBIDI_LIB)
ARCH_LINKS:=$($(OS)_ARCH_LINKS)
diff --git a/src/tuxpaint.c b/src/tuxpaint.c
index 62b1a1d..39a0576 100644
--- a/src/tuxpaint.c
+++ b/src/tuxpaint.c
@@ -499,7 +499,11 @@ extern WrapperData macosx;
)
#endif
-/* #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 */
+
+#ifdef (__HAIKU__) // Haiku needs it, at least for now
+#define fmemopen_alternative
+#endif
#ifdef fmemopen_alternative
#undef fmemopen
@@ -9239,7 +9243,7 @@ static void reset_avail_tools(void)
disallow_print = 1;
#endif
-#if defined __BEOS__ || __HAIKU__
+#if defined __BEOS__
if (!IsPrinterAvailable())
disallow_print = disable_print = 1;
#endif
@@ -12160,6 +12164,9 @@ static void set_chunk_data(unsigned char **chunk_data, size_t * chunk_data_len,
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)
{
@@ -15172,7 +15179,7 @@ void do_print(void)
SDL_BlitSurface(canvas, NULL, save_canvas, NULL);
SDL_BlitSurface(label, NULL, save_canvas, NULL);
-#if !defined(WIN32) && !defined(__BEOS__) && !defined(__APPLE__)
+#if !defined(WIN32) && !defined(__BEOS__) && !defined(__APPLE__) && !defined(__HAIKU__)
const char *pcmd;
FILE *pi;
@@ -15224,8 +15231,8 @@ void do_print(void)
if (error)
fprintf(stderr, "%s\n", error);
}
-#elif defined(__BEOS__) || defined(__HAIKU__)
- /* BeOS and Haiku*/
+#elif defined(__BEOS__)
+ /* BeOS */
SurfacePrint(save_canvas);
#elif defined(__APPLE__)
@@ -20134,7 +20141,7 @@ void load_embedded_data(char *fname, SDL_Surface * org_surf)
/////////////////////////////////////////////////////////////////////////////
-#if !defined(WIN32) && !defined(__APPLE__) && !defined(__BEOS__)
+#if !defined(WIN32) && !defined(__APPLE__) && !defined(__BEOS__) && !defined(__HAIKU__)
static void show_available_papersizes(int exitcode)
{
FILE *fi = exitcode ? stderr : stdout;