     }
  #else
     if (gfx_capabilities) {
+diff -urN allegro-4.4.1.1/src/file.c allegro-4.4.1.1-haiku/src/file.c
+--- allegro-4.4.1.1/src/file.c	2008-10-23 13:38:21.006815744 +0000
++++ allegro-4.4.1.1-haiku/src/file.c	2010-10-30 22:46:02.595853312 +0000
+@@ -31,6 +31,10 @@
+ #include "allegro.h"
+ #include "allegro/internal/aintern.h"
+ 
++#ifdef ALLEGRO_HAIKU
++   #define O_BINARY 0
++#endif
++
+ #ifndef ALLEGRO_MPW
+    #include <sys/stat.h>
+ #endif

diff -Naur allegro-4.4.1.1/src/beos/bdwindow.cpp allegro-4.4.1.1-haiku/src/beos/bdwindow.cpp
--- allegro-4.4.1.1/src/beos/bdwindow.cpp	2008-10-21 01:03:43.042467328 +0000
+++ allegro-4.4.1.1-haiku/src/beos/bdwindow.cpp	2010-09-20 02:39:19.000000000 +0000
@@ -413,9 +413,9 @@
    }
 

 #else
    bmp->read_bank = _be_gfx_bwindow_read_write_bank_asm;
    bmp->write_bank = _be_gfx_bwindow_read_write_bank_asm;
diff -urN allegro-4.4.1.1/src/beos/bwindow.cpp allegro-4.4.1.1-haiku/src/beos/bwindow.cpp
--- allegro-4.4.1.1/src/beos/bwindow.cpp	2008-10-20 08:27:27.061603840 +0000
+++ allegro-4.4.1.1-haiku/src/beos/bwindow.cpp	2010-10-30 22:40:51.000000000 +0000
@@ -347,9 +347,9 @@
    }
    
