Hi,

Attached, compatibility patch, for BSD/OS 4.x and at quick glance, also
FreeBSD 4.6-RELEASE.

The reported error without patch is:
/home/mdev/cvs/php4/ext/sysvmsg/sysvmsg.c: In function `zif_msg_receive':
/home/mdev/cvs/php4/ext/sysvmsg/sysvmsg.c:271: sizeof applied to an incomplete type
/home/mdev/cvs/php4/ext/sysvmsg/sysvmsg.c:287: dereferencing pointer to incomplete type
/home/mdev/cvs/php4/ext/sysvmsg/sysvmsg.c:292: dereferencing pointer to incomplete type
/home/mdev/cvs/php4/ext/sysvmsg/sysvmsg.c:304: dereferencing pointer to incomplete type
/home/mdev/cvs/php4/ext/sysvmsg/sysvmsg.c: In function `zif_msg_send':
/home/mdev/cvs/php4/ext/sysvmsg/sysvmsg.c:344: sizeof applied to an incomplete type
/home/mdev/cvs/php4/ext/sysvmsg/sysvmsg.c:345: dereferencing pointer to incomplete type
/home/mdev/cvs/php4/ext/sysvmsg/sysvmsg.c:350: sizeof applied to an incomplete type
/home/mdev/cvs/php4/ext/sysvmsg/sysvmsg.c:351: dereferencing pointer to incomplete type
/home/mdev/cvs/php4/ext/sysvmsg/sysvmsg.c:356: dereferencing pointer to incomplete type

Further more, there is no MSG_EXCEPT, only MSG_NOERROR.
Subsequently there's no kernel support, to get the first message on the queue, that
has a different type than `msgtype'.
I have now just ifdeffed it, but it probably should be defined and issue
a warning, about this missing functionality - or ideally - the functionality should be
coded in.

-- 


Melvyn.
Index: ext/sysvmsg/config.m4
===================================================================
RCS file: /repository/php4/ext/sysvmsg/config.m4,v
retrieving revision 1.1
diff -u -r1.1 config.m4
--- ext/sysvmsg/config.m4       25 Apr 2002 23:14:43 -0000      1.1
+++ ext/sysvmsg/config.m4       8 Sep 2002 01:23:27 -0000
@@ -4,6 +4,32 @@
 [  --enable-sysvmsg           Enable sysvmsg support])
 
 if test "$PHP_SYSVMSG" != "no"; then
+  AC_MSG_CHECKING([whether sys/msg.h defines struct msgbuf or mymsg])
+  AC_TRY_COMPILE(
+   [#include <sys/types.h>
+    #include <sys/ipc.h>
+    #include <sys/msg.h>],
+   [struct msgbuf *foo;
+
+    foo = (struct msgbuf *) malloc(sizeof(struct msgbuf) +1);
+    return 1;],
+   [AC_MSG_RESULT(msgbuf)],
+   [AC_TRY_COMPILE(
+     [#include <sys/types.h>
+      #include <sys/ipc.h>
+      #include <sys/msg.h>
+     ],
+     [struct mymsg *foo;
+
+      foo = (struct mymsg *) malloc(sizeof(struct mymsg) +1);
+      return 1;
+     ],
+     [AC_DEFINE(msgbuf, mymsg, [msgbuf is called mymsg])
+      AC_MSG_RESULT(mymsg)
+     ],
+     [AC_MSG_ERROR([none. Cannot make sysvmsg module])
+     ])
+   ])
   AC_DEFINE(HAVE_SYSVMSG, 1, [ ])
   PHP_NEW_EXTENSION(sysvmsg, sysvmsg.c, $ext_shared)
 fi
Index: ext/sysvmsg/sysvmsg.c
===================================================================
RCS file: /repository/php4/ext/sysvmsg/sysvmsg.c,v
retrieving revision 1.2
diff -u -r1.2 sysvmsg.c
--- ext/sysvmsg/sysvmsg.c       29 Apr 2002 12:52:34 -0000      1.2
+++ ext/sysvmsg/sysvmsg.c       8 Sep 2002 01:23:27 -0000
@@ -94,7 +94,9 @@
        le_sysvmsg = zend_register_list_destructors_ex(sysvmsg_release, NULL, "sysvmsg 
queue", module_number);
        REGISTER_LONG_CONSTANT("MSG_IPC_NOWAIT", IPC_NOWAIT, 
CONST_PERSISTENT|CONST_CS);
        REGISTER_LONG_CONSTANT("MSG_NOERROR", MSG_NOERROR, CONST_PERSISTENT|CONST_CS);
+#ifdef MSG_EXCEPT
        REGISTER_LONG_CONSTANT("MSG_EXCEPT", MSG_EXCEPT, CONST_PERSISTENT|CONST_CS);
+#endif
        return SUCCESS;
 }
 /* }}} */
-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to