]> granicus.if.org Git - php/commitdiff
- Fix build for new ming versions
authorMarcus Boerger <helly@php.net>
Thu, 24 Nov 2005 00:51:44 +0000 (00:51 +0000)
committerMarcus Boerger <helly@php.net>
Thu, 24 Nov 2005 00:51:44 +0000 (00:51 +0000)
# Maybe we should check if it is safe to MFH all the corresponding changes
# in head. But why is this out of sync anyway?

ext/ming/config.m4
ext/ming/ming.c

index a20e3bd9801527af2bfc8d28f0c7d63f28b39974..a339c295f6e40f0c8faae87b80e59243268f15d9 100644 (file)
@@ -72,6 +72,13 @@ yes
     AC_DEFINE(HAVE_NEW_MING,  1, [ ]) 
     dnl FIXME: This is now unconditional..better check coming later.
     AC_DEFINE(HAVE_MING_ZLIB, 1, [ ])
+    AC_TRY_COMPILE([
+#include <ming.h>
+int main(int,void) {
+  SWFMovie_output(NULL, NULL, NULL, 0));
+  return 0;
+}
+       ], [ AC_DEFINE(HAVE_MING_MOVIE_LEVEL, 1, []) ])
   ])
   CPPFLAGS=$old_CPPFLAGS
 
index c5480e7e4f8ed0c41da21dc40ded650e9cd61250..06ceb3773ec1a73b5905a71ceb4a4830ccdc83bc 100644 (file)
@@ -2244,7 +2244,7 @@ PHP_METHOD(swfmovie, output)
                Ming_setSWFCompression(oldval);
        }       
        RETURN_LONG(out);
-#elif defined(HAVE_NEW_MING)
+#elif defined(HAVE_NEW_MING) && defined(HAVE_MING_MOVIE_LEVEL)
        zval **zlimit = NULL;
        int limit = -1;
        int argc = ZEND_NUM_ARGS();
@@ -2323,7 +2323,7 @@ PHP_METHOD(swfmovie, saveToFile)
        if (oldval >= -1 && oldval <=9)
                Ming_setSWFCompression(oldval);
        RETURN_LONG(out);
-#elif defined(HAVE_NEW_MING)
+#elif defined(HAVE_NEW_MING) && defined(HAVE_MING_MOVIE_LEVEL)
        RETURN_LONG(SWFMovie_output(movie, &phpStreamOutputMethod, what, limit));
 #else
        RETURN_LONG(SWFMovie_output(movie, &phpStreamOutputMethod, what));
@@ -2374,7 +2374,7 @@ PHP_METHOD(swfmovie, save)
                  
        if (Z_TYPE_PP(x) == IS_RESOURCE) {
                ZEND_FETCH_RESOURCE(stream, php_stream *, x, -1,"File-Handle",php_file_le_stream());
-#if defined(HAVE_NEW_MING)
+#if defined(HAVE_NEW_MING) && defined(HAVE_MING_MOVIE_LEVEL)
                RETURN_LONG(SWFMovie_output(getMovie(getThis() TSRMLS_CC), &phpStreamOutputMethod, stream, limit));
 #else
                RETVAL_LONG(SWFMovie_output(getMovie(getThis() TSRMLS_CC), &phpStreamOutputMethod, stream));
@@ -2393,7 +2393,7 @@ PHP_METHOD(swfmovie, save)
                RETURN_FALSE;
        }
        
-#if defined(HAVE_NEW_MING)
+#if defined(HAVE_NEW_MING) && defined(HAVE_MING_MOVIE_LEVEL)
        retval = SWFMovie_output(getMovie(getThis() TSRMLS_CC), &phpStreamOutputMethod, (void *)stream, limit);
 #else
        retval = SWFMovie_output(getMovie(getThis() TSRMLS_CC), &phpStreamOutputMethod, (void *)stream);