Re: [AD] Improvements for OpenBSD

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


Evert Glebbeek <eglebbk@xxxxxxxxxx> wrote:

> Can you try to regenerate the patch and send it again? Otherwise, I can 
> apply the patch manually, but it'll be saturday before I can hope to do 
> that.

New patch against the 4.2 branch in svn follows.

regards,
Graue


Index: src/i386/istretch.c
===================================================================
--- src/i386/istretch.c	(revision 5738)
+++ src/i386/istretch.c	(working copy)
@@ -30,8 +30,13 @@
    #include "winalleg.h"   /* For VirtualProtect */
 #endif     /* ifdef ALLEGRO_WINDOWS */
 
+#ifdef HAVE_MPROTECT
+   #include <sys/types.h>
+   #include <sys/mman.h>
+#endif     /* ifdef HAVE_MPROTECT */
 
 
 /* helper macro for generating stretchers in each color depth */
 #define DECLARE_STRETCHER(sz, mask, scale)                                   \
 {                                                                            \
@@ -435,7 +440,9 @@
  #ifdef ALLEGRO_WINDOWS
    /* Play nice with Windows executable memory protection */
    VirtualProtect(_scratch_mem, _scratch_mem_size, PAGE_EXECUTE_READWRITE, &old_protect);
- #endif     /* ifdef ALLEGRO_WINDOWS */
+ #elif defined(HAVE_MPROTECT)
+   mprotect(_scratch_mem, _scratch_mem_size, PROT_EXEC|PROT_READ|PROT_WRITE);
+ #endif
 
    /* call the stretcher */
    _do_stretch(source, dest, _scratch_mem, sx>>16, sy, syd, 
Index: src/unix/uesd.c
===================================================================
--- src/unix/uesd.c	(revision 5738)
+++ src/unix/uesd.c	(working copy)
@@ -27,6 +27,7 @@
 
 #include <sys/time.h>
 #include <sys/types.h>
+#include <string.h> /* FD_ZERO() needs this */
 #include <unistd.h>
 #include <esd.h>
 
Index: src/unix/usystem.c
===================================================================
--- src/unix/usystem.c	(revision 5738)
+++ src/unix/usystem.c	(working copy)
@@ -196,6 +196,9 @@
       else if (!strcmp(utsn.sysname, "NetBSD")) {
 	 os_type = OSTYPE_NETBSD;
       }
+      else if (!strcmp(utsn.sysname, "OpenBSD")) {
+	 os_type = OSTYPE_OPENBSD;
+      }
       else if ((!strcmp(utsn.sysname, "IRIX"))
 	       || (!strcmp(utsn.sysname, "IRIX64"))) {
 	 os_type = OSTYPE_IRIX;
Index: tools/grabber.c
===================================================================
--- tools/grabber.c	(revision 5738)
+++ tools/grabber.c	(working copy)
@@ -3121,6 +3121,7 @@
       case OSTYPE_SUNOS:      s = "SunOS/Solaris";              break;
       case OSTYPE_FREEBSD:    s = "FreeBSD";                    break;
       case OSTYPE_NETBSD:     s = "NetBSD";                     break;
+      case OSTYPE_OPENBSD:    s = "OpenBSD";                    break;
       case OSTYPE_IRIX:       s = "IRIX";                       break;
       case OSTYPE_DARWIN:     s = "Darwin";                     break;
       case OSTYPE_QNX:        s = "QNX";                        break;
Index: include/allegro/system.h
===================================================================
--- include/allegro/system.h	(revision 5738)
+++ include/allegro/system.h	(working copy)
@@ -55,6 +55,7 @@
 #define OSTYPE_SUNOS       AL_ID('S','U','N',' ')
 #define OSTYPE_FREEBSD     AL_ID('F','B','S','D')
 #define OSTYPE_NETBSD      AL_ID('N','B','S','D')
+#define OSTYPE_OPENBSD     AL_ID('O','B','S','D')
 #define OSTYPE_IRIX        AL_ID('I','R','I','X')
 #define OSTYPE_DARWIN      AL_ID('D','A','R','W')
 #define OSTYPE_QNX         AL_ID('Q','N','X',' ')
Index: configure.in
===================================================================
--- configure.in	(revision 5738)
+++ configure.in	(working copy)
@@ -713,7 +713,7 @@
 AC_STRUCT_TM
 AC_TYPE_SIGNAL
 
-AC_CHECK_FUNCS(mmap memcmp mkstemp stricmp strlwr strupr vprintf)
+AC_CHECK_FUNCS(mmap mprotect memcmp mkstemp stricmp strlwr strupr vprintf)
 
 dnl Tweak header files for library build
 CFLAGS="$CFLAGS -DALLEGRO_LIB_BUILD"




Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/